ODE45 giving error
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
I am trying to solve a constitutive equation with ODE45, and I keep getting an error of "must return a column vector". I know that ODE45 must return a column vector, but I don't see where by error is in my code. I believe that is has to do with the heaviside and dirac functions. I would appreciate the help.
function CREEP
E1=5;
E2=10;
eta=5;
sigma0=20;
tspan=[0 100];
u=heaviside(tspan);
v=dirac(tspan);
sigma=(sigma0*u);
sigma_dot=(sigma0*v);
e0=sigma0/E1;
[t,e]=ode45(@creep, tspan, e0);
plot(t,e)
function strain=creep(t,e)
strain=(1/(E1+E2))*(sigma_dot+E2*sigma/eta-E1*E2*e/eta);
end
end
0 件のコメント
回答 (1 件)
Torsten
2017 年 3 月 8 日
0 投票
"strain" must have the same number of elements as "e0". Is this the case for your code ?
Best wishes
Torsten.
0 件のコメント
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!