Monday, July 5, 2010

On Chaos

Postulate a model of a population of creatures that live a year,  a model that could be used to predict what the population of those creatures will be next year, given this year's population and some lumped parameter that captures the combination of their ability to reproduce and the predatory influence upon them. One such model is:

xn+1 = rxn(1-xn)

Here, xn is the population at year n (ranging between 0, or no individuals, to 1, or the maximum number that the habitat can support), and r is that lumped parameter.  This particular model has been used for (among other things) predicting populations of temperate latitude insects such as univoltine lepidoptera,
whose adults emerge in the spring, mate, lay their eggs, and die. The eggs in their turn hatch into caterpillars that feed during the summer and overwinter as pupae. Come the following spring, the cycle repeats.

This type of equation is called a map.  This one in particular is called the logistic map.  What this map basically says is: next year's population is proportional to three things, (1) the reproduction/predation constant for this year, (2) the current population, and (3) the remaining empty carrying capacity of the habitat to support new individuals.  (Here a low value for r means that predation is high and reproduction low.)

Here's what the map looks like, when plotted in cartesian coordinates:

Simple, eh?  A concave-down parabola.  The maximum is at r/4, by the way.  This is all pretty simple stuff -- basic first year algebra, the kind of stuff that we took in high school.  But it starts to get interesting if you start putting real numbers into that map.  Say you start with some value, x1, and you crank through the map and compute x2 (having chosen some arbitrary value for r). Now say you keep going, computing successively more iterations. What happens? Well, maybe this:

A bit of explanation. You see on the right the concave-down parabola, but there's also a diagonal line.  This line is the line xn+1 = xn.  That is, it's where the x-axis equals the y-axis: 1=1, 2=2, etc.  The reason it's there is because this is a map: we choose an x1, which maps to a point on the parabola, and that point becomes x2, which maps to a new point on the parabola, ad infinitum.  So the diagram on the right is showing this successive series of steps, in what is called a Cobweb Diagram.  (The graph on the left is just illustrating the yearly change in population, how much xn+1 differs from xn.)

Why do we care about this?  Well, if you look carefully, you can see that iterating this map with these values is causing it to collapse to a single point -- the very point where the diagonal line intercepts the parabola.  If you enter that value into the map, you'll get the same value back out.  In mathematical terms, this is called a stable attractor, and in biological terms, it means that the population has reached homeostatis -- predators and environment and reproduction are at a point of equalization, with the population regenerating itself each year (neither growing nor declining).

Now, here's the thing: if there are stable attractors, then there are also unstable attractors.  Populations that grow and dwindle regularly.  A boom, a bust, a boom, a bust, etc.

Nonlinear dynamicists such as myself call that sort of behavior a 2-cycle: there is a single attractor, with two orbits around it.  Boom, bust, boom, bust.  But there is nothing magical about the number two; the Logistic Map can exhibit 4-cycles, too.  And 8-cycles.  And 3-cycles: it doesn't have to be even.  But here's the thing: as you change "r," the cycle changes happen regularly.  First there's a single orbit.  Then two.  Then four. Then eight.  In fact, it's so regular that you can even plot it the number of orbits as a function of "r," and it looks like this:

If you've read this far, then at this point, if I were you, I would be saying WHAT. THE. FUCK.  Because, seriously, what the hell is that diagram, and how did it come from the simplest possible conic section formula known to mankind?  As in, a parabola?  The simplest thing that we learn in algebra?  In HIGH SCHOOL?

Brief explanation: at approximately r=3.0, the Logistic Map enters a 2-cycle.  Hence the branch there, and the two paths.  At about r=3.45, it enters a 4-cycle.  And so on.  The interesting bits are the busy dark areas: that is Chaos.

In the simplest, we find the most complex.

3 comments:

  1. Wow, what the.....
    Does your head go here often! haha
    So if you postulate say eighty years instead of one does it make a difference?
    Pretty incredible stuff.

    ReplyDelete
  2. Possibly the best blog post ever.

    ReplyDelete