Spring & Pendulum Simulator
Explore simple harmonic motion: a mass bouncing on a spring, a swinging pendulum and two coupled pendulums. Pull the mass or the bob and let go, add friction or a driving force, and compare the measured period with the formulas. See energy flow, damping, resonance and beats live.
Phase space
position → · speed ↑Drag the mass or bob to a new start and let go. Space pause · 1 2 3 switch system · F full screen
Position, velocity, acceleration
x v a (scaled)Energy
kinetic potential totalResonance curve
steady swing for each push frequencyPick an experiment. It restarts with its settings.
Changes apply immediately; the motion continues from where it is.
Export
How the simulation works
- Spring: Hooke's law F = −k·x pulls the mass back, so it oscillates with period T = 2π√(m/k), whatever the size of the swing.
- Pendulum: gravity's pull along the arc is −m·g·sin θ. For small angles sin θ ≈ θ and T ≈ 2π√(L/g); for large angles the period gets longer (the simulator uses the exact equation).
- Damping (−c·v) removes energy. Driving with F₀·cos(2πf·t) adds it; pushing at the natural frequency gives resonance.
- Coupled pendulums are linked by a spring. They have two normal modes; mixing them makes the energy slosh back and forth (beats).
- Motion is calculated with the Runge–Kutta 4 method in steps of 2 ms; the period is measured from successive crossings of the centre.
Everything runs in your browser.
Using Spring & Pendulum Simulator
Explore simple harmonic motion with a mass on a spring, a pendulum and two coupled pendulums. Drag to set the start, add friction or a rhythmic push, and compare the measured period with the textbook formulas while energy flows between motion and height.
- Pick Spring, Pendulum or Coupled at the top of the lab.
- Drag the mass or the bob to a starting position and let go. The period is measured live and compared with the formula.
- Move the Friction slider for damping and the Push slider for a driving force; the energy bars show where the energy goes.
- Open Charts for position, velocity and acceleration, energy, and the resonance curve.
- Try the examples: heavier mass, critical damping, resonance, large swing, pendulum on the Moon and coupled pendulums.
Example
Mass on a spring: 1 kg on a 10 N/m spring gives T = 2π√(m/k) ≈ 1.987 s, and the measured period agrees to four decimals. Large swing: released at 160°, a 1 m pendulum takes about 4.0 s per swing — twice the small-angle formula.
Questions & answers
What is simple harmonic motion?
Motion where the restoring force is proportional to the displacement, like F = −k·x for a spring. The result is a sine-wave motion with a fixed period, whatever the amplitude.
What is the period of a spring?
T = 2π√(m/k). A heavier mass or a softer spring makes it slower. The amplitude does not matter.
What is the period of a pendulum?
For small swings T ≈ 2π√(L/g): it depends only on length and gravity. For large angles it gets longer; the simulator uses the exact equation and shows the exact period.
What is damping?
Friction that removes energy. Light damping makes the swings shrink slowly, critical damping returns to rest fastest without overshooting, heavy damping creeps back slowly.
What is resonance?
Pushing at the system's natural frequency adds energy every cycle, so the swing grows large. The Charts tab draws the resonance curve for your settings.
What are coupled pendulums?
Two pendulums joined by a spring. Energy moves from one to the other and back (beats), because the motion mixes two normal modes with slightly different frequencies.
Does it run on my device only?
Yes. Everything runs in your browser.
Help improve this tool
Report a problem or suggest an improvement
Describe the issue without pasting private tool input. Feedback goes to our admin inbox.
