Dynamics / Deterministic chaos

Chaos Theory

Release a double pendulum. Compare two nearly identical starting states and watch deterministic motion unfold into different trajectories.

Paused at the initial condition. JavaScript and Canvas2D enable the simulation.

Time 0.00 s · Energy drift 0.0000% · Endpoints 0.001 m apart

Export artwork

A frozen frame of the apparatus and visible trails. Playback continues with the same intent. PNG only: this is a Canvas composition. PNG targets 2× or a 2,000 px long edge, capped at 4 million pixels and 4,096 px per side.

Set it in motion

Solid lime: system A. Dashed iris: system B starts 0.001 rad (0.057°) apart in angle 1. Both masses are 1 kg. Changing a physical setting restarts both at rest.

JavaScript and Canvas2D are required. The static apparatus remains visible without them.

The same rules. A different future.

Two ideal planar pendulums follow the Newtonian equations of motion: rigid massless arms, frictionless pivots and point masses. Fourth-order Runge–Kutta integrates both systems in fixed 1/240-second steps. Gravity ranges from 0–20 m/s²; each arm from 0.5–2 m.

Small differences can grow through nonlinear dynamics; the rate depends on the starting state. Trails retain at most 1,800 points per system. Energy drift is ΔE divided by (m₁ + m₂) max(g, 1) (L₁ + L₂), a numerical diagnostic rather than a claim of perfect conservation. Reduced motion keeps the stage still; Step advances 1/60 second.

How to play

Play or Step to release the apparatus. Change gravity, lengths or initial angles to restart both systems at rest. Butterfly comparison shows an independently integrated second system starting 0.001 rad apart. Randomize changes the reproducible initial angles; Reset restores all defaults. PNG exports a frozen frame with the visible trails.

Built with

Astro · TypeScript · Canvas2D · Fixed-step RK4

Playback starts paused. Reduced motion holds the apparatus still; Step advances a discrete 1/60 second. Hidden and offscreen stages suspend without changing your Play/Pause choice. Without JavaScript or Canvas2D, a static apparatus and explanation remain.