Monte Carlo simulation of bifurcations in the logistic map
Combined reproduction and starvation rate r
The logistic map was originally used to approximate an animal population over time. Mathematically, it is written as:
An+1 = rAn(1 - An)
An represents the population at year n, with 0 <= An <= 1. Of course, in reality a population is a whole number, but this makes the maths simpler. A value of 1 means the maximum population i.e. the capacity of the physical environment.
r represents a combined rate for reproduction and starvation, with r > 0.
All initial populations A0 eventually settle into one of three behaviours:
A fixed value.
Periodic oscillation between values.
Chaotic i.e. unpredictable values.
A bifurcation diagram shows these three behaviours. The x-axis shows r and the y-axis shows the population. The population eventually stabilises to a fixed value for r = 1 to 3, and you can see the periodic behavior starting after this, eventually becoming chaotic at around r = 3.5699457...
The Monte Carlo simulation on the left uses repeated random sampling to produce the bifurcation diagram. The algorithm is roughly:
For each value of r, generate a multiple points with a random initial population and random maximum age (remaining number of iterations).
Set the population of each point to An+1 = rAn(1-An) and update its remaining number of iterations.
If the remaining number of iterations for any point reaches zero, then we pick a new random initial population and age for that point.
Clear the plotting area and plot each point at (r, An).
Go to 2.
The plot is updated for every iteration, so you can see how the populations are changing over time.