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.
Spring Oscillation
Displacement vs Time
Phase Portrait (v vs x)
Parameters
Properties
Reference Guide
Simple Harmonic Motion
SHM occurs when a restoring force is proportional to displacement. For a spring this is Hooke's law.
The resulting motion is sinusoidal.
where is the natural angular frequency, is the amplitude, and the period is .
Damped Oscillation
Adding a damping force proportional to velocity gives
The damping ratio determines the behavior.
- Underdamped () oscillates with decaying amplitude
- Critically damped () returns to equilibrium fastest without oscillating
- Overdamped () 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 .
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.