In ODE models, divide the total population into several compartments and find ODEs between them.
Two compartments and . Both of them are functions of time .
Model
Conservation of population , where denotes the total population.
with initial condition and .
Here is the rate of infection and is the fraction of infected people.
A compact representation is:
Explanation: is the number of susceptible person will encounter an infected one. Multiply the rate of infection is the rate of change of infected person. The minus sign in the first equation is from the converstation of total population.
Simply add these two equations, we have and thus for all . Again this is the conservation of population. No death is included in the model.
Analytic solution
Substitute into the second equation to get a first order ODE
Its solution is
which is a standard logistic function and also known as the sigmoid function used in machine learning.
Solution to the ODE
Let and obtain a linear ODE for which the exact solution is where the constant is determined by the initial condition . Therefore the solution of (5) is
The asymptotic of the solution is
A sad conclusion: eventually all people will get infected.
We plot several curves of for different with other parameters fixed . Although for all , the derivative for different will have different peak at different time.
Numerical solution
For SI model, we can use the analytic formula but in general it is not easy to solve ODE systems analytically. The simplest numerical methods for solving ODE is the forward Euler method. Recall the definition of derivative
In forward Euler method, we chose a fixed and rewrite the ODE systems as the difference equation
To understand the meaning of (7), let us chose . Depending on the unit of the time, it means day, hour, or month. To fix the idea, we chose the unit as "day".
The meaning of equation for can be understood as: the number of infected people in the next day is equal today's plus the new infected which is the susceptible multiply the possibility of encounter an infected person the ratio of infected people and then multiply the infection rate .
Start from , we can compute and repeat the procedure to compute for all later time.
The main drawback of the forward Euler method is the stability. If is too large, then the numerical solution could below up and not a faithful approximation of the true one.
Read: Numerical methods for ordinary differential equations for a short introduction and take Math 107 or Math 225.
Discussion
Due to the symmetry of the solution, we know when , the second derivative . Solving this equation to get .
The first derivative of is always positive which means is a monotone increasing function but the speed of increasing acheives the peak at .
This is almost true in related but more sophiscated models. So a rule of thumb for the predicition of the total infected number: when you observe the turning point (daily increasing number is decreasing), double the current number.
The fact all peopole will get infected is quite frustrating. What is the limitation of SI model? At least we didn't consider:
To include the death, we introduce another parameter : the death rate. Then simply add a damping term to the second equation
Now adding these two equations will give a damping of the total population .
We shall discuss SIR model to include the recovery component in the next section and continue to conisder the situation where the disease is not recoveryable. One such example is AIDS. Then SI model implies if we have some people get HIV positive, then eventually we all get it.
Obviously, this is not true. What's wrong here?
In ODE models, we assume people are full connected but this assumption is wrong for AIDS. To include the connectedness into the model, we should introduce the concept of complex network and use graph theory which will be discussed later on.
Exercise Try to analyze and discuss the behavior of the model for different parameters and .
We introduce one more compartments and consider SIR model.
Model
We still use parameter to denote the rate of transition from infectious to recovered. Then the model becomes
with initial condition , and . Note that the first two equations are the same as , where we interpret as the death rate.
And the compact representation is
Again conservation of population can be obtained by summing all equations together. That is for all .
Numerical solution
It is not easy to solve this system to get the analytic solution. But numerical simulation is still the same. We write out the forward Euler's method with .
which gives a better explanation of the model. For example, the last one means tomorrow's recovered people is equal to today's add the recovered ratio multiply the number of infected people .
In MATLAB, one can simply use ode45
.
xfunction SIR(N,I0,beta,gamma,tend)
tspan = [0,tend];
S0 = N - I0;
R0 = 0;
y0 = [S0; I0; R0];
[t,y] = ode45(@(t,y) SIRfunc(t,y,beta,gamma,N), tspan, y0);
plot(t,y(:,1),'-',t,y(:,2),'m-',t,y(:,3),'g-','LineWidth',2);
legend('Susceptible','Infectious','Recovered')
title('SIR model')
end
function dydt = SIRfunc(~,y,beta,gamma,N)
dydt = [-beta/N*y(2)*y(1); ...
beta/N*y(2)*y(1) - gamma*y(2); ...
gamma*y(2)];
end
Run SIR(1000,10,0.1,0.05,300)
we get the following figure
Parameters for the figure: .
Observation
From the figure, we can conclude:
Exercise
Prove there exists so that and
Analysis of (S, R)
We denote by which is the famous Basic Reproduction Number of the disease. As , for all , we can eliminate and obtain a system of only.
From the exercise, we can let and the deriavative become zero as the functions apporache to constants. Therefore the right hand side of is also zero. We then obtain the relation and thus . We thus proved obersvation 1 and 2.
Let's try to figure out an equation for . The first equation in (12) divided by the second one imples an ODE
with initial condition . It can be easily solved to get
Substitute in terms of in the second equation of , we get a nonlinear ODE of
Unfortunately I can't solve this onlinear ODE.
But we can get an algebraic equation of the limit. Let and use , we obtain from (13) the relation
whose solution can be easily obtained, e.g., by Newton's method. In application, ( e.g. 1 patient over million people) and . With an abuse of notation, we set , we can solve the equation
to get an accurate estimate of the population ratio which remains non-infected in the end.
Analysis of I
We turn to the estimate of infected number . We rewrite the equation as
We can solve in terms of as
Again we only obtain the relation between and not analytic formulation of the solution.
Remember and thus in the beginning and always true.
The behavior of depends on crucially
If , then which means the number of infected dies off exponetially. Recall that . It is less than one means the recover rate is greater than the infection rate. The disease will disappear. Indeed in this case, the disease is not considered as epidemic.
We then consider the epidemic case . From the first equation of SIR model, is decreasing.
We explore more on these 3 stages. We first plot in a different figure.
In the early stage, , by , the infected number is
Namely we obersve the exponential increase of infectious in the early stage. The rate is mainly determined by offside by .
When , the population starts having enough of what is known as Herd immunity for the disease to be unable to spread further.
We calculate the peak of as follows. Use the relation (13) for and , and use , we get, when , combine with the conservation of population , we get
With this formulation, it is easy to see is an increasing function of . Flatten the curve means reducing the peak below the health care system capacity.
Exercise Estimate the peak time .
Effect of Social distancing
Ways to reduce
Parameters for the figure: . When , we set and show the results by the dashed curves. The crticial parameter is dropped from to . We see immediately the infectious starts to decay exponentially and then the majority remains non-infected almost immediately (exponentially fast).
For coronavirus, the change is not that dramatically. This is due to the time delay for those who exposed to the infected but get infected after 7 - 14 days.
So we need to add one more compartment: Exposed and discuss SEIR model in the next section.
We introduce one more compartment and one more parameter and list them below.
Parameters .
The basic reproduction number is still defined by .
Model
We add as a transition between and and the system reads as
We use to denote the derivative with respect to . More importantly, we normlize all functions by dividing and thus it represents the ratio to the whole pouplation. Conservation of population becomes for which can be preserved by chosing initial condition satisfying . It is reasonable to chose and and thus , e.g., .
Numerical solution
We write out the forward Euler's method with .
which gives a better explanation of the model. For example, the last one means tomorrow's recovered people is equal to today's add the recovered ratio multiply the number of infected people .
We use as according many report of infected people will recovery without hosptilization. The rest will go to hosptial. We use which is reasonable according several studies. So . We use the averaged incubation period as days which implies .
Although the peak of is relatively small (thanks to the large recovery rate), eventually over will be infected due to the large .
Again we consider strick rules to reduce to . The first figure is control time starting from days and the second one is days. The change is dramatical.
Only days earlier, but the recovered popluation is reduced from almost to .
We discuss perturbated analysis for solving nonlinear ODEs. We use normalized variables and the nonlinear ODE we obtained is
with initial condition and .
Let . Then solution to can be written as
The problem is we do not the antiderative of for such a nonlinear .
We shall use polynomial approximations to at different point to find approximation of . First of all, we use approximation to simplify . Then we build the condition into the solution in the form, i.e., integrate from ,
Linear approximation
Consider . We get the solution
Quadratic approximation
Consider where are two real roots of . Use the factorization
we get
and
which is a logistic function transition from to and the critical point, i.e., is given by
We apply the formula to several points and get approximation at different stages.
Initial stage
We apply the formula to . For the linear approximation, we obtain
Use to get a quadratic ODE at . The corresponding setting is
Ending stage
We apply the formula at . For the linear approximation,
For the quadratic approximation, we obtain
Turning point stage
We apply the formula at , where is the peak time where achieves the maximum, i.e. . From the analysis of SI model, we know