how can i stay 7t longer in my code

1 visualización (últimos 30 días)
조현 김
조현 김 el 28 de Jun. de 2020
Respondida: Steven Lord el 28 de Jun. de 2020
[t,y]=ode45(@seirl,[0,300],[1,0,0.0014,0,0])
plot(t,y)
legend('S','E','I','R','l')
a=0.015;
b=0.6;
c=0.7;
e=0.2;
dydt=zeros(4,1);
dydt(1)=-a*y(1)*y(2);
dydt(2)=a*y(1)*y(2)-b*y(2)
dydt(3)=b*y(2)-c*y(3)
dydt(4)=c*y(3)
end
ive wrote those code to make SEIR model. But at the code I wrote, there are no incubation time,,, I want to make delay for 7t when moving dydt(2) to dydt(3) (when code goes dydt(2) to dydt(3), stay 7t to move on.) please help me :(

Respuestas (1)

Steven Lord
Steven Lord el 28 de Jun. de 2020
If your equations depend not just on the value of the solution at the current time but also the value of the solution at a previous time, you don't have a system of ordinary differential equations. Instead use a delay differential equation solver like dde23 or ddesd.

Categorías

Más información sobre Programming en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by