Message Boards Message Boards

0
|
11282 Views
|
7 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Solve this Trigonometric system of equations?

Posted 8 years ago

Hi, I'm looking to find the result of a set of two trigonometric equations. the answers are x=17.83 degree and y=37.97degrees.

Solve[{1 - Cos[3 x] + Cos[3 y] == 0, 
  1 - Cos[5 x] + Cos[5 y] == 0}, {x, y}]

i'm using the above command but its giving me a crazy answer :) I'd really appreciate a little help plz

POSTED BY: Muhammad Afzal
7 Replies

Yes, just give an initial point close to your solution:

eqns3 = eqns /. 
   Subscript[\[Alpha], i_] :> 
    ToExpression["a" <> ToString[i]]*Pi/180;
FindRoot[eqns3, {{a1, 10}, {a2, 16}, {a3, 31}, {a4, 33}}]

and you will get

{a1 -> 10.5456, a2 -> 16.0925, a3 -> 30.9046, a4 -> 32.8669}
POSTED BY: Gianluca Gorni

The equation seems quite hard to solve symbolically. You can try numerical methods, starting from random initial points:

eqns2 = eqns /. 
   Subscript[\[Alpha], i_] :> ToExpression["a" <> ToString[i]];
sol = FindRoot[eqns2,
  {{a1, RandomInteger[{5, 20}] Pi/180},
   {a2, RandomInteger[{5, 20}] Pi/180},
   {a3, RandomInteger[{5, 20}] Pi/180},
   {a4, RandomInteger[{5, 20}] Pi/180}}]
eqns2[[All, 1]] /. sol

After some non convergent attempts I found a reasonable candidate solution:

{a1 -> 0.184056, a2 -> 0.280866, a3 -> 0.539386, a4 -> 0.573635}

for which the equations are satisfied to machine precision and the Jacobian is nonsingular.

POSTED BY: Gianluca Gorni
Posted 8 years ago

Thank you very much Gianluca , though i didnt get the results i was expecting but that's really a nice help thanks. by the way results are a1=10.55,a2=16.09,a3=30.91,a4=32.87

POSTED BY: Muhammad Afzal

If you are just looking for one answer (not all of them) and only approximately (not exact), then using FindRoot generally gives better and faster results:

sol={x,y}/.FindRoot[{1-Cos[3 x]+Cos[3 y]==0,1-Cos[5 x]+Cos[5 y]==0},{{x,10Degree},{y,40Degree}}];
N[sol]/Degree

{17.8318, 37.966}
POSTED BY: Sander Huisman

If you do it this way

Select[Solve[{1 - Cos[3 x Degree] + Cos[3 y Degree] == 0, 
     1 - Cos[5 x Degree] + Cos[5 y Degree] == 0}, {x, y}] // N // 
  Simplify, FreeQ[#, Complex] &]

you will find your solution about 5th from the end. It's complicated because there are infinitely many solutions to parameterize. Another way is to give bounds for x and y:

N@Reduce[{1 - Cos[3 x Degree] + Cos[3 y Degree] == 0, 
   1 - Cos[5 x Degree] + Cos[5 y Degree] == 0, 0 < x < 180, 
   0 < y < 180}, {x, y}]
POSTED BY: Gianluca Gorni
Posted 8 years ago

Thank you very much Really appreciate your help Regards

POSTED BY: Muhammad Afzal
Posted 8 years ago

Hi Gianluca, how you doing? i hope you are fine with good health. Could you please help me out to find the solution of this system of equations. i have attached the mathematica file as well. enter image description here

Attachments:
POSTED BY: Muhammad Afzal
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract