Pendulum Simulator

Swing a simple, damped, or double pendulum -adjust length, gravity, and damping, then watch the period, energy, and angle-vs-time curve update live.

What is a pendulum?

A pendulum is a mass (the bob) suspended from a pivot so that it can swing freely under the influence of gravity. As it swings, energy continuously converts between gravitational potential energy (at the highest points of the swing) and kinetic energy (at the lowest point), in an idealized, frictionless case.

Pendulums are one of the oldest tools in physics for studying periodic motion, and they remain a foundational example of simple harmonic motion -and, in their more complex forms, of chaotic motion.

The simple pendulum

For small swing angles (roughly under 15°), a pendulum's motion closely approximates simple harmonic motion, and its period -the time for one full back-and-forth swing -depends only on its length and the local gravitational acceleration:

T = 2π√(L / g) T = period (s) · L = pendulum length (m) · g = gravitational acceleration (m/s²)
The famous result Mass doesn't appear in the formula at all. A heavy bob and a light bob on the same length string swing with exactly the same period -a result that surprises most students the first time they see it.

This formula is only an approximation that holds for small angles. At larger angles, the restoring force is no longer proportional to angle, and the true period grows slightly longer than the small-angle formula predicts.

Three pendulum models in this tool

ModeBehaviorEnergy
SimpleFrictionless, idealized swing. Period given by T = 2π√(L/g), amplitude never decays.Conserved -oscillates between kinetic and potential, total stays constant.
DampedA drag-like term opposes the motion, modeling air resistance or friction at the pivot.Decreases over time -the swing amplitude shrinks toward rest.
DoubleA second pendulum hangs from the first bob. The coupled system is chaotic: tiny changes in starting angle lead to wildly different paths.Conserved overall, but constantly exchanged in complex ways between both arms.

Reading the simulation

Period vs. elapsed time

The period stat shown is the theoretical value computed from the formula at the current length and gravity (for Simple and Damped modes). The elapsed time counter shows how long the simulation has been running -compare multiples of the period against the swing you see on screen.

Energy conservation as a check

In Simple mode, total mechanical energy should stay constant -if you see it drifting, that's purely a numerical integration artifact (this simulator uses a simple time-stepping method, not a perfectly energy-conserving algorithm). In Damped mode, watching the energy bleed away over time is the point: it visually demonstrates how damping forces remove mechanical energy from a system.

Why the double pendulum is chaotic

The double pendulum's equations of motion are nonlinear and coupled -the second arm's swing constantly feeds back into the first arm's motion and vice versa. Two runs started at angles that differ by a fraction of a degree will diverge into completely different paths within a few seconds. This sensitivity to initial conditions is the hallmark of a chaotic system, and is why long-range weather prediction is hard for the same mathematical reason.

Common mistake Don't assume a longer pendulum always swings faster. The period formula shows the opposite: period increases with length. A longer pendulum takes more time per swing, not less.

Using the simulator

  1. Choose a pendulum modePick Simple, Damped, or Double from the sidebar. Each mode reveals only the sliders relevant to it.
  2. Set length, gravity, and starting angleDrag the Length and Gravity sliders to change the physical setup, and the Initial angle slider to set how far the pendulum starts from vertical before release.
  3. Add damping (Damped mode only)The Damping slider controls how quickly the swing decays. Higher values model heavier air resistance or pivot friction.
  4. Set up the second arm (Double mode only)Adjust Length 2 and the mass ratio to change how the second pendulum behaves relative to the first.
  5. Press PlayWatch the pendulum swing in the stage above, and the angle-vs-time chart build live below it. Use Pause to freeze the motion and Reset to return to the starting angle.
  6. Watch the stat cardsPeriod, elapsed time, and energy update live. Hover any stat card and click the small copy icon to copy that value.

Suggested classroom uses

  • Mass doesn't matter. In Simple mode, point out that there is no mass slider at all -ask students to predict what would happen if you doubled the bob's mass before revealing that the period formula contains no mass term.
  • Length vs. period relationship. Hold gravity fixed, double the length, and have students predict whether the period doubles too (it doesn't -it scales with the square root of length).
  • Gravity on other worlds. Set gravity to Moon-like values (~1.6 m/s²) or Jupiter-like values (~24.8 m/s²) and compare period to Earth's 9.8 m/s².
  • Energy dissipation. In Damped mode, increase the damping slider and have students watch the energy stat fall toward zero, connecting the visual decay to the concept of non-conservative forces.
  • Chaos demonstration. In Double mode, run the simulation twice with the initial angle changed by just 1°, and compare the two angle-vs-time traces after a few seconds -a vivid, concrete introduction to chaotic systems.

Live pendulum

Period T

2.01 s

Elapsed time

0.00 s

Total energy

5.40 J

Angle vs. time

Angle over time chart, updates live while the simulation runs.