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.
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
- Pick a preset, or type the masses, arm lengths and start angles.
- Set the step h and the number of steps (the time shown is steps × h).
- Choose the colours and what to draw: the lower trace, the upper trace, the starting position or a second run.
- Press Play to watch the swing, then choose Fitted to one page or Real size and the paper.
- 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
| Preset | Masses (kg) | Arms (m) | Start angles | Start spins (rad/s) | Time (steps) | Largest energy error |
|---|---|---|---|---|---|---|
| Both arms at 120°, 20 s | 1 / 1 | 1 / 1 | 120° / 120° | 0 / 0 | 20 s (20,000) | 4.8e−9 |
| Small swing: 10° and 10°, 20 s | 1 / 1 | 1 / 1 | 10° / 10° | 0 / 0 | 20 s (20,000) | 5.1e−15 |
| Slow normal mode: 5° and 7.07° (in step) | 1 / 1 | 1 / 1 | 5° / 7.07° | 0 / 0 | 10 s (10,000) | 2.4e−16 |
| Fast normal mode: 5° and −7.07° (opposite) | 1 / 1 | 1 / 1 | 5° / −7.07° | 0 / 0 | 10 s (10,000) | 3.5e−14 |
| Two runs 0.000000001 rad apart (sensitivity) | 1 / 1 | 1 / 1 | 120° / 120° | 0 / 0 | 15 s (15,000) | 3.8e−9 |
| With the starting position drawn (rods and bobs) | 1 / 1 | 1 / 1 | 100° / 150° | 0 / 0 | 8 s (8,000) | 2.7e−9 |
| Upper bob traced too (90° and 0°) | 1 / 1 | 1 / 1 | 90° / 0° | 0 / 0 | 15 s (15,000) | 5.3e−10 |
| Heavy upper bob (3 kg and 1 kg) | 3 / 1 | 1 / 1 | 120° / 60° | 0 / 0 | 20 s (20,000) | 4.1e−10 |
| Heavy lower bob (1 kg and 3 kg) | 1 / 3 | 1 / 1 | 120° / 60° | 0 / 0 | 20 s (20,000) | 3.9e−8 |
| Long lower arm (0.6 m and 1.4 m) | 1 / 1 | 0.6 / 1.4 | 90° / 90° | 0 / 0 | 20 s (20,000) | 1.2e−10 |
| Short lower arm (1 m and 0.4 m) | 1 / 1 | 1 / 0.4 | 135° / 135° | 0 / 0 | 20 s (20,000) | 2.4e−8 |
| Kicked from rest at the bottom: ω1 = 7 rad/s | 1 / 1 | 1 / 1 | 0° / 0° | 7 / 0 | 20 s (20,000) | 7.2e−9 |
| Coloured by time, 40 s | 1 / 1 | 1 / 1 | 120° / 120° | 0 / 0 | 40 s (40,000) | 4.8e−9 |
| Coloured by speed, 40 s | 1 / 1 | 1 / 1 | 150° / 90° | 0 / 0 | 40 s (40,000) | 6.1e−9 |
| Poster: fine line, 60 s (60,000 steps) | 1 / 1 | 1 / 1 | 130° / 175° | 0 / 0 | 60 s (60,000) | 1.0e−8 |
| Real size: trace 150 mm wide | 1 / 1 | 1 / 1 | 120° / 120° | 0 / 0 | 10 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 h | Error at t = 1 (dy/dt = −y) | Error ÷ next error |
|---|---|---|
| 0.2 | 5.797e−6 | – |
| 0.1 | 3.332e−7 | 17.4 |
| 0.05 | 1.998e−8 | 16.68 |
| 0.025 | 1.223e−9 | 16.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 states | Difference ÷ next difference |
|---|---|---|
| 0.008 vs 0.004 | 9.860e−6 | – |
| 0.004 vs 0.002 | 7.796e−7 | 12.65 |
| 0.002 vs 0.001 | 5.379e−8 | 14.49 |
| 0.001 vs 0.0005 | 3.520e−9 | 15.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) | Steps | Time | Largest energy error |
|---|---|---|---|
| 0.005 | 4,000 | 20 s | 4.5e−6 |
| 0.002 | 10,000 | 20 s | 6.5e−8 |
| 0.001 | 20,000 | 20 s | 4.8e−9 |
| 0.0005 | 40,000 | 20 s | 3.3e−10 |
Normal modes: formula and simulation
| Masses (kg) | Arms (m) | Slow mode (formula) | Slow mode (measured) | Fast mode (formula) | Fast mode (measured) |
|---|---|---|---|---|---|
| 1 / 1 | 1 / 1 | 0.3815 Hz (θ2 = 1.414 θ1) | 0.3815 Hz | 0.9211 Hz (θ2 = −1.414 θ1) | 0.9211 Hz |
| 3 / 1 | 1 / 1 | 0.407 Hz (θ2 = 2 θ1) | 0.407 Hz | 0.705 Hz (θ2 = −2 θ1) | 0.705 Hz |
| 1 / 3 | 1 / 1 | 0.3649 Hz (θ2 = 1.155 θ1) | 0.3649 Hz | 1.3619 Hz (θ2 = −1.155 θ1) | 1.3619 Hz |
| 1 / 1 | 0.6 / 1.4 | 0.3756 Hz (θ2 = 1.659 θ1) | 0.3756 Hz | 1.0209 Hz (θ2 = −0.517 θ1) | 1.0209 Hz |
| 1 / 1 | 1 / 0.4 | 0.4479 Hz (θ2 = 1.193 θ1) | 0.4479 Hz | 1.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 apart | Time | Largest distance in 20 s |
|---|---|---|---|
| 1e-12 | 19,561 | 19.56 s | 1.4 m |
| 1e-9 | 14,635 | 14.64 s | 2.74 m |
| 0.000001 | 10,437 | 10.44 s | 3.82 m |
| 0.001 | 6,630 | 6.63 s | 3.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
| Download | What is in it |
|---|---|
| The trace fitted to one page or at real size, vector lines, with the values used and a check bar | |
| PNG 300 DPI | The same sheet as a picture |
| SVG | The 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 want | Use |
|---|---|
| A chaotic double pendulum solved and drawn | Double Pendulum (this page) |
| Damped pendulums added together for smooth looping curves | Harmonograph |
| Trees grown towards scattered points | Space Colonization |
| Mandelbrot, Julia and line fractals | Fractal Generator |
| Curves drawn by rolling circles | Spirograph 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.
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.