Solving three equations with three unknowns with matlab 2011

Hi!
I'm having trouble with solving these equations:
L1=1,66
L2=7,01
L3=3,58
t1, t2 and t3 are the unknown angles.
1: cos(t1)*(L3*cos(t2 + t3) + L2*cos(t2))=4.600
2: sin(t1)*(L3*cos(t2 + t3) + L2*cos(t2))=0.200
3: L1 + L3*sin(t2 + t3) + L2*sin(t2)=1.400

Answers (2)

There are at least 4 solutions:
t1 = 0.4345089537e-1, t2 = -.5282401133, t3 = 2.516094426
t1 = -3.098141759, t2 = -2.613352541, t3 = -2.516094426
t1 = 0.4345089539e-1, t2 = .4154231405, t3 = -2.516094425
t1 = -3.098141759, t2 = 2.726169514, t3 = 2.516094425
I can sketch a method of solving them which doesn't involve the 'solve' function. Divide the second equation by the first one to get:
tan(t1) = .2/4.6
t1 = atan(.2/4.6)
which means that t1 has two solution between -pi and +pi, namely
t1 = 0.043450895 and t1 - -0.043450895 and
sin(t1) = 0.043437224 or -0.043437224
Then the second equation can be written either as
L3*cos(t2 + t3) + L2*cos(t2) = 0.2/0.043437224 = 4.604345773 or
L3*cos(t2 + t3) + L2*cos(t2) = -4.604345773
Combining this with the third equation we have two equations of the form
L3*cos(t2 + t3) + L2*cos(t2) = K1
L3*sin(t2 + t3) + L2*sin(t2) = K2
where K1 is either 4.604345773 or -4.604345773 and K2 = 1.4-1.66 = -.26
These equations can be solved this way.
L3^2 = L3^2*sin(t2+t3)^2+L3^2*cos(t2+t3)^2 =
(K1-L2*sin(t2))^2+(K2-L2*cos(t2))^2 =
K1^2+K2^2+L2^2-2*K1*L2*sin(t2)-2*K2*L2*cos(t2)
K1*sin(t2)+K2*cos(t2) = (K1^2+K2^2+L2^2-L3^2)/(2*L2) = K3
Let x be such that
K1/sqrt(K1^2+K2^2) = sin(x)
K2/sqrt(K1^2+K2^2) = cos(x)
which we can solve using the 'atan' or 'atan2' functions and we then have
cos(t2-x) = K3*sqrt(K1^2+K2^2)
which will have two solutions between -pi and +pi using the acos function.
With t1 and t2 determined to these four possible combinations, two of the three equations can be used to determine sin(t2+t3) and cos(t2+t3) uniquely which will then determine t3 to one of four possibilities within -pi to +pi.
I leave the remaining details to you. You can undoubtedly use the 'solve' function to shortcut at least some of the steps above.
Note: I see that Walter has already obtained four solutions, but you may find the above types of manipulations useful in dealing with problems of this kind in the future.

1 Comment

The methods I used would not necessarily inform me if additional solutions existed; the methods you used are better for making those kinds of decisions.

Sign in to comment.

Tags

No tags entered yet.

Asked:

on 3 Apr 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!