Play n Tools

Free tools & games for everyone

Free · No sign-up · No accounts

Chaos lab

See chaos happen: the logistic map and its bifurcation diagram, the Lorenz butterfly and a double pendulum, each started twice a hair apart.

3.2

How to use

  1. Logistic map: drag the growth rate r. The cobweb shows each step bouncing between the curve and the diagonal; the table says whether x settles to one value, a cycle, or chaos.
  2. Bifurcation diagram: shows where x ends up for every r at once. Click or tap the picture to zoom in on that part; Whole picture zooms back out.
  3. Lorenz butterfly: runs the Lorenz weather model twice, the second start larger by a tiny amount. Watch the two paths trace the same butterfly, then part ways.
  4. Double pendulum: swings two double pendulums whose lower arms start a thousandth of a degree apart. Press Stop at any time.

Keyboard and touch

TabMove between tabs, sliders, boxes and buttons
Arrow keys on the r sliderChange r by 0.001; Page Up and Page Down move faster
Enter in a boxRun the current experiment
Tap or click the bifurcation diagramZoom in around that growth rate (or type the range)

Tips

  • Try r = 2.8 (one value), 3.2 (a 2-cycle), 3.5 (a 4-cycle), 3.56 (an 8-cycle), 3.83 (a 3-cycle inside the chaos) and 4 (full chaos).
  • The doublings come faster and faster: each new stage needs about 4.669 times less change in r than the one before (Feigenbaum's constant).
  • A positive Lyapunov exponent means nearby starts separate exponentially fast. At r = 4 it is ln 2 ≈ 0.693: the uncertainty doubles every step.
  • In the Lorenz model, making the starting gap 10 times smaller only delays the split by a fixed amount of time. That is why detailed weather forecasts stop working after a couple of weeks.
  • With small angles the double pendulum swings politely and the two copies stay together; start it high (over about 90°) for chaos.
  • If your device asks for reduced motion, the Lorenz and pendulum results are drawn at once without animation.

About this lab

The logistic map xnext = r x (1 − x) is a simple model of a population with limited food (May, 1976). Cycles are found after 4,000 warm-up steps by looking for a return within 10-7 in up to 64 steps; the Lyapunov exponent is the average of ln |r (1 − 2x)| over 20,000 steps after 1,000 warm-up steps.

The Lorenz system (1963) is dx/dt = σ(y − x), dy/dt = x(ρ − z) − y, dz/dt = xy − βz, here with the classic σ = 10, ρ = 28, β = 8/3, started at (1, 1, 1) and solved by fourth-order Runge-Kutta with time step 0.005 for 40 time units. The double pendulum uses the full equations of motion for two point masses on light rigid arms without friction (g = 9.80665 m/s²), solved by fourth-order Runge-Kutta with a 2 ms step for 20 seconds; the energy check shows how faithfully the numbers follow the physics. Chaotic results depend on every digit, so other programs and other step sizes give different paths after a while, though the same overall behaviour.

See you tomorrow!

A fresh daily puzzle every morning, and new tools added every month.

Browse every product