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!