Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
how to solve these equations and plot the values?

Subject: how to solve these equations and plot the values?

From: sudhir singla

Date: 23 Mar, 2010 19:03:20

Message: 1 of 4

hey ya all,
i have the following equations. how can i optimally find solution for the angles a1 and a2 ?

cos(a1)+ cos(a2) =m (where m is a constant that varies from 0.4 to 1)
cos(3a1)+ cos(3a2) =0
cos(5a1)+ cos(5a2) =0
cos(7a1)+ cos(7a2) =0
cos(9a1)+ cos(9a2) =0

also i want to plot these values with m on x-axis and angles on y-axis of same graph . how can i do this ?

it can also be solved by putting cos(a1)=x1, cos(a2)=x2 . hence =ns become:

x1+x2=m
-3x1+4x1^3-3x2+4x2^3 =0
and so on ...

if you have any paper on how to solve these. please mail me at sudhir.414@gmail.com

thanks in advance ..

Subject: how to solve these equations and plot the values?

From: sudhir singla

Date: 23 Mar, 2010 19:11:23

Message: 2 of 4

Also 0<=a1<=a2<= (pie/2)
OR 0<=x2<=x1<=1 for the above equations..

Subject: how to solve these equations and plot the values?

From: Roger Stafford

Date: 24 Mar, 2010 05:51:22

Message: 3 of 4

"sudhir singla" <sudhir.414@gmail.com> wrote in message <hob39o$n85$1@fred.mathworks.com>...
> hey ya all,
> i have the following equations. how can i optimally find solution for the angles a1 and a2 ?
>
> cos(a1)+ cos(a2) =m (where m is a constant that varies from 0.4 to 1)
> cos(3a1)+ cos(3a2) =0
> cos(5a1)+ cos(5a2) =0
> cos(7a1)+ cos(7a2) =0
> cos(9a1)+ cos(9a2) =0
>
> also i want to plot these values with m on x-axis and angles on y-axis of same graph . how can i do this ?
>
> it can also be solved by putting cos(a1)=x1, cos(a2)=x2 . hence =ns become:
>
> x1+x2=m
> -3x1+4x1^3-3x2+4x2^3 =0
> and so on ...
>
> if you have any paper on how to solve these. please mail me at sudhir.414@gmail.com
>
> thanks in advance ..

  If x and y are defined as x = (a1+a2)/2 and y = (a1-a2)/2, then because of the trigonometric identity

 cos(A)+cos(B) = 2*cos((A+B)/2)*cos((A-B)/2) ,

your equations can be replaced by the equivalent equations

 2*cos(x)*cos(y) = m
 2*cos(3*x)*cos(3*y) = 0
 2*cos(5*x)*cos(5*y) = 0
 2*cos(7*x)*cos(7*y) = 0
 2*cos(9*x)*cos(9*y) = 0

  In each of these last four equations one of the cosines must equal zero to yield a zero product, which means that its argument must be an odd integral multiple of pi/2 and this is a stringent condition indeed. According to my (somewhat hasty) calculations, it is actually impossible to satisfy all four equations without causing m to also equal 0. If I am correct in this, it means that your plot can have only the single value of zero for m, and this does not lie in the range 0.4 to 1.

Roger Stafford

Subject: how to solve these equations and plot the values?

From: Walter Roberson

Date: 24 Mar, 2010 06:36:00

Message: 4 of 4

Roger Stafford wrote:
> "sudhir singla" <sudhir.414@gmail.com> wrote in message
> <hob39o$n85$1@fred.mathworks.com>...
>> hey ya all,
>> i have the following equations. how can i optimally find solution for
>> the angles a1 and a2 ?
>>
>> cos(a1)+ cos(a2) =m (where m is a constant that varies from 0.4 to 1)
>> cos(3a1)+ cos(3a2) =0
>> cos(5a1)+ cos(5a2) =0
>> cos(7a1)+ cos(7a2) =0
>> cos(9a1)+ cos(9a2) =0

> If x and y are defined as x = (a1+a2)/2 and y = (a1-a2)/2, then because
> of the trigonometric identity
>
> cos(A)+cos(B) = 2*cos((A+B)/2)*cos((A-B)/2) ,
>
> your equations can be replaced by the equivalent equations
>
> 2*cos(x)*cos(y) = m
> 2*cos(3*x)*cos(3*y) = 0
> 2*cos(5*x)*cos(5*y) = 0
> 2*cos(7*x)*cos(7*y) = 0
> 2*cos(9*x)*cos(9*y) = 0
>
> In each of these last four equations one of the cosines must equal zero
> to yield a zero product, which means that its argument must be an odd
> integral multiple of pi/2 and this is a stringent condition indeed.

The first and third equations together have solutions involving +/-Pi/10
and +/-3*Pi/10, independent of m. There are also solutions involving
+/-arccos(1/4*m*(10-2*5^(1/2))^(1/2)+1/20*m*(10-2*5^(1/2))^(1/2)*5^(1/2))
which does not simplify to any particularly nice multiple of Pi.


> According to my (somewhat hasty) calculations, it is actually impossible
> to satisfy all four equations without causing m to also equal 0. If I
> am correct in this, it means that your plot can have only the single
> value of zero for m, and this does not lie in the range 0.4 to 1.

5 equations, actually, but Yes, solving them simultaneously requires m=0
. However, based upon the questions about multiple lines on the same
plot, I am suspecting that the original poster wanted to solve the first
equation in combination with one of the other equations at a time.

Solving the first and last equations together and exploring all the
roots of the quartic, leads to some pretty odd plots! I'm still
scratching my head about where some of the discontinuities originate
from -- that is, having trouble figuring out why they are where they are.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us