Problems with symbolic solutions of nonlinear and linear solutions
Show older comments
syms x x1 x2 y y1 y2 theta p p1 p2 f f1 f2 m m1 m2 a b c d e g h ii jj k r s q w
eq_1 = x1+x2-2*x;
eq_2 = y1+y2-2*y;
eq_3 = 2*w*sin(theta)-x2+x1;
eq_4 = -y2+y1-2*w*(cos(theta)-1);
eq_5 = p1+p2-p;
eq_6 = f1+f2-f;
eq_7 = +m-m1-m2+(p1-p2)*w*cos(theta)+(f1-f2)*w*sin(theta);
eq_8 = f1-a*y1-c*theta-p1*(e*y1+h*theta);
eq_9 = f2-a*y2-c*theta-p2*(e*y2+h*theta);
eq_10 = m1-c*y1-b*theta-p1*(h*y1+g*theta);
eq_11 = m2-c*y2-b*theta-p2*(h*y2+g*theta);
eq_12 = 1/d*p1+[y1,theta]*[ii,k;k,jj]*[y1;theta]+p1*[y1,theta]*[r,q;q,s]*[y1;theta];
eq_13 = 1/d*p2+[y2,theta]*[ii,k;k,jj]*[y2;theta]+p2*[y2,theta]*[r,q;q,s]*[y2;theta];
[x,y,x1,x2,y1,y2,theta,p1,p2,f1,f2,m1,m2] = solve(eq_1,eq_2,eq_3,eq_4,eq_5,eq_6,eq_7,eq_8,eq_9,eq_10,eq_11,eq_12, eq_13,x,y,x1,x2,y1,y2,theta,p1,p2,f1,f2,m1,m2);
I tried to get the symbolic solutions by fuction 'solve' but it keeps giving me "Unable to find explicit solutions".
Just wondering if anyone can show me some tips?
Thanks in advance,
Ke
6 Comments
John D'Errico
on 29 Mar 2020
Edited: John D'Errico
on 29 Mar 2020
Just because you want to solve a general system of nonlinear equations, does not mean an analytical solution can be shown to exist. In fact, it is essentially trivial to generate an equation that has no such solution for the roots.
If all of the many parameters in your equations have known numerical values, then you can use one of many numerical solvers. If not, then you essentially have no recourse. As I said, just wanting something is not sufficient, even if you need it very badly.
You could do some things, like eliminate some of the linear variables, solving for them in terms of the others. While this is theoretically possible, even that will surely be incredibly computationally complex. But then you will be left with a nonlinear kernel, one that will very possibly have no solution at all. After all, solve did give up. This is difficult to know, but it does suggest you need to reconsider how you are trying to solve this problem.
Ke Wu
on 29 Mar 2020
John D'Errico
on 30 Mar 2020
Why would it not give you two solutions? :)
Much of the time when you have trig functions, there are multiple solutions. For example, even the simplest problem:
syms theta
solve(sin(theta) == 0.5)
ans =
pi/6
(5*pi)/6
has infinitely many solutions, but there are two that are of general interest, and are fundamentally different in some way. You can get the rest by adding integer multiples of 2*pi. As I said, there usually a few solutions for anything with trig functions.
Yes, fsolve (or vpasolve) is what I meant by a numerical solution.
The small angle trick is cetainly a decent approximation for such a small angle. I suppose you could use the second term from a Taylor series in there too, but that will make it nonlinear. Anyway, if your angles are that small, then dropping the higher order terms in the Taylor series will give you roughly 10 decimal places anyway. And that is roughly the default convergence tolerance for fsolve.
You might use the small angle approximation even for a symbolic solve, but there is no assurance your system of equations will be symbolically solvable. It will certainly be quite CPU intensive for a system of that size. Any solution you might find will be huge in terms of the number of terms.
Ke Wu
on 30 Mar 2020
John D'Errico
on 30 Mar 2020
Honestly, I don't know the answer to your question about a direct use of Maple, if that would change anything at all. Others might, or not. Sometimes the only true way to know is a direct test, if that is possible.
Ke Wu
on 30 Mar 2020
Answers (0)
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!