Delta Banner

Mathematics & Science Learning Center
Computer Laboratory

 

Applications of Systems of Differential Equations

Epidemiology: The Spread of Disease

(continued from last page...)

Making the Problem "Computer Friendly"

We're working with the system:

System Initial Conditions
S′ = - a S I
I′ = a S I - b I
R′ =  b I
S(0) = So
I(0) = Io
R(0) = Ro

However, in it's current form, the problem doesn't lend itself to computer solution since it contains the unknown constants a and b. We'll make the problem more concrete by using known values for a and b. In fact we'll use a = 0.001, and b = 0.3. (In reality we would need to do an extensive study of a particular situation in order to arrive at values for these two constants.)

An additional difficulty for us is the fact that we're working with three differential equations instead of just two. While there is nothing theoretically wrong with three, (or even fifty-three,) equation systems, graphing becomes more difficult since we would have to deal with four variables in all (t is a variable too,) which makes us run out of physical dimensions that we can easily visualize. In many problems this difficulty cannot be avoided, but in this case there is a work-around available.

Notice that the first two equations are coupled, i.e. they share variables with one another, but neither of them contain the third variable, R. This means that they form a subsystem of our original system that can be dealt with independently. i.e. Unless we are really interested in the dynamics of the recovered population, we could eliminate the third equation from our consideration, along with the corresponding initial condition.

Implementing these changes, we arrive at the following system:

System Initial Conditions
S′ = - 0.001 S I
I′ = 0.001 S I - 0.3 I
S(0) = So
I(0) = Io

which is a little reminiscent of the predator-prey system we worked with earlier. In fact, what you will be doing for the rest of this laboratory is mimicking the steps you took in the Predator-Prey Laboratory in order to create plots of susceptibles vs. time, infecteds vs. time, and lastly a phase-plane diagram of susceptible-infected space.

Creating Susceptibles vs. Time and Infecteds vs. Time Graphs

In order to start we need some specific initial conditions. Let's say that at the beginning of our experiment there are 600 susceptible people, and 50 infected people, or symbolically:

  • S(0) = 600
  • I(0) = 50

If we put these into our initial value problem, it becomes:

System Initial Conditions
S′ = - 0.001 S I
I′ = 0.001 S I - 0.3 I
S(0) = 600
I(0) = 50

which is in just the right form to feed into Mathematica's numerical solver. So let's do so, with the command:

disease1=NDSolve[{s'[t]==-0.001s[t]i[t],
   i'[t]==0.001s[t]i[t]-0.3i[t],
   s[0]==600,i[0]==50},
   {s[t],i[t]},{t,0,30}]

(Notice that we're capturing the solution to the system into the variable disease1, and that I've chosen the interval 0 ≤ t ≤ 30 for the plot. Also, I've used lower case i instead of I, since I is a reserved Mathematica constant.)

Now jump into Mathematica and try it.


Mathematica Icon You can switch to Mathematica by clicking on the button at left. This will open up a fresh notebook for you. Remember that it will take it a while to start up! Don't forget to come back here when you're done! See you in a few minutes.

Now let's go see what you should have gotten...


Compass If you're lost, impatient, want an overview of this laboratory assignment, or maybe even all three, you can click on the compass button on the left to go to the table of contents for this laboratory assignment.
 
 

ODE Laboratories: A Sabbatical Project by Christopher A. Barker

©2017 San Joaquin Delta College, 5151 Pacific Ave., Stockton, CA 95207, USA
e-mail:
cbarker@deltacollege.edu