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.
조회 수: 1 (최근 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!