Back to Blog
Physics

Simple Harmonic Motion Simulation: Five Labs That Build Real Intuition

July 11, 2026 5 min read SciFunLab Team

Explore simple harmonic motion through five interactive simulations — pendulum, spring-mass, damped oscillation, standing waves, and wave on string — with key parameters and real-world connections.

Every oscillation topic — from pendulums to seismographs to guitar strings — runs on the same physics: simple harmonic motion. Most students meet SHM as a formula, memorize it, and still struggle to explain what each variable does. A simple harmonic motion simulation fixes that gap fast. Change one parameter, watch the motion respond, and the equation becomes cause-and-effect instead of symbol soup.

SciFunLab has five labs covering the full oscillation picture. This post walks through each one: what you see, what to adjust, and where it connects to real problems.

The Math of SHM

Before running any simulation, anchor to the core equation:

x = A · cos(ωt + φ)
  • x is the displacement from equilibrium at time t.
  • A (amplitude) is the maximum displacement. It sets the size of the swing, not the speed of it.
  • ω (angular frequency) equals 2π/T, where T is the period. Larger ω means faster oscillation.
  • φ (phase constant) shifts the starting position. It encodes where in the cycle the object was at t = 0.

Everything in the five labs below is this equation — or a variation of it when energy loss or wave propagation enters the picture. Every slider you move maps to one of these four quantities.

Pendulum Lab

What it shows: A bob swings around a pivot under gravity. For small angles, the restoring force is approximately proportional to displacement, so the motion is close to SHM.

The small-angle period formula is:

T = 2π√(L/g)

Notice: mass does not appear. A heavier bob on the same string in the same gravity swings at the same frequency as a lighter one.

Key parameters to adjust:

  • Length — doubles the period when you quadruple it (period scales with √L). This is the most important variable for a pendulum simulation online.
  • Gravity — simulate the Moon or Mars and watch the swing slow. The lab lets you set any gravity value.
  • Damping — add friction. The amplitude shrinks on each swing while the period stays nearly constant for light damping.
  • Starting angle — push past 30° and the small-angle approximation visibly breaks down. The period lengthens, and the SHM label no longer fits exactly.

The phase-space graph (angle vs. angular velocity) turns the pendulum's back-and-forth into an ellipse — a compact signature of undamped SHM that collapses inward when damping is on.

Spring-Mass System (SHM Lab)

What it shows: A mass on a spring is the cleanest possible SHM system because the restoring force is exactly proportional to displacement by Hooke's Law: F = −kx. There is no small-angle approximation. The period is:

T = 2π√(m/k)

This is the foundation of every spring mass simulation. Unlike the pendulum, here mass does appear — heavier mass means slower oscillation; stiffer spring means faster.

Key parameters to adjust:

  • Spring constant k — stiffer spring, higher ω, faster motion. Double k and the frequency increases by √2.
  • Mass m — more mass, lower ω, slower motion. Directly opposite effect to k.
  • Amplitude — in an ideal spring, amplitude does not affect period. Test this and confirm.
  • Initial velocity — launching the mass from equilibrium with a push changes the phase but not the period or amplitude of the resulting motion.

Watch the energy graph: kinetic energy peaks at the equilibrium point; potential energy peaks at maximum displacement. They trade back and forth, summing to a constant total mechanical energy.

Damped Oscillation Simulator

What it shows: Real oscillators lose energy to friction and air resistance. The damped oscillation simulator adds the e^(−γt) decay envelope to the SHM equation, shrinking amplitude exponentially while the frequency stays nearly unchanged for light damping.

Key parameters to adjust:

  • Underdamped — oscillation continues but amplitude shrinks each cycle. Most mechanical systems operate here.
  • Critically damped — fastest return to equilibrium with no overshoot. Car shock absorbers are tuned close to this boundary.
  • Overdamped — too much damping; the system creeps back without oscillating at all.

One slider moves you between all three regimes. Seeing the boundary between underdamped and critically damped makes the textbook categories tangible in a way no diagram can.

Standing Waves and Wave on String

What it shows: These two labs move from a single oscillator to a distributed medium. Wave on String shows a transverse wave traveling along a stretched string. Standing Waves shows what happens when the wave reflects and interferes with itself: crests and troughs lock into fixed positions, with nodes that never move and antinodes that oscillate at maximum amplitude.

Standing wave patterns only appear at discrete resonant frequencies — the harmonics — where the string length equals a whole number of half-wavelengths.

Key parameters to adjust:

  • Frequency — sweep upward until the string snaps into its first harmonic (one antinode), second (two antinodes), and so on.
  • Tension — raises wave speed and shifts resonant frequencies upward.
  • End conditions — fixed ends force a node; a free end forces an antinode. The boundary determines which harmonics exist.

Real-World Applications

Every simulation above maps to something physical:

  • Seismographs — a damped pendulum-spring system tuned to the frequency range of seismic waves.
  • Mechanical clocks — the length-determines-period property of a pendulum is what makes them accurate.
  • String instruments (guitar, violin, sitar) — each is a standing wave machine. Pressing a fret shortens the vibrating length and raises the frequency.
  • Building dampers — skyscrapers use tuned spring-mass systems to absorb resonance from wind or earthquakes.

Curriculum Fit

Exam / Course Key SHM Topics Covered
AP Physics C: Mechanics Spring-mass period, energy in SHM, damped oscillations, driven resonance
A-Level Physics Simple harmonic motion definition, x = A cos(ωt), pendulum and spring examples, damping types
IIT-JEE (Advanced) SHM equations, energy graphs, superposition, coupled oscillations, wave speed on strings

All five simulations run in a browser with no installation. They work on phones, tablets, and classroom projectors.


Explore all five — and the rest of the physics catalog — at SciFunLab Physics Simulations. No signup, no download, free in any browser. Try changing one parameter, make a prediction first, then run it. That one habit is worth more than rereading any formula.

More Physics Articles