Pendulum Simulation
Watch a real pendulum swing in your browser. Change the string length, bob mass, gravity, and damping to see exactly how each variable shapes the motion — and confirm the physics for yourself.
Pendulum Simulation
How to Use the Pendulum Simulator
Drag the pendulum bob to any starting angle, then release it. The pendulum will swing under real physics — its period, angle, and angular velocity update in real time on the right-hand panel. You can also press Start to launch from a default 30° angle.
The four controls each affect the motion in a specific way:
- String length — the distance from the pivot to the centre of the bob. Longer strings give slower, wider swings. Adjustable from 0.5 metres to 5.0 metres.
- Bob mass — the mass of the swinging weight, from 0.1 kg to 10 kg. Try changing this and watch what happens to the period. (The answer surprises most people.)
- Gravity — pick from preset environments including Earth (9.81 m/s²), the Moon, Mars, or Jupiter. Each one changes how fast the pendulum swings.
- Damping — sets the amount of air resistance and friction at the pivot. Light damping (the default) matches normal air conditions. Heavy damping brings it to rest quickly. "None" is an idealised frictionless mode — the pendulum will never stop.
Press Reset to return the pendulum to its resting position with the current settings.
The Physics Behind This Simulation
A simple pendulum is a mass (bob) suspended from a fixed pivot by a massless, inextensible string. The restoring force is the tangential component of gravity. For any angle, the exact equation of motion is nonlinear:
For small angles (below about 15°), sin θ ≈ θ and the motion is simple harmonic. At larger angles, the period grows — this simulator solves the exact nonlinear equation numerically, so you can see the difference.
Four Experiments to Try
The best way to understand a pendulum is to test what happens when you change one variable at a time. Here are four experiments the simulator is designed for.
Does mass affect the period?
Set the string length to 2.0 m and gravity to Earth. Press Start and note the period. Now change the bob mass from 1 kg to 10 kg and start again. The period stays the same. This is one of the most counter-intuitive results in classical physics: a heavier pendulum does not swing more slowly. Galileo first observed this in the late 1500s while watching a chandelier in Pisa Cathedral.
Quadruple the length, double the period
Start with a 1.0 m string and record the period. Now increase the length to 4.0 m and record it again. The new period is exactly twice the first one — not four times. Period scales with the square root of length, which is why very long pendulums (like the Foucault pendulum in Paris, at 67 metres) swing so slowly.
Swing on the Moon
Switch gravity from Earth to Moon (1.62 m/s²) and press Start. The period increases by a factor of about 2.46, because period is inversely proportional to the square root of gravity. If NASA astronauts hung a grandfather clock on the Moon, it would run at less than half its Earth speed.
Push the small-angle approximation
Start with a small angle — 5° or 10°. The pendulum swings in a perfectly regular rhythm and the simple period formula holds. Now release it from 60° or 80°. You'll see the period get slightly longer. This is where the small-angle approximation breaks down, and the pendulum requires a more complex mathematical treatment.
How Accurate Is This Simulation?
This simulator uses the exact equation of motion for a simple pendulum — the nonlinear differential equation — rather than the small-angle approximation. That means the periods you see remain accurate even at large starting angles, where a formula-based calculator would begin to diverge from reality.
The motion is integrated numerically using a fourth-order Runge-Kutta method at 60 frames per second, which keeps the total energy stable to well within 0.1% over hundreds of swings. Damping is modelled as a linear velocity-dependent force, which is a close approximation to real air resistance at low speeds.
The simulation assumes a rigid, massless string and treats the bob as a point mass. For a real pendulum with a distributed mass or an elastic string, the motion would differ slightly — an idealisation that matches how pendulums are studied in introductory physics courses.
Continue Learning
Frequently Asked Questions
Why doesn't the mass of the bob affect the period?
The gravitational force pulling the pendulum down and the inertial mass resisting acceleration are the same quantity. When you write out Newton's second law for the pendulum, the mass cancels out on both sides, leaving a period that depends only on length and gravity. This is a consequence of Einstein's equivalence principle — the same reason all objects fall at the same rate in a vacuum.
Why does the simulation show slightly different periods at large angles?
The familiar pendulum period formula, T = 2π√(L/g), is only exact for infinitesimally small swings. As the amplitude grows, the actual period gets longer. At 30°, the correction is about 1.7%. At 60°, it's over 7%. This simulation uses the exact equation of motion, so you see the real behaviour rather than the approximation.
What does the damping setting simulate?
Damping represents the combined effect of air resistance on the bob and friction at the pivot. Light damping is roughly what you'd see with a heavy metal bob in still air — this is the default because it matches real-world conditions. Heavy damping mimics a light bob moving through a viscous fluid, or a badly worn pivot bearing. Setting damping to "None" removes all energy loss — an idealisation useful for verifying conservation of energy, but not physically realistic.
Can I use this simulation for a physics class or lab report?
Yes. The simulator is free to use for education and personal exploration. If you're using screenshots or data in a report, a citation to Core Physics Fundamentals is appreciated but not required. For classroom demonstrations, sharing the direct link works well on most projection systems.
Why is my pendulum drifting sideways after many swings?
It shouldn't. If you notice significant drift, the numerical integrator has likely accumulated floating-point error — most commonly at very long simulation times combined with very small damping. Press Reset to reinitialise the pendulum with clean starting conditions.
