symbolic solving system of non-linear equations

9 次查看(过去 30 天)
I have system of 12 equations, they look something like these.
equation1 = - cos((pi*theta6)/180)*(sin((pi*theta5)/180)*(cos((pi*theta1)/180)*cos((pi*theta2)/180)*sin((pi*(theta3 - 90))/180) - cos((pi*theta1)/180)*sin((pi*theta2)/180)*cos((pi*(theta3 - 90))/180)) - cos((pi*theta5)/180)*(cos((pi*theta4)/180)*(cos((pi*theta1)/180)*cos((pi*theta2)/180)*cos((pi*(theta3 - 90))/180) + cos((pi*theta1)/180)*sin((pi*theta2)/180)*sin((pi*(theta3 - 90))/180)) + sin((pi*theta1)/180)*sin((pi*theta4)/180))) - sin((pi*theta6)/180)*(sin((pi*theta4)/180)*(cos((pi*theta1)/180)*cos((pi*theta2)/180)*cos((pi*(theta3 - 90))/180) + cos((pi*theta1)/180)*sin((pi*theta2)/180)*sin((pi*(theta3 - 90))/180)) - cos((pi*theta4)/180)*sin((pi*theta1)/180))==cos(pi*b1/180);
How I can transform them to get symbolic value of theta1...theta6? I tried to use solve() but my computer is working for 6 days and I still do not have any resoult.
sol = solve([equation1, equation2, equation3, equation4, equation5, equation6, equation7, equation8, equation9, equation10, equation11, equation12], [theta1, theta2, theta3, theta4, theta5, theta6], 'ReturnConditions', true);
Can I do it in easier and faster way?

回答(2 个)

Torsten
Torsten 2023-11-29
移动:Torsten 2023-11-29
A system of 12 equations in 6 unknowns usually has no solution since it is overdetermined. Or can you extract 6 of the 12 equations, solve them and the solution will also satisfy the remaining 6 ? If this is not the case, try a numerical solver, e.g. lsqnonlin, which is especially suited for overdetermined nonlinear systems of equations.
  3 个评论
Sam Chak
Sam Chak 2023-11-29
Trigonometric equations typically have multiple solutions. How do you determine which solution yields the correct result? I wonder...
Konrad
Konrad 2023-11-29
This equations describes positon of 6 axes robot so I can just try the solution. I thought about @Torsten answer and this system of 12 equations should have solutions because there are denpend on each other.

请先登录,再进行评论。


John D'Errico
John D'Errico 2023-11-29
编辑:John D'Errico 2023-11-29
Solve does not apply to over-determined problems. But it does not know there may be some exact solution that solves the entire ssytem exactly. So it keeps on trying to find one. Worse, is that problems like this in symbolic form will end up with literally millions of terms. So the computations are incredibly time and memory consuming.
DON'T USE SOLVE! At best, you will need to use a numerical solver, perhaps lsqnonlin is best here for the over-determined problem. (Not vpasolve either.)
HOWEVER, remember there will be infinitely many solutions, if there are any. This is always the case for trig problems. But as much, remember there will be multiple solutions of a subtly different form. For example, what are the solutions to a problem as simple as
sin(x) == 1/2
You should see that x==pi/6 or 5*pi/6 are both solutions (30 or 150 degrees for you), and they come from different parts of the curve. As such, they can be viewed as are fundamentally different solutions. They may have different character in your problem, and some of these solutions may be more or less appropriate. This means you need to use intelligently chosen starting values.
  12 个评论
Konrad
Konrad 2023-11-29
it describe angles of end of robot, not angles of robot axis
Sam Chak
Sam Chak 2023-11-30
If you can reduce the number of equation, try solving it again.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Robotics 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by