solve 2 equation of 2 unknown
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Ahmed A. Selman
il 27 Apr 2013
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
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!