Epsilon close solution to a trigonometrical system of equations.

3 views (last 30 days)
I am having the following trigonometrical system of equations that I want to solve, further restricting each angle in a specific interval (-pi/3,pi/3), (-2pi/3,0), (-2pi/3,0) respectively.
syms u1 u2 u3;
eqn = 3.98*cos(u1)+ 2.24*cos(u1+u2)+1.58*cos(u1+u2+u3) == d1;
eqn2 = 3.98*sin(u1)+ 2.24*sin(u1+u2)+1.58*sin(u1+u2+u3) == d2;
[solx, soly, solz, param, cond] = solve([eqn, eqn2], [u1,u2,u3], 'Real', true, 'ReturnConditions', true)
assume(cond)
solk = solve([solx >= -pi/3, solx <= pi/3, soly<=0, soly>= -2*pi/3,solz <=0,solz>=-2*pi/3],param)
Where u1,u2,u3 are the unknown angles and d1, d2 are the input parameters of my function. The problem are the following: a)Is my use of solve the appropriate? The function needs a lot of time to finish its execution.
b) Apart from the obvious solution (0,0,0) when I give as input (3.98+2.24+1.58,0), in every other input that I tried, I get that there is no solution. I guess this happens due to the high precision needed. For my function to produce an answer I need to find some d1,d2 :
d1^2+d2^2 = 7.8^2 ,
with finitely many decimal digits that is not what I intend. How can I put some e (epsilon) and express the notion that it is enough for the above sum to be epsilon close to
7.8^2

Answers (1)

Roger Stafford
Roger Stafford on 30 Mar 2016
The problem here is that you have more unknowns than equations. In such a case there is generally an infinite continuum of possible solutions. Matlab does not know which one you want.

Community Treasure Hunt

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

Start Hunting!