Application Center - Maplesoft

App Preview:

Calculation of the Average Duration of an Illness and Computation of the Reproduction Number in the SIR Model

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application




Calculation of the Average Duration of an Illness and Computation of the Reproduction Number in the SIR Model....

by Douglas E. Lewit, mathematics student at Northeastern Illinois University and secondary education major at National-Louis University

 

 

I prepared this Maple worksheet as part of a presentation to Professor Mubayi's lab group at Northeastern Illinois University.  Every member of the research group explores a different aspect of how mathematics is used to study public health, which is Professor Mubayi's primary speciality or research focus.  During this presentation, I explore two different SIR models.  I begin with a simpler SIR model that has only two parameters, alphaand β.  α, in this context, is essentiatlly an infection rate, while β, within this context, refers to the rate of recovery.  Of great importance in the study of mathematical epidemiology is a value called the reproduction number, usually denoted as R[0]. The exact numerical value of  R[0]varies from model to model and problem to problem, but in general the reproduction number reveals the "spreadability" of the illness being studied.  If R[0] is less than 1, the illness will die out before reaching epidemic proportions.  If R[0] is greater than 1, then government officials should be alerted as soon as possible because the illness has the potential to spread to epidemic proportions.

For my research I studied two articles.

 

The title of the first article that I used for my research is S-I-R Model of Epidemics, Part 1, Basic Model and Examples, Revised September 22, 2005.  The article is posted on the internet (apparently without an author's name) and can be found at http://www.me.rochester.edu/courses/ME406/webexamp6/sir1.pdf.  Although the file is a .pdf, much of the mathematical work for the article was done using Wolfram Mathematica.  As I was reading through the article, I had to translate some of the Mathematica code into Maple code.    

 

The title of the second article is Reproduction numbers and sub-threshold endemic equilibria for compartmental models of disease transmission, dated June 27th, 2001, written and researched by P. van den Driessche from the Department of Mathematics and Statistics, University of Victoria, Victoria, BC, Canada, V8W 3P4, and James Watmough from the Department of Mathematics and Statistics, University of New Brunswick, Fredericton, NB, Canada, E3B 5A3.

 

 

 

 

 

First off, thanks for attending my presentation on Saturday morning.  I realize that most people just want to sleep late on Saturday mornings!  So thanks again for making the trip.  Okay, let's get started.  To begin with, I want to use the following system of differential equations to show why the average duration of an illness is 1/(beta).

dS/dt = -`αSI`

dI/dt = `αSI`-`βI`

dR/dt = `βI`

 

where S stands for the number of susceptible individuals in the population, I is the number of infected individuals, and finally R is the number of removed (i.e. dead) or recovered individuals.  The underlying assumption here is that the population is constant.  (The sick people aren't having kids during their period of sickness.  Makes sense to me.  When you're sick, do you really want to take care of children and screaming babies?)

sqrt(-4);  # The variable I, by default, is Maple's imaginary unit.  We're going to change that.

2*I

(1)

interface(imaginaryunit=E);  # now the imaginary unit is going to be E from now on.

I

(2)

sqrt(-4);

2*I

(3)

Consider the second differential equation.  The underlying assumption here is that α is usually a lot smaller than β, and so for the sake of generalizing and simplifying the problem the author of the article that I read temporarily discarded the parameter, α.  Thus the second differential equation becomes, dI/(dt)=-betaI, with some initial condition, I(0)=_C1, where _C1 is some constant greater than 0.

dsolve(diff(I(t),t)=-beta*I(t),I(t)); # find the solution to the differential equation.

I(t) = _C1*exp(-beta*t)

(4)

I:=t-> _C1*exp(-beta*t);  # define the function I(t).

proc (t) options operator, arrow; _C1*exp(-beta*t) end proc

(5)

expr := (int(t*(I)(t), t = 0 .. infinity))/(int((I)(t), t = 0 .. infinity))

(limit(-_C1*(exp(-beta*t)+exp(-beta*t)*beta*t-1)/beta^2, t = infinity))/(limit(-_C1*(exp(-beta*t)-1)/beta, t = infinity))

(6)

assume(_C1>0):

assume(beta>0):

simplify(expr);

1/beta

(7)

Therefore, the average value of I(t) on the interval (0, ∞) is approximately 1/(beta), but remember that our conclusion is based upon the assumption that α is a lot smaller than β.  As α gets larger, well, our assumption (and hence our result) falls to pieces, okay?  Now let's turn our attention to finding the reproduction number for a particular case of an infectious model.

restart;  # restarts Maple's kernel and erases previously user-defined variables and functions.

e:=2;

2

(8)

Just checking to see whether or not I can use the variable 'e'.  It's possible, but now I no longer have access to the variable 'e' for entering numbers in scientific notation.  For example, 0.01 can be entered in Maple as 1e-2.  Now that I'm using the variable 'e' for another purpose, I no longer have that option.

e:='e';

e

(9)

Unassigning a variable is simple!  Try it for yourself.

interface(imaginaryunit=IM);  # freeing up the variable 'I' so that we can use that variable in our analysis of the SIR model.

I

(10)

sqrt(-9);

3*I

(11)

sqrt(-4);

2*I

(12)

sqrt(-49);

7*I

(13)

e:=(S,I,E,T)-> beta1*S*I/N+beta2*T*I/N-(d+v+r1)*E+p*r2*I;  #define the first of the four differential equations in the article's example.

proc (S, I, E, T) options operator, arrow; beta1*S*I/N+beta2*T*I/N-(d+v+r1)*E+p*r2*I end proc

(14)

i:=(S,I,E,T)-> v*E-(d+r2)*I; #define the second of the four differential equations in the example.

proc (S, I, E, T) options operator, arrow; v*E-(d+r2)*I end proc

(15)

s:=b*N-d*S-beta1*S*I/N; #define the third of the four differential equations in the example.

b*N-d*S-beta1*S*I/N

(16)

t:=-d*T+r1*E+q*r2*I-beta2*T*I/N; #define the fourth and last of the differential equations in the ODE system.

-d*T+r1*E+q*r2*I-beta2*T*I/N

(17)

In the article, the functions that constitute the right-hand sides of the differential equations are split into two parts: 1) infection coming in, and 2) infection going out.  In the second case, you have to factor out a negative sign in order to implement the author's method.  Let's see how to do this with Maple.

F:=op(1,e(S,I,E,T))+op(2,e(S,I,E,T));

beta1*S*I/N+beta2*T*I/N

(18)

with(VectorCalculus,Jacobian); # load the Jacobian command into the computer's RAM so that we can access it.

[Jacobian]

(19)

F:=Jacobian(<F,0>,[E,I]);

F := Matrix(2, 2, {(1, 1) = 0, (1, 2) = beta1*S/N+beta2*T/N, (2, 1) = 0, (2, 2) = 0})

(20)

F:=subs([S=1,N=1,T=0],F);

F := Matrix(2, 2, {(1, 1) = 0, (1, 2) = beta1, (2, 1) = 0, (2, 2) = 0})

(21)

A couple comments are in order here.  First of all, S/N is assumed to be 1, but at the disease-free equilibrium point (DFE) the number of susceptibles is assumed to be the same as N, the total population.  At the DFE the treatment group has a population of 0, hence T=0 in the matrix above.  Simple, right?  :-)   Well maybe not, but if you think about it for a couple of minutes it starts to make sense.  Also, when using Maple's Jacobian command, there are 2 required arguments.  (There's an optional third argument as well, but let's save that one for a later date.)  The first argument must be a vector while the second argument must be a list.  Data types are extremely important in Maple.  If you don't use the correct data types, your Maple commands won't work, plain and simple.  Be careful!  Maple's built-in Help menu is very helpful.  Spend some time looking it over before you begin your next Maple project.

with(LinearAlgebra):

Dimensions((20));

2, 2

(22)

G1:=-1*op(3,e(S,I,E,T))-op(4,e(S,I,E,T));

(d+v+r1)*E-p*r2*I

(23)

G2:=-1*op(1,i(S,I,E,T))-op(2,i(S,I,E,T));

-v*E+(d+r2)*I

(24)

V:=Jacobian(<G1,G2>,[E,I]);

V := Matrix(2, 2, {(1, 1) = d+v+r1, (1, 2) = -p*r2, (2, 1) = -v, (2, 2) = d+r2})

(25)

F.MatrixInverse(V);

Matrix(2, 2, {(1, 1) = beta1*v/(d^2+d*r2+v*d+v*r2+r1*d+r1*r2-v*p*r2), (1, 2) = beta1*(d+v+r1)/(d^2+d*r2+v*d+v*r2+r1*d+r1*r2-v*p*r2), (2, 1) = 0, (2, 2) = 0})

(26)

Eigenvalues((26));

Vector(2, {(1) = 0, (2) = beta1*v/(d^2+d*r2+v*d+v*r2+r1*d+r1*r2-v*p*r2)})

(27)

Dimensions((27));

2

(28)

spectralradius:=(27)[2];

beta1*v/(d^2+d*r2+v*d+v*r2+r1*d+r1*r2-v*p*r2)

(29)

This agrees with the computation in the article written by P. van den Driessche and James Watmough.  (Look at the bottom of page 7 of their article to see the final result of their calculation.  The only difference is that they factored a part of the denominator of their final expression.  But my Maple result really does agree with their result.)