Delay diferential equation solution with dd23

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')
Error using dde23 (line 223)
Derivative and history vectors have different lengths.
Please help me thanks

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeHolidays / Seasons についてさらに検索

製品

リリース

R2018b

質問済み:

2020 年 2 月 28 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by