Simple Harmonic Motion Simulator — Spring and Oscillation

Simple harmonic motion (SHM) is the most fundamental type of oscillation in physics. It occurs whenever a system is displaced from equilibrium and experiences a restoring force proportional to the displacement. Springs, pendulums (for small angles), sound waves, and even atoms vibrating in a crystal lattice all exhibit SHM.

Understanding SHM is essential for waves, optics, quantum mechanics, and electrical circuits — because oscillation is everywhere.

Period

1.99 s

10 N/m
1 kg
1 m
0

The Physics of SHM

Equation of Motion

For a mass mm on a spring with spring constant kk, Newton's second law gives:

mx¨=kxx¨=ω02xm\ddot{x} = -kx \quad \Rightarrow \quad \ddot{x} = -\omega_0^2 x

where the natural angular frequency is:

ω0=km\omega_0 = \sqrt{\frac{k}{m}}

The solution is sinusoidal:

x(t)=Acos(ω0t+ϕ)x(t) = A\cos(\omega_0 t + \phi)

where AA is the amplitude and ϕ\phi is the initial phase.

Key Quantities

QuantityFormulaUnit
Angular frequencyω0=k/m\omega_0 = \sqrt{k/m}rad/s
PeriodT=2π/ω0=2πm/kT = 2\pi/\omega_0 = 2\pi\sqrt{m/k}s
Frequencyf=1/Tf = 1/THz
Max velocityvmax=Aω0v_{max} = A\omega_0m/s
Max accelerationamax=Aω02a_{max} = A\omega_0^2m/s²

Damping

Real oscillators lose energy over time. Adding a damping term γx˙\gamma\dot{x} gives:

x¨+γx˙+ω02x=0\ddot{x} + \gamma\dot{x} + \omega_0^2 x = 0

The damping ratio ζ=γ/(2ω0)\zeta = \gamma/(2\omega_0) characterises the decay:

  • ζ=0\zeta = 0: undamped — oscillates forever
  • 0<ζ<10 < \zeta < 1: underdamped — decays but oscillates
  • ζ=1\zeta = 1: critically damped — fastest return to zero without oscillation

Worked Examples

Worked Example

Example 1 — Period of a spring-mass system

A mass of 0.5 kg is attached to a spring with constant k = 20 N/m. What is the period of oscillation?

ω0=km=200.5=406.32 rad/s\omega_0 = \sqrt{\frac{k}{m}} = \sqrt{\frac{20}{0.5}} = \sqrt{40} \approx 6.32 \text{ rad/s}

T=2πω0=2π6.320.99 s1 sT = \frac{2\pi}{\omega_0} = \frac{2\pi}{6.32} \approx 0.99 \text{ s} \approx 1 \text{ s}

The mass completes one full oscillation roughly every second.

Worked Example

Example 2 — Maximum velocity and acceleration

For the same system (k = 20 N/m, m = 0.5 kg) with amplitude A = 0.1 m, find the maximum speed and maximum acceleration.

vmax=Aω0=0.1×6.320.63 m/sv_{max} = A\omega_0 = 0.1 \times 6.32 \approx 0.63 \text{ m/s}

amax=Aω02=0.1×40=4 m/s2a_{max} = A\omega_0^2 = 0.1 \times 40 = 4 \text{ m/s}^2

Both maxima occur at different points: vmaxv_{max} at the equilibrium position (x=0x = 0), amaxa_{max} at the turning points (x=±Ax = \pm A).


Frequently Asked Questions

Explore more simulations

Every concept on PhysicStuff has an interactive visualisation — no login, no setup required.