Stretch, fold, repeat.
In 1976 Otto Rössler set out to find the simplest possible system of equations that could still behave chaotically. The result has a single nonlinear term, z * x, and yet it produces a strange attractor. #1
The Rössler attractor is a great way to see how chaos works. Trajectories spiral outwards on a flat disc, and once they drift far enough from the centre they get lifted up, folded over and dropped back near the middle.
That stretch-and-fold motion, repeated forever, is the mechanism behind most chaotic systems, and here it is visible in a single band.
The algorithm
javascript·rossler-attractor.js
const a = 0.2;
const b = 0.2;
const c = 5.7;
const next = (x,y,z) => {
const dx = -y - z;
const dy = x + a * y;
const dz = b + z * (x - c);
return {dx,dy,dz};
};
Try lowering c towards 4: the attractor settles into a periodic orbit, then doubles its period again and again as c grows, until it falls into chaos.
References