solve 2 equation of 2 unknown
조회 수: 6 (최근 30일)
이전 댓글 표시
Hi All
I have two equations i am trying to solve. I used the next small code but I received an error message.
the 2 equations: r2*sind(theta2)-r3*sind(theta3)-r4=0 r1+r2*cosd(theta2)-r3*cosd(theta3)=0
Known: r2=3; r3=3.927; r4=0.335; theta2=10;
Code: lear all clc syms theta3 sind(theta3) r1 r2=3; r3=3.927; r4=0.335; theta2=10; t=(r2*sind(theta2)-r3*sind(theta3)-r4); theta3=subs(char(solve(t,theta3))); tt=vpa(r1+r2*cosd(theta2)-r3*cosd(theta3)); r1=subs(char(solve(tt,r1))); theta3 r1
Error: Error using mupadengine/feval (line 157) MuPAD error: Error: Cannot differentiate equation. [numeric::fsolve]
Error in solve (line 160) sol = eng.feval('symobj::solvefull',eqns,vars);
댓글 수: 0
채택된 답변
Ahmed A. Selman
2013년 4월 27일
Use the code instead:
clc
clear
syms theta3 r1
%sind(theta3) % NOT NEEDED
r2=3;
r3=3.927;
r4=0.335;
theta2=10;
t=(r2*sin(theta2)-r3*sin(theta3)-r4);
theta3=subs(char(solve(t,theta3)));
tt=vpa(r1+r2*cos(theta2)-r3*cos(theta3));
OUT(1)=subs(char(solve(tt(1),r1))); % Can't usr r1=solve(tt,'r1')!
OUT(2)=subs(char(solve(tt(2),r1)));
theta3
OUT
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!