I need the Coding to solve the simultaneous equations. To find T, tow, TC.
2 ビュー (過去 30 日間)
古いコメントを表示
shunmugam hemalatha
2021 年 1 月 1 日
コメント済み: Walter Roberson
2021 年 1 月 4 日
lc
clear all
c0=40;
cd=50;
y0=0.09;
h=0.7;
r=5;
u=0.05;
a=260;
b=0.1;
x='((a*h)/2)+((a*r*T)/3)+((a*h*T*((exp(-u*tow))+b))/3+((a*r*(T^2)*(exp(-u*tow))+b))/8)-(c0/(T^2))+((cd*((3*a*y0*(exp(-u*tow)))-2(2*T*a*b*y0*(exp(-u*tow)))-(2*T*a*(b^2))/6)';
y='1-((u*a*h*(T^2)*y0*(exp(-u*tow)))/6)-((u*a*r*(T^3)*y0*(exp(-u*tow)))/24)-(cd*u*T*y0*(exp(-u*tow))*((3*a-a*b*T)/6))';
TC=(c0/T)+(1/T)*(((a*h*(T^2))/2)+((a*r*(T^3))/6)+((((a*(y0*(exp(-u*tow)))+b)/2))*(((h*(T^3))/3)+((r*(T^4))/12))))+((cd/T)*((((T^2)*y0*(exp(-u*tow))*(3*a-a*b*T))-(a*(b^2)*(T^3)))/6))+tow
0 件のコメント
採用された回答
Walter Roberson
2021 年 1 月 1 日
You cannot solve that without fixing your formulas.
syms T tow
c0=40;
cd=50;
y0=0.09;
h=0.7;
r=5;
u=0.05;
a=260;
b=0.1;
A = a; %??? maybe ?
R = r; %??? maybe ?
B = b; %??? maybe ?
x = ((a*h)/2)+((a*r*T)/3)+((a*h*T*((exp(-u*tow))+b))/3+((a*r*(T^2)*(exp(-u*tow))+b))/8)-(c0/(T^2))+((cd*((3*a*y0*(exp(-u*tow)))-2*(2*T*a*b*y0*(exp(-u*tow)))-(2*T*a*(b^2))/6);
12 1 0 12 1 0 12 34 5 43 21 23 4 3 4 5 43 21 0 1 2 10 12 34 5 6 543 4 5 6 543 4 5 43 2
You have two more ( than you have )
y = 1-((u*a*h*(T^2)*y0*(exp(-u*tow)))/6)-((u*a*r*(T^3)*y0*(exp(-u*tow)))/24)-(cd*u*T*y0*(exp(-u*tow))*((3*a-a*b*T)/6));
sol = solve([x,y], [T tow]);
T = sol.T;
tow = sol.tow;
TC = (c0/T)+(1/T)*(((a*h*(T^2))/2)+((a*r*(T^3))/6)+((((a*(y0*(exp(-u*tow)))+b)/2))*(((h*(T^3))/3)+((r*(T^4))/12))))+((cd/T)*((((T^2)*y0*(exp(-u*tow))*(3*a-a*b*T))-(a*(b^2)*(T^3)))/6))+tow;
disp(T)
disp(tow)
disp(TC)
vpa(T)
vpa(tow)
vpa(TC)
0 件のコメント
その他の回答 (1 件)
shunmugam hemalatha
2021 年 1 月 4 日
2 件のコメント
Walter Roberson
2021 年 1 月 4 日
Using solve with quoted strings has not been valid for several releases, and has not been a good idea since 2016 (there were some bugs then that forced using quoted strings for certain differential equations... for nearly any purpose other than differential equations, using quoted strings for symbolic expressions has not been a good idea since r2014a.
I posted the version without quoted strings already and you should have built on that.
Walter Roberson
2021 年 1 月 4 日
Your code here has the same problem as before, that you have more ( than you have )
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!