Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Using Solve/FSolve for Multiple Trig Equations
Replies: 7   Last Post: May 4, 2013 8:44 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Alan Weiss

Posts: 1,253
Registered: 11/27/08
Re: Using Solve/FSolve for Multiple Trig Equations
Posted: May 1, 2013 3:24 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 5/1/2013 2:24 PM, Nasser M. Abbasi wrote:
> On 5/1/2013 11:16 AM, Jung wrote:
>> Hello,
>>
>> I am trying to solve for:
>> y
>> r
>> p
>>
>> in the following equations where I, J, K are known.
>>
>> I = siny * sinr + cosy * sinp * cosr
>> J = -siny * cosr + cosy * sinp * sinr
>> K = cosy * cosp
>>
>> The code I have used is:
>>
>> syms r p y i j k
>>
>> S = solve(i == sin(y)*sin(r)+cos(y)*sin(p)*cos(r), j ==
>> -sin(y)*cos(r)+cos(y)*sin(p)*sin(r), k == cos(y)*cos(p))
>> S.r
>> S.p
>> S.y
>>
>> but I cannot seem to get a result.
>>

>
>
> it is normally very hard to obtain analytical solutions for
> trig equations since these are nonlinear and involves inverse functions
> with branch cuts as well. So to solve for 'y','p', and 'r'
> about, you might want to try a numerical approach.
>
> But I am not an expert in this.
>
> --Nasser
>


Your problem interested me. I believe that I have a proof that, at least
among real values for p, r, and y, there is no solution.

Look at the third equation
cosy * cosp = 0

Suppose that cos(y) = 0.
Then the first equation becomes
(+-1)*sin(r) + 0 = 0
So sin(r) = 0.

The second equation is
(+-1) * (+-1) + 0 = 0.
This is impossible.

So in the third equation we have cos(p) = 0. so sin(p) = (+-1)
Suppose sin(p) = 1.
Use the addition formulas for cos(a+b) and sin(a+b).
Then the first and second equations become
cos(r-y) = 0
sin(r-y) = 0
But this is impossible.

So suppose sin(p) = -1.
Then the first and second equations become
-cos(r+y) = 0
-sin(r+y) = 0
This is impossible as well.

So there is no solution to the equations, at least over the reals, and I
think even over complex, too.

Alan Weiss
MATLAB mathematical toolbox documentation



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.