CodingClubLogisticMapSweepR3
This is an interactive version of the population model from Flake and Shalizi that can exhibit chaotic behaviour. It demonstrates that chaos can appear even in the simplest systems. (Or does it? See below.) So what you're looking at is the equation below, iterated for one hundred time steps.
The equation: Xt+1 = 4rxt (1 - xt)
- X is the population at any one timestep.
- R defines the reproduction rate.
- Both of these have legal values from 0 to 1. (Flake changed the original slightly, so that 0 < R < 1, rather than 4 - hence the 4 in the equation.)
- The term (1 - x) provides negative feedback. It also guarantees that - as well as x = 0 being stable (the population has died out), if x = 1, on the next step, they'll also be wiped out. This, as Flake says, 'can be thought of as population decline due to overpopulation and scarce resources.' (Flake 1998, p.142)
Here are the controls:
- 1 (one): Toggles logistic map on / off
- 2 (two): Cycles state space diagram from off to square to direct. Square is better for seeing how x converges to stable values. Direct is better for seeing periodic results.
- Vertical click and drag: changes R by large amounts quickly. this will let you see when the reproduction rate leads to stable, periodic or chaotic outcomes.
- Vertical click and drag while holding spacebar: change R by 1/10 to the power of the 'decimal sweep' value . Allows a fine-grained look at certain regions of R.
- Vertical click and drag while holding control: do the same thing for X.
- Up and down arrows: change the number of initial X values. We start with one, at 0.5. Additional initial x values are spread evenly between 0 and 1 - though there are no 0s or 1s (both of these would immediately lead to population death in all models.)
- Left and right arrows: change the number of decimals to sweep by.
- A and Z: increase / decrease r by 1/10^ however many decimals you've chosen. More careful control than space + mouse. Note: this uses a float, and fairly quickly (~8) you can't get any result from it.
- S and X: do the same for the Xs. Again, more careful control than alt + mouse.
- ALT: toggles blend - this will leave trails behind briefly. It does sometimes help to spot patterns, but is mainly here because, well, chaos is a little tie-dye trippy, isn't it? Let's face it.
Some more notes:
Use the fine-grained controls to have a look at some of the periodic and chaotic regions (r > ~0.75). What do you notice? This can give a good intutive feel for the way the iteration propagates through all the timesteps.
Notice especially - in regions where the first few timesteps have periodicity - what difference changing the sweep decimal makes. The finer-grained you go, the more predictable in the short term the system becomes - but it doesn't last long, and, for floats in Java at least, you quickly reach the limits of calculability.
Chaos: is it really 'out there' in the meatworld or just 'in here?' where our numbers have rounding errors?
That brings us to the final point: Flake asks - "How do we know if computer simulations of chaos are valid in the sense that they yield true characterisations of real chaos? Worse still, is it possible that 'chaos' is nothing more than a computer artifact that results from trying to represent a stochastic world with digital numbers?" (Flake, p.153)
Flake does give an answer, but it makes no sense to me, since it's still based on 'shadowing' a simulated chaotic system with another simulation. Surely that just begs the question? Answers on a postcard please.
Source code: CodingClubLogisticMapSweepR3
Built with Processing and Processing.js