ode_covid19_v2.m 1.66 KB
%ODE model to describe the spread and clinical progression of COVID-19

function dx=ode_covid19_v2(t,x,p,Tlock1,s01,s11)%,Tlock2,s02,s12)

be = p(1);
b0 = p(2);                
b1 = p(3);
b2 = p(4);
b3 = p(5);
a0 = p(6);
a1 = p(7);
f = p(8);
g0 = p(9);
g1 = p(10);
p1 = p(11);
g2 = p(12);
p2 = p(13);
g3 = p(14);
u = p(15);
%seas_amp = p(16);
%seas_phase = p(17);
%s0 = p(18);
%s1=p(19);
%se=p(20);
%k_e0s=p(21);
%g4=p(22);
%u2 = p(23);

%seas=(1 + seas_amp*cos(2*pi*(t-seas_phase)/365));

% if t<Tlock
%     s0 = 1;
%     s1 = 1;
% elseif t>=Tlock && t<Tlock2
%     s0 = int_s0;
%     s1 = int_s1;  
% else
%     s0 = v11
%     s1 = v2;
% end

s0 = (t<Tlock1) + s01 * (t>=Tlock1); %* (t<Tlock2) + s01(2)*(t>=Tlock2);
s1 = (t<Tlock1) + s11 * (t>=Tlock1); %* (t<Tlock2) + s11(2)*(t>=Tlock2);

%susceptibles individuals (not infected)
S = x(1);
%exposed individuals, infected but no symptoms and no transmission
E0 = x(2);
%exposed individuals, infected but no symptoms and can transmit
E1 = x(3);
%infected individuals but asymptomatic infection
I0 = x(4);
%infected individuals, mild infection
I1 = x(5);
%infected individuals, severe infection
I2 = x(6);
%infected individuals, critical infection
I3 = x(7);
%recovered
R = x(8);
%dead
D = x(9);


dS = - (be *s0* E1 + b0*s0*I0 + b1*s1*I1 + b2*I2 + b3*I3)*S; % + k_e0s * E0;
dE0 = (be *s0* E1 + b0*s0*I0 + b1*s1*I1 + b2*I2 + b3*I3)*S -a0*E0; % - k_e0s * E0; 
dE1 = a0 * E0 - a1*E1; % -g4*E1;
dI0 = f * a1 * E1 - g0*I0;
dI1 = (1-f) * a1 * E1 - g1*I1 - p1*I1;
dI2 = p1 * I1 - g2*I2 - p2*I2; % -u2*I2;
dI3 = p2 * I2 - g3 *I3 - u * I3;
dR = g0*I0 + g1*I1 + g2*I2 + g3*I3; % +g4 * E1;
dD = u * I3; % + u2 * I2;



dx=[dS;dE0;dE1;dI0;dI1;dI2;dI3;dR;dD];