Delay diferential equation solution with dd23
1 次查看(过去 30 天)
显示 更早的评论
For first part, I use this code in Live editor:
%Solución ejercicio 7.29 i)
f=@(t,x,z)[z(1,2)^2+z(2,2)^2-6*z(1,1)-8*z(2,3);x(1)*(2*z(2,2)-x(1)+5-2*z(1,3)^2)];%Defino variables de estado, retrasos z y declaro ecuación diferencial principal
lags=[0.5 0.2 0.1];%Defino retardos
f2=@(t,x)[t,exp(t)];
tspan=[0 1.5];%Intervalo de tiempo
sol=dde23(f,lags,f2,tspan);
axis([0 1.5 -10 10])
legend('x','y')
For the second part, I am confused because the condition abut replace the term x^2(t-0.1) for x'(t-0.1) I can't code it. I tried this but I have one error
%Solución ejercicio 7.29 ii)
f=@(t,x,z)[z(1,2)^2+z(3,2)^2-6*z(1,1)-8*z(3,3);x(1)*(2*z(3,2)-x(1)+5-2*z(2,3))];%Defino variables de estado, retrasos z y declaro ecuación diferencial principal
%x=x(1), x'=x(2), y=x(3)
%z1=0.5 z2=0.2 z3=0.1
lags=[0.5 0.2 0.1];%Defino retardos
f2=@(t,x)[t,exp(t),1];
tspan=[0 1.5];%Intervalo de tiempo
sol=dde23(f,lags,f2,tspan);
axis([0 1.5 -10 10])
legend('x','y')
Derivative and history vectors have different lengths.
Please help me thanks
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Oceanography and Hydrology 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!