How to use ode45 to model malaria?

6 visualizaciones (últimos 30 días)
Paul Hart
Paul Hart el 15 de Abr. de 2020
Respondida: Stephan el 16 de Abr. de 2020
I'm trying use an SEIRS-SEI model to model malaria using ODEs. I'm not sure what I'm doing wrong with my code. Please any help would be appreciated
function dydt = malariaSEIRS(t,y);
psih=0.000055; % Human birth rate;
betah=0.022;
sigmah=4.3;
Vh=0.1;
gamma=0.0035;
delta=0.000018;
rho=0.0027;
microh=0.0000088;
Nh=10000;
Zh=1.1;
dydt(1) = psih*Nh + rho*y(4) - (Zh + microh)*y(1);
dydt(2) = Zh+y(1) - (Vh - microh)*y(2);
dydt(3) = Vh+y(2) - (gamma + delta + microh)*y(3);
dydt(4) = gamma*y(3) - (rho + microh)*y(4);
dydt = [dydt(1);dydt(2);dydt(3);dydt(4)];
tspan = [0 100];
y0 = zeros(1,4)
[T,Y] = ode45(@malariaSEIRS, tspan, y0);
figure(1)
plot(T,Y)
grid
legend('S', 'E', 'I', 'R', 'Location', 'SE')
end

Respuestas (1)

Stephan
Stephan el 16 de Abr. de 2020
tspan = [0 100];
y0 = zeros(1,4);
[T,Y] = ode45(@malariaSEIRS, tspan, y0);
figure(1)
plot(T,Y)
grid
legend('S', 'E', 'I', 'R', 'Location', 'SE')
function dydt = malariaSEIRS(~,y)
% betah=0.022; unused value
% sigmah=4.3; unused value
psih=0.000055; % Human birth rate;
Vh=0.1;
gamma=0.0035;
delta=0.000018;
rho=0.0027;
microh=0.0000088;
Nh=10000;
Zh=1.1;
dydt(1) = psih*Nh + rho*y(4) - (Zh + microh)*y(1);
dydt(2) = Zh+y(1) - (Vh - microh)*y(2);
dydt(3) = Vh+y(2) - (gamma + delta + microh)*y(3);
dydt(4) = gamma*y(3) - (rho + microh)*y(4);
dydt = [dydt(1);dydt(2);dydt(3);dydt(4)];
end

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by