Let’s try and make the previous example at least a little more realistic. Let’s suppose that the environment only supports a fixed number of rabbits, let’s call that fixed number M. This is the maximum number of rabbits that we can stably have. It turns out that there is a very very important equation which will model this sort of behaviour very well, and it shows up all over the place. This is called the logistic equation and looks like:

 

\frac{dP(t)}{dt}=kP(t)\left(1-\frac{P(t)}{M}\right)

 

Solving this equation means finding a function whose derivative and whose functional form are linked in this specific way.

We have pulled this equation out of thin air, so rather than deriving where it comes from, we will simply motivate that it seems to have the right sort of behaviour of what we want.

For very small populations (much less than the stable equilibrium population M), \frac{P(t)}{M}<<1, so the term in brackets can be safely ignored. For very small population then the equation looks like our original equation (from the previous post) which gave us uncontrolled exponential growth. However, this is only true for small populations, so this means that when we start out, we’ll get exponential growth, but after a while as P(t) stops being much less than M we will have to take into account the term in brackets and this will save us from the ball of rabbits problem that we encountered before.

What will happen then when P(t) is a little bit less than M. We see that the term in brackets is small but positive. This means that the rate of change of the population will be small and positive. As we get closer and closer to P(t)=M we will find that the rate of change slows to zero. For populations just above M we will find that the rate of change of the population is actually negative. This means that the population is getting less, and as we get closer to M from above, the rate of change slows to zero again. How about for very large populations? Well, in this case

 

\frac{dP(t)}{dt}\sim -\frac{kP(t)^2}{M}

 

and so the population is going to go down in proportion to the square of the population – ie. it’s going to go down very fast for large populations. This seems a bit more controlled. We can see that we are never going to get the growing sphere of rabbits problem (or GSOR problem). There is some control going on. For large populations, the population will get smaller until we get closer and closer to the equilibrium population M and for small population it will grow and slowly asymptote to M. In fact it turns out that the solution to this equation is given by:

 

P(t)=\frac{M e^{C M+k t}}{e^{C M+k t}+1}

 

where again C is our integration constant. We are not going to show how to find this, but we are going to show that this is indeed a solution.

How can we check that a given function is a solution to the equation of motion? We simply plug it in, just as we would with a normal equation. Let’s look at the left hand side:

 

\frac{dP(t)}{dt}=\frac{d\left(\frac{M e^{C M+k t}}{e^{C M+k t}+1}\right)}{dt}

 

=\frac{k M e^{C M+k t}}{e^{C M+k t}+1}-\frac{k M e^{2 C M+2 k t}}{\left(e^{C M+kt}+1\right)^2}=-\frac{k M e^{C M+k t}}{\left(e^{C M+k t}+1\right)^2}

 

How about the right hand side?

 

kP(t)\left(1-\frac{P(t)}{M}\right)=k\left(\frac{M e^{C M+k t}}{e^{C M+k t}+1}\right)\left(1-\frac{\left(\frac{M e^{C M+k t}}{e^{C M+k t}+1}\right)}{M}\right)

 

=-\frac{k M e^{C M+k t}}{\left(e^{C M+k t}+1\right)^2}

 

so the left hand side and the right hand side of the equations are equal – well, that sounds like this function satisfies the differential equation then! We still have the integration constant and it would be nice to be able to write this in terms of an initial population again. We will start by redefining e^{CM} as \tilde{C}. C is a constant and so we can rewrite it in whatever way is most convenient for us:

 

P(t)=\frac{\tilde{C}M e^{k t}}{\tilde{C}e^{k t}+1}

 

Now define P_0 as the population at t=0 and plug into the solution P(t=0)=P_0 and t=0. This gives:

 

P_0=\frac{\tilde{C}M}{\tilde{C}+1}

 

Now we can solve this equation for \tilde{C} to get:

 

\tilde{C}=\frac{P_0}{M-P_0}

 

Now we can reinsert this into our solution to get:

 

P(t)=\frac{\frac{P_0}{M-P_0}M e^{k t}}{\frac{P_0}{M-P_0}e^{k t}+1}=\frac{M P_0 e^{k t}}{P_0 \left(e^{k t}-1\right)+M}

 

In fact we could have written our original solution like this, and you would see that this, too is a solution to the differential equation, just written in a slightly different way – basically we’ve redefined our integration constants to get the new form.

Check that at t=0, P(t)=P_0. Now we have everything we need. I can give you a value for k (population growth for a small population) and M, a maximum sustainable population, and a P_0 the initial population, and you can work out how this population will vary over time. Let’s go back to our rabbits and say that k=13 and say that in a given environment 10,000 rabbits can be sustained. Let’s look at what happens over time as we start with different numbers of rabbits. The graph in figure \ref{log} shows what happens when you start with 2, 100, 1000, 5000, 200000 and 500000 rabbits.

log

You can see something remarkable happening here (not that remarkable because it is exactly what we had predicted, but a bit remarkable because we’re about to remark on it!). Independent of the initial population (except if P_0=0, if that’s the case then you will always have a population of zero – spontaneous rabbit production is not built into our equations), over time the population will always tend to the value that the environment can sustain (10,000). This isn’t all that surprising because we built the logistic equation to have precisely this behaviour, but it’s nice to see that indeed it gives the expected result when we plot the solutions.

Incidentally, the solution to the logistic equation is called the sigmoidal function and shows up all over the place.

What you see in the graph above is very important to understand. What we are saying is that for all of these function P(t) they satisfy the differential equation:

 

\frac{dP(t)}{dt}=kP(t)\left(1-\frac{P(t)}{M}\right)

 

We can see that rather than simply having a single value, or even a single function as the solution to an equation. A differential equation gives us a whole family of functions, all of which are its solutions.

Incidentally, a system where you are given a differential equation and an initial condition (eg. population at some particular time) is called an initial value problem. Note also that I could have given you the population at time t=0.5 and you would also have been able to calculate the solution. You would have plugged in this population and t=0.5 and this would have fixed \tilde{C} for us. In fact, let’s take an example. Let’s say that at time t=0.5 the population is 2000. Then:

 

2000=\frac{\tilde{C}M e^{0.5 k}}{\tilde{C}e^{k 0.5}+1}

 

gives:

 

\tilde{C}=\frac{2000 e^{-0.5 k}}{M-2000}

 

This can then be plugged back into the equation and you can work out the population for any time in the past or the future of that point:

P(t)=\frac{M e^{k t}}{e^{k t}+\frac{M-2000}{2000 e^{-0.5 k}}}

 

What you should know so far about differential equations:

  • The basic definition of a differential equation
  • That differential equations are a powerful way of modelling the world
  • That sometimes the simplest equation you might guess for a given situation needs to be modified to get realistic behaviour
  • How to take a solution to a differential equation and show that it is indeed a solution
  • That the integration constants we found before are really related to the freedom to set the initial conditions in a system described by a differential equation

 

How clear is this post?