MATLAB Answers

How to use ode45 to model malaria?

10 views (last 30 days)
Paul Hart
Paul Hart on 15 Apr 2020
Answered: Stephan on 16 Apr 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

  0 Comments

Sign in to comment.

Answers (1)

Stephan
Stephan on 16 Apr 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

  0 Comments

Sign in to comment.