Let’s take a bit of a break from all of these bifurcations of first order differential equations and look at another situation where we get some very very interesting behaviour with fixed points. I’ve mentioned it briefly before, but let’s go into some more detail. We’re going to be looking at not a differential equation, but a difference equation. This one is called The Logistic Map:
We can think of this as a population on a given day (or week, or year, or whatever), and r is some sort of growth rate. It is related to the population at the previous time step. Let’s say
=2, then if the population at time-step 0 is 0.2, then on the next time step, the population will be:
So the population has grown. How about the next time step?
We can write a little piece of code which calculates the population through time for a given initial population and value of
Let’s look at it with, a higher starting population:
We see that starting at 0.8, the population first plummets, then it starts to go up again.
Exercise: Try and code this up yourself in Python.
If we start even higher, then something funky happens:
This looks bad! We seem to end up with a negative population. Well, while this doesn’t make sense in terms of a population, it makes sense in terms of the equation. If we have a population greater than 1 at any time, then the next time step we will have a negative population, and once you have that, then the next will be negative and even larger magnitude, etc. So anything starting with a population of greater than 1 or less than 0 will end up flying off to -∞.
Let’s look at a range of starting values between 0 and 1:
How on Earth could we find anything interesting in the humble Logistic Map equation?
Something strange is about to happen...let’s do our plot, but this time for, say r=3.1 with a starting population of 0.5
This has four solutions:
Explore what happens if you start close to the true, but unstable fixed point.
ok, things are getting a bit complicated. We’re going to stick with an initial population of 0.5 from now on. Let’s write some code which outputs the late time behaviour...which will tell us which values it is bouncing between for a given value of r:
We can plot this now as a function of r:
So this says that for r less than 3, you will reach a fixed point and stay there, but for r>3 you will find two points that you jump between.
Does anything else happen if we increase r some more? Let’s look at the behaviour at r=3.5...
This going from one to two to four values that we jump between is known as period doubling.
What the!!!! Has something gone wrong with our program?
That seems pretty different...Let’s actually zoom into a region between 3.6 and 3.61...
The strange thing is that within this chaos we see an island of calm, between around 3.605 and 3.6065. And indeed within the chaos you will keep seeing islands of calm.
Exercise: Explore this with Python.
What has this got to do with the real world? Well, it turns out that it has a huuuge amount to do with the real world!
and this number appears all over nature in systems that become chaotic.
Mathemafrica: Mandelbrot set.
If you haven’t already done so, take a look at the Veritasium video on this here.
I’m going to leave you with this plot. See if you can figure out what’s going on. The red line is a line of gradient 1 through the origin:
OK, back to our study of first order differential equations.