Physics · motion & chaos

Pendulum Simulator

One, two, or three links deep — from a clean swing to full chaos.
Lagrangian mechanics · RK4
Double · 90° · 90°

Links

Quick scenarios

Options

Random angular kicks — like wind gusts or bumps — landing on a random link. Off by default so the energy-conservation check above stays exact — provided air resistance is also off. With drag on, or disturbance above zero, energy is deliberately no longer conserved.

Live simulation

t = 0.0 s
speed
State

Right now

Field notes

Why two pendulums is where chaos begins

How it works

The same method scales to any number of links

Every configuration here — one link, two, or three — comes from the same underlying method: write the system's Lagrangian (kinetic minus potential energy) in terms of the link angles, apply the Euler–Lagrange equations, and solve the resulting matrix equation for the angular accelerations at each instant. That system gets numerically integrated forward in time with a 4th-order Runge-Kutta (RK4) method — accurate enough that total mechanical energy stays conserved to within about one part in ten million over ten full seconds of motion, even for the triple pendulum's fully chaotic swing.

Worked example

Release a single pendulum from 90° and it swings back and forth forever (no damping modelled), passing through the bottom at a predictable speed every time — same period, every cycle. Release a double pendulum from the same 90°/90° starting position and, within a few seconds, the second link is flipping over the top unpredictably. Nudge the starting angle by a fraction of a degree and the two runs look identical at first, then diverge completely — the signature of a chaotic system: not random, but so sensitive to starting conditions that long-term prediction becomes practically impossible.

Is this really chaotic, or just "complicated"?

Genuinely chaotic in the technical sense: deterministic (the same starting state always produces the same motion) but with extreme sensitivity to initial conditions. Two runs starting a hair's width apart diverge exponentially — that's the formal definition, not just a figure of speech.

Why does a single pendulum stay predictable forever?

A single pendulum has only one degree of freedom — its motion is confined to a simple, repeating orbit in phase space. Chaos needs at least two coupled, nonlinear degrees of freedom to appear; one link alone can't generate it, no matter how far you swing it.

Why RK4 instead of a simpler integrator?

A cruder method (like simple Euler integration) leaks or gains energy every step — over a chaotic simulation that error compounds fast and the "physics" stops being physics. RK4 evaluates the motion at four points per step and blends them, keeping energy essentially constant over long runs, which is exactly what the energy-conservation check above confirms.

Does damping or air resistance apply here?

Air resistance is on by default — the checkbox above the animation — and it is real quadratic drag, entered as a generalised torque on each bob alongside gravity rather than as a damping fudge applied to the output. Bob area comes from its mass on a constant-density-sphere assumption, so a heavier bob presents more area but proportionally far less drag per unit of mass. The air density itself drifts by about ±5% on a slow cycle, which is what stops two identical-looking runs from tracking each other.

The pivots are still frictionless and the rods still massless. Turn air resistance off and you get the idealised system: nothing removes energy, the pendulum never settles, and the energy-conservation figure quoted below holds. That is the switch worth flicking to see the difference between a chaotic system and a merely complicated one.

Real nonlinear dynamics, RK4-integrated. No small-angle approximation. Double and triple pendulums are chaotic — tiny input differences diverge completely within seconds. That's physics, not a bug.
Version history · 1 release
  1. v0.632026-07-26Pendulum: 1–10 disturbance dial, air resistance with drifting density, random start

Releases in which this page changed, newest last. Derived from the archived copy of every release, not from notes written afterwards — so it reflects what actually shipped. Site-wide passes are left out; they are in the full changelog.