Chaos & nonlinear dynamics, in the browser.
Three interactive demos of deterministic chaos: systems with no randomness whatsoever that are nonetheless impossible to predict. They are rebuilt from my undergraduate computational-physics coursework (~2011, originally written in Maple). No build step, no dependencies, no server: everything runs in the browser.
| The Road to Chaos | Period doubling | The bifurcation diagram of the map xₙ₊₁ = xₙ² − r. A single value forks into 2, 4, 8… in a period-doubling cascade. Box-zoom into the fractal tree; Feigenbaum's constant δ ≈ 4.669 is computed live from the map's super-stable points. |
| Anatomy of an Orbit | Order vs chaos | A single trajectory drawn as a cobweb (spiralling to a fixed point, locking onto a cycle or filling the interval), paired with the Lyapunov exponent λ(r). λ < 0 is order, λ > 0 is chaos; the periodic windows show up as downward spikes. |
| The Tumbling Moon | Celestial chaos | The chaotic rotation of Saturn's moon Hyperion, via the Wisdom–Peale–Mignard spin-orbit model. Watch the lumpy moon tumble as it orbits, and build the Poincaré section dot-by-dot to reveal the chaotic sea surrounding the regular resonance islands. |
-
Bifurcation iterates the quadratic map
x → x² − r(the form used in the original coursework, conjugate to the textbook logistic map). For each value ofrthe transient is discarded and the attractor plotted, with density shaded logarithmically. The Feigenbaum ratio is found by solvingf_r^(2ⁿ)(0) = 0for the super-stable parametersRₙwith Newton's method. -
Cobweb / Lyapunov animates the same map as a cobweb diagram and computes
λ = ⟨ ln|f′(x)| ⟩ = ⟨ ln|2x| ⟩along the orbit for everyr, colouring the spectrum by sign. Periodicity is detected directly from the orbit's tail. -
Hyperion integrates the spin-orbit equation of motion with RK4,
θ̈ = −(α²/2)(a/r)³ sin(2(θ − f)), α² = 3(B−A)/Cwhere
r(t)and the true anomalyf(t)come from solving Kepler's equation along an eccentric orbit (precomputed into a lookup table). The Poincaré section samples(θ mod π, θ̇)at each perihelion passage; a renormalised shadow trajectory gives the Lyapunov exponent that classifies the motion as regular or chaotic. The drawn moon's elongation tracks the asphericity α.
Eris is the Greek goddess of strife and discord, the one who tosses in the golden Apple of Discord and lets chaos unravel from a single small perturbation. That's a fitting patron for a collection about deterministic chaos, where an imperceptible nudge to a starting value snowballs into wildly different outcomes. She's also the dwarf planet whose discovery got Pluto reclassified. That is a nod to the celestial-mechanics half of the project, where Saturn's moon Hyperion tumbles without a fixed day.
It's all static files: open index.html, or serve the folder:
python3 -m http.server 8731Then visit http://localhost:8731.
Part of a collection of interactive builds · mikebertin.github.io
