By · Updated

Double Pendulum Simulation

Chaos You Can Watch in Your Browser

No ratings yet

Press Play to start

OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.

How the Double Pendulum works

This double pendulum simulation shows chaos from two rods. Two rods hinged end to end, released from rest, and the lower tip draws its path as it swings. Small release angles give a tidy, repeating figure; anything past ninety degrees tumbles unpredictably, and the trace fills the screen with loops that never repeat. Restart releases it again from the same angle and you get a different picture every time.

Double pendulum simulation: what to know first

A single pendulum is the textbook example of predictable motion. Hang a second pendulum from the end of the first and you get one of the simplest systems known to be chaotic: its motion is fully determined by the equations of motion, and yet two releases from angles that differ by a hundredth of a degree diverge completely within a few swings. That is the definition of sensitive dependence on initial conditions, and the double pendulum is the cleanest place to see it.

What you are watching. The upper rod hangs from a fixed pivot; the lower rod hangs from the end of the upper. Both bobs have the same mass and both rods the same length. The tip of the lower bob leaves a trail on a separate layer, so over a minute you get a drawing of everywhere it has been. At low energy — a release angle of 30 or 40 degrees — the trail is a smooth lobed curve that repeats closely. Past about 90 degrees the lower rod has enough energy to swing over the top, and the trail becomes a tangle.

The sliders. Release angle sets both rods to the same angle from vertical and lets go with no initial velocity; the lower rod is offset by a hundredth of a radian so the system is not perfectly symmetric. Rod length changes the physical length of both rods, which changes the period — longer rods swing slower — while the drawing rescales to fit. Speed is how many integration steps run per frame, so it is a fast-forward control. Changing the angle restarts the simulation; changing length or speed does not.

How it is computed. The equations of motion for a double pendulum are derived from the Lagrangian and give the angular acceleration of each rod as a function of both angles and both angular velocities. The tool integrates them with a small fixed time step. This is a simple Euler integration, which slowly gains energy over many minutes; for watching it is fine, and Restart resets the energy exactly.

Why the different pictures. Because the rounding in floating-point arithmetic and the order of operations are enough to change the path. Chaos does not mean random — run the same code on the same machine and you get the same result — but any perturbation, however tiny, is amplified exponentially, so the practical outcome is that the future is unpredictable beyond a few seconds.

FAQ

Why does the same angle give a different trace each time?

The computed motion is deterministic, so with identical starting values it would repeat. The lower rod's small offset and the browser's frame timing mean the starting values are not bit-for-bit identical every run, and at high energy the divergence takes only a few swings to become total.

Is the physics accurate?

The equations are the standard ones for two point masses on massless rigid rods with no friction. The integrator is a simple fixed-step Euler, which is accurate enough to look right but drifts in energy over long runs; a real double pendulum would slow down from air resistance, which is not modelled.

Why is the small-angle motion so regular?

Because at low energy the double pendulum behaves like two coupled harmonic oscillators, which is predictable. Chaos needs enough energy for the lower rod to swing over the top. The transition starts somewhere between 60 and 90 degrees depending on the length.

Can I clear the trace without restarting?

Restart is the way to clear it, and since the release angle is preserved you get the same start. Pause with Play if you want to save a PNG of a particular tangle before clearing it.

See also: all Simulations & Screensavers tools, Images, Audio, Video & Screen, PDF, SVG, Generative Art, Chart Makers, 3D Model Viewers, Drawing Pads, Mockups & 3D Making, Diagram Makers, 3D Science, Tracker Music.

Related tools