I am not well verse in Matlab, and tried to run the code below. However, I keep getting an error stating "Not enough input arguments." I'm not sure what does this means.
2 次查看(过去 30 天)
显示 更早的评论
clear all
c0 =40;
cd = 50;
y0 = 0.09;
h = 0.7;
tow = 5;
u = 0.05;
a = 260;
b = 0.1;
syms T tow
%x = '((a*h)/2)+((a*tow*T)/3)+((a*h*T*((exp^(-u*tow))+b))/3)+((a*tow*(T^2)*((exp^(-u*tow))+b))/8)-(c0/(T^2))+(cd*((3*a*y0*(exp^(-u*tow)))-(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*tow*(T^3)*y0*(exp^(-u*tow)))/24)-(cd*u*T*y0*(exp^(-u*tow))*((3*a-a*b*T)/6))';
%[T, tow]= solve ([x, y])
[solT,soltow] = solve ([((a*h)/2)+((a*tow*T)/3)+((a*h*T*((exp^(-u*tow))+b))/3)+((a*tow*(T^2)*((exp^(-u*tow))+b))/8)-(c0/(T^2))+(cd*((3*a*y0*(exp^(-u*tow)))-(2*T*a*b*y0*(exp^(-u*tow)))-(2*T*a*(b^2)))/6)==0, 1-((u*a*h*(T^2)*y0*(exp^(-u*tow)))/6)-((u*a*tow*(T^3)*y0*(exp^(-u*tow)))/24)-(cd*u*T*y0*(exp^(-u*tow))*((3*a-a*b*T)/6))==0], [T, tow])
TC = (c0/T)+(1/T)*(((a*h*(T^2))/2)+((a*tow*(T^3))/6)+((((a*y0*(exp^(-u*tow))+b)/2)*((h*(T^3)/3)+((tow*(T^4)/12))))))+(cd/T)*((((T^2)*y0*(exp^(-u*tow)))*(3*a-a*b*T))/6)+((tow*T)/T)
I need the answer: TC =230.390, T = 0.388 and tow = 48.420. Help me to find the answer.
0 个评论
采纳的回答
Walter Roberson
2021-5-31
In order to use
exp^(-u*tow)
You would need to have defined exp as a square array (including a scalar), or you would have had to have defined exp as a function that accepted no arguments.
If you were expecting exp to be the exponential, then do not use ^ : use
exp(-u*tow)
You could instead use
exp = exp(1);
and continue to use exp^ ... but that is not recommended, and would be less accurate than using exp() without the ^
2 个评论
Walter Roberson
2021-5-31
c0 =40;
cd = 50;
y0 = 0.09;
h = 0.7;
tow = 5;
u = 0.05;
a = 260;
b = 0.1;
syms T tow
[solT,soltow] = solve ([((a*h)/2)+((a*tow*T)/3)+((a*h*T*((exp(-u*tow))+b))/3)+((a*tow*(T^2)*((exp(-u*tow))+b))/8)-(c0/(T^2))+(cd*((3*a*y0*(exp(-u*tow)))-(2*T*a*b*y0*(exp(-u*tow)))-(2*T*a*(b^2)))/6)==0, 1-((u*a*h*(T^2)*y0*(exp(-u*tow)))/6)-((u*a*tow*(T^3)*y0*(exp(-u*tow)))/24)-(cd*u*T*y0*(exp(-u*tow))*((3*a-a*b*T)/6))==0], [T, tow])
TC = (c0/T)+(1/T)*(((a*h*(T^2))/2)+((a*tow*(T^3))/6)+((((a*y0*(exp(-u*tow))+b)/2)*((h*(T^3)/3)+((tow*(T^4)/12))))))+(cd/T)*((((T^2)*y0*(exp(-u*tow)))*(3*a-a*b*T))/6)+((tow*T)/T)
subs(TC, [T, tow], [solT, soltow])
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Number Theory 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!