solve 2 equation of 2 unknown

2 ビュー (過去 30 日間)
Abdulaziz
Abdulaziz 2013 年 4 月 27 日
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);

採用された回答

Ahmed A. Selman
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
  1 件のコメント
Abdulaziz
Abdulaziz 2013 年 4 月 27 日
Thank you it works

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumeric Solvers についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by