Uni-Sine
Physics
+25XP
PhysicsWaves and light

Pendulum simulation with live graphs

A pendulum simulation lets you swing a pendulum on screen and change what a real one won't let you change easily: its length, its starting angle, the strength of gravity and how much friction slows it. In our pendulum simulation, the Pendulum and SHM Simulator, the bob swings in real time while live graphs trace its displacement, velocity and acceleration, energy bars show kinetic and potential energy trading places, and a timer measures each swing. For small swings the period is T = 2π√(L/g): 2.006 s for a 1 m pendulum on Earth.

Try it

Pendulum and SHM Simulator

Swing a pendulum and graph its displacement, velocity and acceleration

Go to its page

How to use the pendulum simulation

  1. Open the Pendulum and SHM Simulator. Under Set up, keep Pendulum or switch to Mass on a spring.
  2. Set the Length (0.1 to 10 m), Gravity (0.5 to 30 m/s²), Release angle (up to 170° either side) and Mass. You can also drag the bob to where you want to let go.
  3. Under Damping, set the damping ratio: 0 for none, under 1 for a swing that dies away, 1 for critical damping, above 1 for a slow creep back.
  4. Under Run, press play. Pause or reset at any time.
  5. Read the timer, the Measured period, the Small-angle period from the formula, the True period at your angle and how much longer it is, and the period With damping. A chart shows how the true period grows with the release angle.

The period of a pendulum

T = 2\pi\sqrt{\frac{L}{g}}T is the period in s, L the length from the pivot to the centre of the bob in m, g the gravitational field strength in m/s²

This is the period of a simple pendulum swinging through a small angle; OpenStax gives the limit as about 15°. The period doesn't depend on the mass, and for small swings hardly at all on the amplitude. Rearranged, L = g(T ÷ 2π)². For a mass m on a spring of spring constant k, the period is T = 2π√(m ÷ k), at any amplitude.

T = 2π√(L/9.81)
0.511.522.533.5412341 m: 2.006 s4 m: 4.012 s
Drag to pan, scroll to zoom. x from 0 to 4, y from -0.802 to 4.81.

Here x is the length in metres and y is the period in seconds. Four times the length gives twice the period, because the period depends on the square root of the length.

Experiments to try

Experiment 1: does the mass matter?

Keep the length at 1 m and the angle at 10°, and change the mass from 0.1 kg to 10 kg. The measured period stays at 2.010 s. Only the energy bars change, because a heavier bob stores more energy at the same height.

Experiment 2: length and period

Set the release angle to 5° and the length to 0.25 m: the measured period is 1.004 s. Make it 0.994 m and the period is 2.001 s, so the pendulum takes one second to swing each way. Quarter the length and the period halves.

Experiment 3: big swings take longer

The small-angle formula assumes sin θ ≈ θ. The simulator works the real motion out without that shortcut, and shows how far off the formula is. For a 1 m pendulum on Earth:

Release angleSmall-angle periodTrue periodLonger by
5°2.006 s2.007 s0.05%
10°2.006 s2.010 s0.19%
40°2.006 s2.069 s3.1%
90°2.006 s2.368 s18%
160°2.006 s4.027 s101%

Below about 15° the difference is a fraction of a percent, which is why the formula works for a school experiment. At 160° the swing takes twice as long, because the bob crawls near the top.

Experiment 4: a pendulum on the Moon

Set the gravity to 1.62 m/s² and the length to 2 m. The small-angle period is 2π√(2 ÷ 1.62) = 6.98 s, compared with 2.84 s for the same pendulum on Earth. Weaker gravity pulls the bob back more gently, so each swing takes longer.

Experiment 5: damping

With a 10° swing, set the damping ratio to 0.1. The swing shrinks a little each time, the Lost energy bar grows, and the period stretches slightly, to 2.020 s by the formula T ÷ √(1 − ζ²). At 0.5 the swing dies in a few cycles. At 1, critical damping, it returns to the middle as fast as it can without swinging past, and the readout says there is no swing.

Experiment 6: a mass on a spring

Switch to Mass on a spring. A 1 kg mass on a 20 N/m spring has T = 2π√(1 ÷ 20) = 1.405 s. Make the mass 4 kg and the period doubles to 2.810 s. Unlike the pendulum, a spring's period doesn't change with amplitude.

practice
Pick an answer, then check it.
A pendulum has a period of 1.5 s. What is its period if its length is made 4 times longer?

Reading the graphs

  • Displacement is a sine-shaped wave. Its peaks are the release point.
  • Velocity is greatest when the displacement is zero, as the bob passes through the middle, and zero at each end of the swing.
  • Acceleration is always opposite to the displacement, and greatest at the ends: that is what makes it simple harmonic motion.
  • Energy moves from potential at the ends to kinetic in the middle. Without damping the total stays the same; with damping, the lost share grows.

What the simulation doesn't do

  • A double pendulum or any chaotic motion. It is a single simple pendulum: a point mass on a light rod or string.
  • Driven oscillations and resonance. Once released, nothing pushes it.
  • Air resistance as a separate setting. The damping ratio stands in for all the friction and drag.
  • The tension in the string. Work it out by hand: at the bottom of the swing, T = mg + mv² ÷ L.

Common mistakes

  • Thinking a heavier bob swings faster. The period doesn't depend on the mass.
  • Measuring the length to the bottom of the bob. L goes to the centre of the bob.
  • Timing one swing. In a real experiment, time 10 swings and divide by 10 to cut the reaction-time error.
  • Using big angles with the formula. T = 2π√(L/g) is only accurate for small swings.
  • Confusing a swing and a period. One period is a full there-and-back, from one side to the other and back again.

Common questions

What is the formula for the period of a pendulum?
T = 2π√(L/g) for small swings, where L is the length and g is the gravitational field strength. A 1 m pendulum on Earth has a period of 2.006 s.
Does the mass of a pendulum affect its period?
No. The simulator shows the same period for a 0.1 kg and a 10 kg bob on the same length.
Does the angle affect the period of a pendulum?
Only a little for small angles. Above about 15° the period grows noticeably: at 90° it is 18% longer than the small-angle formula.
How long is a pendulum with a period of 2 seconds?
L = g(T ÷ 2π)² = 9.81 × (2 ÷ 2π)² = 0.994 m on Earth.
What is damping?
A loss of energy, to friction and air resistance, that makes the swing die away. The damping ratio sets how quickly.

Revision cards

Read the front, say your answer, then flip to check.

Where to go next

  • Solve it

    Pendulum and SHM Simulator

    Swing a pendulum and graph its displacement, velocity and acceleration

    Open the tool
  • Test it

    AP Physics 2

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
  • Test it

    High School Physics

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Physics · Waves and lightSimple harmonic motion: equations, graphs and examplesWhat simple harmonic motion is, a = −ω²x, displacement, velocity and acceleration equations and graphs, springs and pendulums, energy and damping.