Part III.1 SIS differential Equation Approaches

Introduction

The differential equations that describe the SIS model are straight forward.  The differential equation for the SIS model only differs from the SI model with the addition of a single term. 

There are two useful modifications to these differential equations.  First, is the inclusion of a time variable \lambda(t).   The second is keeping track of how many infectious there are and how many recoveries.  It is important to remember that the variable I, infectious, stands for how many people are currently infectious.  It does NOT represent how many people have been infected since the beginning.  But we would like to know how many people have been infected and how many have recovered.  This will require that this variables be included int he differential equations.

The logistics solution is only valid for a fixed infection rate (plam in the code).  Because of this we will have two different SIS pieces of software, the first will not have variable infection rate.  In this code we can compare the results to the analytic solution.   Then we will implement variable infection rate, but eliminate the comparison with theory.  There will be two separate pages one for each code.  The pages will include the code, sample results, sample plots, and some commentary.

Basic Model

The number of infectious people who recover is assumed to be proportional to the number of infectious people, i.e. a constant fraction (γ).  Thus, at any time the rate of people who recover  (people per day) is γI(t).  This term is subtracted from the infectious I(t) population (they recovered) and added to the susceptible population S(t).  The governing differential equations become.

    \[ \frac{dI(t)}{dt} = \lambda \{ 1- \frac{I(t)}{N} \} I(t) -\gamma I(t)  \]

This equation can be broken down and rearranged so it has the same form as the SI model.

    \[ \frac{dI(t)}{dt} = \lambda  I(t) - \lambda \frac{I(t)}{N} I(t) -\gamma I(t) \]

or

    \[ \frac{dI(t)}{dt} = ( \lambda -\gamma )  I(t) - \lambda \frac{I(t)}{N}  I(t) \]

so

(1)   \begin{equation*} \frac{dI(t)}{dt} = ( \lambda -\gamma ) I(t) [ 1 -\frac{ \lambda}{ \lambda -\gamma} \frac{I(t)}{N}  ] \end{equation*}

Solving the differential equation

Lets us rewrite this with \lambda^* = \lambda-\gamma and N* = N \frac{\lambda - \gamma}{\lambda}  we have

(2)   \begin{equation*} \frac{dI(t)}{dt} =  \lambda^* I(t) [ 1 -\frac{I(t)}{N^*}  ] \end{equation*}

This is the differential equation that gave us the Logistics equation.  There are however two changes.  The growth rate is now the difference between the infection rate and the recovery rate.  If the recovery rate is greater than the infection rate, the number of infectious cases declines.  If the infection rate is above the recovery rate the infection rate grows.  The second change is that the ultimate number of people that are infected is N^* which is reduced.

The solution therefore becomes

    \[ I(t)  = \frac{N^*}{1+\{\frac{N^*-I(0)}{I(0)} \} e^{-\lambda^* t}  } \]

    \[ S(t) = N - I(t) \]

Part III.1.1 will provide a python program that solves these equations and compare the result with the exact solution above.

Adding a time changing lambda

The infection rate can change for several reasons.  One reason is that the state mandates closings of schools, bars, etc which reduces the opportunities for people to come in contact.  Another possibility is that people simply become scared and self isolate.  Still another is that people take extra precautions against the disease (washing hands, wearing masks, etc). Modeling social behavior is difficult at best. 

The analytic solution of the SIS model is only valid for a constant \lambda.  It would be wonderful if we could use that analytic solution.  One work around is to assume that \lambda changes suddenly (in one day).  One solution covers the period for some initial time to the point where \lambda changes.  Then a new solution starts with the name population, the number currently infected and a new value of \lambda.  The problem with this approach is that social changes do not happen instantaneously. You can legislate the wearing of masks, but it will take time before people will follow the legislation.

We can adopt a similar, approach.  We will split the infection rate into two pieces, one essential, and one socially variable.

The essential rate \lambda_e includes contacts associated with food purchasing, emergency room visits, delivery persons etc.  It is the lowest contact rate that is either available or acceptable.  It represents the best prevention of infection that can be implemented (masks, washing hands, etc..).  This rate will not change, and represents the lower bound for the \lambda

The contact rate due to social interactions \lambda_s includes contacts associated with going to movies, restaurants, dinner with friends, encounters in parks, etc.  It models any unsanitary behavior taken before the changes (not washing hands etc).

We will not assume that this rate suddenly drops to zero, but that is goes to zero exponentially with a time constant \tau after a given time T_o.  The formula for \lambda becomes:

    \[ \lambda = \lambda_e + \lambda_s e^{-\frac{max((t-T_o),0)}{\tau}} \]

This could also be written

    \[ \lambda = \lambda_b - \lambda_s [1-e^{-\frac{max((t-T_o),0)}{\tau}} ] \]

where \lambda_b = \lambda_e+\lambda_s which is the rate before the change. 

These rates are averages over the population.  If only a small fraction of the population reduces their exposure possibilities, then it will make little difference to the entire population.  Thus the values here include not only what is possible, but what the society is willing to do.

Code Modifications

The solution for the number of people that are infected as a function of time does not tell us the total number of cases. Similarly the model does not track the number of people who have recovered. Both of these are routinely tracked during the course of an epidemic. Given I(t) these can be determined by integrating the corresponding terms in the differential equation. Another approach is to explicitly include them in a set of differential equations. We will adopt this approach.

Therefore we add two more terms to the differential equations to be solved.

    \[ \frac{dI(t)}{dt} = \lambda(t)  \{1- \frac{I(t)}{N} \} I(t) -\gamma I(t) \]

    \[\frac{dC(t)}{dt} = \lambda(t) \{1- \frac{I(t)}{N} \}  I(t) \]

    \[\frac{dR(t)}{dt} = \gamma I(t)  \]

Here C(t) is the total number of cases. The term involving \lambda is the rate of new cases. Thus the derivative of C(t) is equal to the term involving \lambda. Similarly R(t) is the total number of cases that have recovered. It’s derivative is also set to the rate of recovery.

A python program is presented in section III.1.2 that includes both the time variable \lambda(t) and functions C(t) and R(t) above.

Links

To the Python code that solves the SIS model Differential Equation for a constant \lambda : https://davidalarrabee.com/?page_id=954

The the Python Code that solves the SIS model differential Equation with a variable rate \lambda with C(t) and R(t) (TBD)

Return to the Main page for the SIS model. https://davidalarrabee.com/?page_id=754

Advance to the Main Page for the SIR model. (TBD)

A dialog between Science, economics and Religion