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

How it works

The same method scales to any number of links

One method for any number of links

Write the Lagrangian (kinetic minus potential) in the link angles, apply Euler–Lagrange, and solve the matrix equation for the angular accelerations at each instant.

RK4, not Euler

Four evaluations per step, blended: energy stays conserved to about one part in ten million over ten seconds, even for the triple pendulum.

Chaos needs two

One link has one degree of freedom and stays predictable forever. Two coupled nonlinear ones is the minimum recipe for sensitive dependence.

Air is on by default

Real quadratic drag as a torque on each bob, with air density drifting about ±5%. Turn it off for the idealised, energy-conserving system.

Worked example. Release a single pendulum from 90° and it swings forever (no damping modelled), through the bottom at a predictable speed, the same period every cycle: T = 2π√(L/g), with mass cancelling out entirely. Release a double pendulum from the same 90°/90° and within a few seconds the second link is flipping over the top unpredictably. Nudge the start by a fraction of a degree and the two runs look identical at first, then diverge completely: not random, but so sensitive to starting conditions that long-term prediction becomes practically impossible.
Field notes

Why two pendulums is where chaos begins

2coupled links

Why two pendulums is where chaos begins

A single pendulum has one degree of freedom, its angle, confined to a simple repeating orbit in phase space. A double pendulum has two, coupled: the minimum recipe for chaos. A third link does not change the qualitative behaviour, just deepens it.

Sensitive dependence

The hallmark of chaos: two nearly identical starting angles, a fraction of a degree apart, produce motion that looks the same for a moment then diverges completely. That is not the simulation losing accuracy: it is the real, mathematical behaviour. Genuinely chaotic in the technical sense: deterministic, but two runs a hair’s width apart diverge exponentially.

Conserved energy, unconserved position

Even in the most chaotic swing, total mechanical energy stays essentially fixed (with air resistance off): what is wildly unpredictable is where that fixed energy ends up distributed at any moment.

Why simulators, not stopwatches

A real double pendulum is also chaotic, but tiny imperfections (bearing friction, air currents, a barely-perfect release) make it diverge from any prediction within moments: which is why this is simulated rather than measured by hand. A cruder integrator would leak or gain energy every step and the “physics” would stop being physics; the energy check confirms RK4 does not.

What the air resistance switch shows

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 mass; the drifting air density stops two identical-looking runs tracking each other. The pivots stay frictionless and the rods massless. Turn drag off to see the difference between a chaotic system and a merely complicated one.

Questions

What people ask

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.

Rules of thumb are approximations, offered to get you to the right order of magnitude fast. Check anything load-bearing against its source or the exact tool. Privacy · Terms

© 2026 Rules of Thumb · Runs entirely in your browser