필터 지우기
필터 지우기

symbolic solving system of non-linear equations

조회 수: 9 (최근 30일)
Konrad
Konrad 2023년 11월 29일
댓글: Sam Chak 2023년 11월 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?
  댓글 수: 1
Walter Roberson
Walter Roberson 2023년 11월 29일
For one thing, the calculation would be faster if you switched the angles to radians

댓글을 달려면 로그인하십시오.

답변 (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