Double Pendulum

Simulate an ideal double pendulum: one pendulum hung from the end of another, two point masses on rigid, weightless rods, with no friction. The tool works out the swing step by step with the classic fourth-order Runge–Kutta method (RK4), up to 60,000 steps, for any masses, arm lengths, start angles and start spins, and draws the path of the lower bob as long-exposure line art. Colour the trace by time or by speed, trace the upper bob too, draw the starting position, add a second run started a tiny angle away to see how far the two swings drift apart, and press Play to watch the computed swing at real speed. Every run reports its own energy error. Download a PDF poster, a 300 DPI PNG or an SVG with the trace as vector lines. Nothing is uploaded.

100% private — everything runs in your browser. Everything runs in your browser; nothing is uploaded.

100% private — runs in your browser

Print at 100% (Actual size). Real size prints on one sheet when the drawing fits; the check bar in the footer lets you confirm the scale. The SVG holds the drawing at the printed size. Play replays the computed swing on screen at real speed.

Pendulum

Trace and colour

Page

Runs in your browser with our own code: nothing you type is uploaded or saved. Every point of the trace is worked out by our own fourth-order Runge–Kutta integrator from the equations of motion shown. You may use what you make here, including commercially, with no credit needed.

How to simulate a double pendulum

  1. Pick a preset, or type the masses, arm lengths and start angles.
  2. Set the step h and the number of steps (the time shown is steps × h).
  3. Choose the colours and what to draw: the lower trace, the upper trace, the starting position or a second run.
  4. Press Play to watch the swing, then choose Fitted to one page or Real size and the paper.
  5. Download the PDF and print at 100% (Actual size), or the PNG or SVG.

What you can use it for

  • Posters and wall art of double pendulum traces
  • Physics lessons on chaos, energy and normal modes
  • Showing sensitive dependence with two nearby starts
  • Plotter, laser and vinyl line art from the SVG
  • Book covers, cards and line studies
  • Trying other masses and arm lengths

The 16 presets

PresetMasses (kg)Arms (m)Start anglesStart spins (rad/s)Time (steps)Largest energy error
Both arms at 120°, 20 s1 / 11 / 1120° / 120°0 / 020 s (20,000)4.8e−9
Small swing: 10° and 10°, 20 s1 / 11 / 110° / 10°0 / 020 s (20,000)5.1e−15
Slow normal mode: 5° and 7.07° (in step)1 / 11 / 15° / 7.07°0 / 010 s (10,000)2.4e−16
Fast normal mode: 5° and −7.07° (opposite)1 / 11 / 15° / −7.07°0 / 010 s (10,000)3.5e−14
Two runs 0.000000001 rad apart (sensitivity)1 / 11 / 1120° / 120°0 / 015 s (15,000)3.8e−9
With the starting position drawn (rods and bobs)1 / 11 / 1100° / 150°0 / 08 s (8,000)2.7e−9
Upper bob traced too (90° and 0°)1 / 11 / 190° / 0°0 / 015 s (15,000)5.3e−10
Heavy upper bob (3 kg and 1 kg)3 / 11 / 1120° / 60°0 / 020 s (20,000)4.1e−10
Heavy lower bob (1 kg and 3 kg)1 / 31 / 1120° / 60°0 / 020 s (20,000)3.9e−8
Long lower arm (0.6 m and 1.4 m)1 / 10.6 / 1.490° / 90°0 / 020 s (20,000)1.2e−10
Short lower arm (1 m and 0.4 m)1 / 11 / 0.4135° / 135°0 / 020 s (20,000)2.4e−8
Kicked from rest at the bottom: ω1 = 7 rad/s1 / 11 / 10° / 0°7 / 020 s (20,000)7.2e−9
Coloured by time, 40 s1 / 11 / 1120° / 120°0 / 040 s (40,000)4.8e−9
Coloured by speed, 40 s1 / 11 / 1150° / 90°0 / 040 s (40,000)6.1e−9
Poster: fine line, 60 s (60,000 steps)1 / 11 / 1130° / 175°0 / 060 s (60,000)1.0e−8
Real size: trace 150 mm wide1 / 11 / 1120° / 120°0 / 010 s (10,000)3.6e−9

The energy error is the largest change in total energy during the run, as a share of (m1 + m2)gL1 + m2gL2; read from the run the tool draws.

RK4 checked on an equation with a known answer

Step hError at t = 1 (dy/dt = −y)Error ÷ next error
0.25.797e−6–
0.13.332e−717.4
0.051.998e−816.68
0.0251.223e−916.34

Halving the step divides the error by about 16 = 2⁴: the integrator is fourth order.

RK4 on the pendulum itself (both arms at 120°, to t = 2 s)

Steps compared (s)Difference of the end statesDifference ÷ next difference
0.008 vs 0.0049.860e−6–
0.004 vs 0.0027.796e−712.65
0.002 vs 0.0015.379e−814.49
0.001 vs 0.00053.520e−915.28

Each run is compared with the run at half the step; the differences shrink by about 16 each time.

Energy error and step size (both arms at 120°)

Step h (s)StepsTimeLargest energy error
0.0054,00020 s4.5e−6
0.00210,00020 s6.5e−8
0.00120,00020 s4.8e−9
0.000540,00020 s3.3e−10

Normal modes: formula and simulation

Masses (kg)Arms (m)Slow mode (formula)Slow mode (measured)Fast mode (formula)Fast mode (measured)
1 / 11 / 10.3815 Hz (θ2 = 1.414 θ1)0.3815 Hz0.9211 Hz (θ2 = −1.414 θ1)0.9211 Hz
3 / 11 / 10.407 Hz (θ2 = 2 θ1)0.407 Hz0.705 Hz (θ2 = −2 θ1)0.705 Hz
1 / 31 / 10.3649 Hz (θ2 = 1.155 θ1)0.3649 Hz1.3619 Hz (θ2 = −1.155 θ1)1.3619 Hz
1 / 10.6 / 1.40.3756 Hz (θ2 = 1.659 θ1)0.3756 Hz1.0209 Hz (θ2 = −0.517 θ1)1.0209 Hz
1 / 11 / 0.40.4479 Hz (θ2 = 1.193 θ1)0.4479 Hz1.2405 Hz (θ2 = −4.193 θ1)1.2405 Hz

Measured from the full equations started on each mode shape with 0.001 rad, over 40 s, by timing the swings.

Two runs started a tiny angle apart

Second run starts this much further (rad)Steps until 0.2 m apartTimeLargest distance in 20 s
1e-1219,56119.56 s1.4 m
1e-914,63514.64 s2.74 m
0.00000110,43710.44 s3.82 m
0.0016,6306.63 s3.55 m

Both arms at 120°, 1 kg and 1 m each, h = 0.001 s. Measured between the two lower bobs, step by step.

What prints

DownloadWhat is in it
PDFThe trace fitted to one page or at real size, vector lines, with the values used and a check bar
PNG 300 DPIThe same sheet as a picture
SVGThe trace at the printed size as vector lines, one per colour band, with the starting position if shown

For a cutter that needs DXF, use SVG to DXF.

Which tool to use

You wantUse
A chaotic double pendulum solved and drawnDouble Pendulum (this page)
Damped pendulums added together for smooth looping curvesHarmonograph
Trees grown towards scattered pointsSpace Colonization
Mandelbrot, Julia and line fractalsFractal Generator
Curves drawn by rolling circlesSpirograph Generator

Other tools: the Fractal Generator renders Mandelbrot, Julia and line fractals, the Spirograph Generator draws rolling-circle curves and the Topographic Map Generator draws contour patterns.

More free tools

Maths art, patterns and printables?

Drawing and print tools that run privately in your browser, with no sign-up and no watermark.

See all free tools →

Frequently asked questions

What is a double pendulum?

A pendulum with a second pendulum hung from its end. Its motion is described by two coupled differential equations and is chaotic: tiny changes in the start grow into completely different swings, as the Wikipedia article on the double pendulum notes, citing Levien and Tan (American Journal of Physics, 1993).

What model does the tool use?

The ideal double pendulum: two point masses on rigid rods that weigh nothing, joined by frictionless hinges, swinging in one vertical plane, with g = 9.81 m/s². The equations of motion are the two given on the myphysicslab Double Pendulum page by Erik Neumann; the angles are measured from straight down. Real pendulums lose energy to friction and air, so a real swing slowly dies down; this one does not.

How does the tool solve the equations?

With the classic fourth-order Runge–Kutta method (RK4) and a fixed step h: each step takes four slopes of the equations and averages them. Our tests run the same integrator on dy/dt = −y, whose exact answer is known, and halving h divides the error by about 16, as a fourth-order method should. The tables below also show it on the pendulum itself.

How accurate is it?

An ideal pendulum keeps its total energy, so the tool measures how far the energy of the computed run strays from the start. For every preset the largest error is below one ten-millionth of (m1 + m2)gL1 + m2gL2, the depth of the swing; the info line shows the figure for your own settings, and a smaller step makes it smaller still (table below). Very long chaotic runs also grow last-digit rounding differences: in our tests the same 40- and 60-second runs worked out by two different JavaScript engines stayed together for the first 20 seconds and drifted apart after 24 to 34 seconds, so a long poster can differ a little from one browser to another.

What are the normal modes?

For small swings the double pendulum behaves like two simple swings at once: a slow one with both arms moving the same way and a fast one with the arms moving opposite ways. The tool works out both frequencies from the linearised equations; with equal masses and equal arms the lower arm swings √2 times as far as the upper one. The table on this page starts the full simulation on each mode with 0.001 rad and measures the frequency: they agree to better than 1 part in 10,000.

What does the second run show?

Two swings that start almost the same: the second starts with the upper arm 0.000000001 rad further round. The tool measures the distance between the two lower bobs at every step. With both arms at 120° and h = 0.001 s the two are 0.2 m or more apart after 14,635 steps (14.64 s), as the table shows. That is what this run does; it does not prove anything about every start.

Why do small swings look tidy?

With small start angles the motion stays close to a mix of the two normal modes, so the lower bob traces a regular figure. Larger angles, or a kick, let the arms swing over the top, and the trace fills the space instead.

Does it animate?

Yes: Play replays the computed swing on screen at real speed, with a short trail. It stops at the end, when you press Stop or change a setting, and whenever the page is hidden, so it never keeps running in the background.

How big can it go?

Up to 60,000 steps with h from 0.0005 to 0.01 s, masses from 0.1 to 10 kg and arms from 0.1 to 2 m; every preset draws in under 2 seconds in our tests.

Can it print at real size?

Yes, when the drawing fits on one sheet: choose Real size and set the printed width. Every printed point is within 0.2 mm of its true place in our tests, on US Letter and A4, as long as you print at 100% (Actual size); the check bar in the footer lets you confirm the scale. Bigger drawings print fitted to the page.

Is it free?

Yes. There is no sign-up, no watermark and no limit.

Is anything uploaded?

No. Every point and branch is worked out by JavaScript in your browser. Nothing you type is sent anywhere or saved when you close the page.