PHYS·01 Chaos — a double pendulum integrated with RK4, drawn with a fading trail; a ghost twin starts one thousandth of a radian away and visibly diverges, demonstrating sensitive dependence on initial conditions

Physics Lab · Experiment 01 · dynamics

Two arms, no memory.

A double pendulum, integrated properly. A ghost twin starts one thousandth of a radian away and swings in near-perfect step — until, suddenly, it doesn't. Tap a bob to kick it. Scroll works everywhere; the full workbench is below.

Δ 10⁻³ rad
scroll
[00]The machine

the simplest thing that refuses to be predicted

State
four numbers — θ₁, θ₂, ω₁, ω₂. The whole universe of this page fits in one array.
Integrator
Runge–Kutta 4, four substeps per frame · Euler would bleed energy and lie to you
Chaos
the ghost starts 0.001 rad off · the Δ chip tracks how far the two futures have drifted apart
Energy
no damping term — it swings forever, or until you scroll away and the sim politely pauses
Trail
offscreen canvas, faded 5% per frame — the orange thread is the second bob's real path
Status
🟢 swinging · terra bob, ochre thread, teal ghost
[01]Six truths

what a toy teaches about the weather

01 · state space

Four numbers is enough

Two angles, two angular velocities. Everything the pendulum will ever do is already implicit in those four values — the animation is just reading the consequences out loud.

02 · the twin

0.001 radians apart

Indistinguishable at first. Then the teal ghost peels off into its own life.

03 · integrator

Why RK4

Naive Euler injects a little fake energy every step; the pendulum slowly goes feral for the wrong reason. RK4 samples the slope four times per step and keeps the physics honest.

04 · sensitivity

Chaos isn't randomness

Both pendulums obey the exact same deterministic law. Unpredictability comes from measurement, not from dice — you can never know θ₁ finely enough.

05 · the kick

Taps are impulses

On a phone, tapping a bob adds angular velocity — a flick of the wrist, not a grab.

06 · the bench

Dragging lives downstairs

The hero canvas lets your thumb scroll straight past it — touch-action: pan-y. The bench below claims the whole gesture, so you can grab either bob and pose the pendulum by hand.

[02]The bench

drag either bob to pose it · release to let it fall · gravity slider bends both worlds

gravity 9.8
Field note: the mobile complaint that started this series was real — a full-screen canvas with touch-action: none is a scroll trap. The pattern here: heroes stay pan-y and take taps; a fixed-height bench takes the whole thumb. Sims also pause when offscreen, so your battery doesn't pay for physics you can't see.