Home About us Mathematical Epidemiology Rweb EPITools Statistics Notes Search Web Design Contact us Links |
Up to now we've been looking at models in discrete time. We had equations that told us how to calculate what is happening at different equally spaced time points, and only at those specific times.
But it is often useful to model changes that happen in continuous time. We might want to be able to say what is happening at any instant in time, not just at specific instants.
To get started with changes that happen in continuous time, let's back away entirely from populations and epidemics for a little while. Let's look at flow into a container; this will provide a useful mathematical metaphor for populations in a little while. Bear with us through this segment and the next!
Suppose then that I have a sink with a leaky faucet, that leaks two cups
per hour of water, steadily. This flow rate into the sink, we'll assume, is
fixed and constant.
Now imagine that I decide to put in the stopper and save all the fill water.
After 15 minutes, I have one half cup of water; after 1/2 hour, I have
one cup of water, after one hour I have 2 cups of water, after two
hours 4 cups, and so on. Let's call the flow rate into the sink f,
at for some time t, let's call the total amount of water in
the sink w(t). Then we can write
w(t)=f × t.
So starting from empty with a fixed inflow rate f, this is the
amount of water in the sink. Notice that t, the time, is
continuous; t can take any value greater than zero. We don't need
to only consider specific fixed integer steps any more.
If you plot the amount in the sink over time, you will see that f,
the inflow rate, is the slope of the line. Try this on Rweb:
thetimes <- c(0,0.25,0.5,1.0,1.33333,1.9,2,3,4,5)
|
Now, what would happen if we had started with some water in the sink
at the outset? Let's say there were 3 cups in the sink at time zero. Then
at say one half hour after the beginning, we have the original three cups,
plus the additional cup (from 2 cups per hour times one half hour).
So we could call the amount originally in the sink
w0, and write
w(t)=f × t + w0.
Here, f (the inflow rate) tells us how the level is changing at any
given time, and w0
(an initial condition) tells us where we started.
Here it is very simple because the flow rate does not change with time. At each instant, the slope of the amount vs. time curve is the same.
But really the flow rate might be changing for any number of reasons. Let's suppose that the flow rate itself is getting larger and larger, so the water is coming in faster and faster because my plumbing is disintegrating or something. Say that the inflow rate at time t is given by f* × t. Don't lose track: we're saying now that the flow rate is starting at zero and is getting faster by the hour. The quantity f* tells us how much faster it gets every hour.
Now if we were plotting the water lever over time, we'd see it rise maybe only a little the first hour, more the second, and still more the third, and so on. The graph is a curve, and the slope is increasing. If the water is flowing in faster, the level rises more in a given amount of time; the flow rate in equals the slope of the graph of amount versus time.
But it's not all that obvious how to actually figure out what the water level is going to be! The flow rate is changing from instant to instant, and it is rather puzzling what you multiply by what. But somehow, we ought to be able to figure out what the water level is if we know how much is flowing in every instant, and where it started. We'll look more closely at this in the next segment.