All Tools

Simple Harmonic Motion Explorer

Press Animate to watch a mass-spring system or pendulum oscillate in real time. Adjust the damping to see underdamped, critically damped, and overdamped behavior. All calculations run in your browser.

t = 0.00 s

Spring Oscillation

Displacement vs Time

x(t)

Phase Portrait (v vs x)

Parameters

kg
m
N·s/m
N/m

Properties

Displacement (x)
2 m
Velocity (v)
0 m/s
Acceleration (a)
-20 m/s²
Period (T)
1.987 s
Frequency (f)
0.503 Hz
ω₀
3.162 rad/s
Damping mode
No damping
Damping ratio (ζ)
0

Reference Guide

Simple Harmonic Motion

SHM occurs when a restoring force is proportional to displacement. For a spring this is Hooke's law.

F=kxF = -kx

The resulting motion is sinusoidal.

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

where ω0=k/m\omega_0 = \sqrt{k/m} is the natural angular frequency, AA is the amplitude, and the period is T=2π/ω0T = 2\pi/\omega_0.

Damped Oscillation

Adding a damping force proportional to velocity gives

mx¨+bx˙+kx=0m\ddot{x} + b\dot{x} + kx = 0

The damping ratio ζ=b2mk\zeta = \frac{b}{2\sqrt{mk}} determines the behavior.

  • Underdamped (ζ<1\zeta < 1) oscillates with decaying amplitude
  • Critically damped (ζ=1\zeta = 1) returns to equilibrium fastest without oscillating
  • Overdamped (ζ>1\zeta > 1) returns slowly without oscillating

Simple Pendulum

For small angles, a pendulum follows the same math as a mass-spring system with an effective spring constant keff=mg/Lk_{\text{eff}} = mg/L.

T=2πLgT = 2\pi\sqrt{\frac{L}{g}}

The period depends only on length and gravity, not on mass or amplitude (for small swings). A longer pendulum swings more slowly.

Phase Portrait

A phase portrait plots velocity vs displacement. For undamped SHM, the trajectory is an ellipse.

  • No damping traces a closed ellipse (energy is constant)
  • Underdamped spirals inward toward the origin
  • Critically/overdamped approaches the origin without looping

The phase portrait shows the system's entire state (position and velocity) at a glance. Points far from the origin have high energy; points near the origin have low energy.