Simple Harmonic Motion Calculator
Calculate the period, frequency, max velocity, max acceleration, and total energy of a spring-mass system undergoing simple harmonic motion.
The universal pattern of oscillation
Simple harmonic motion (SHM) is one of the most fundamental concepts in physics. It describes the back-and-forth motion that occurs whenever a system experiences a restoring force proportional to its displacement from equilibrium.
In other words: pull something away from its rest position, and a force pulls it back. As it returns, it overshoots equilibrium, swings to the other side, and the cycle repeats.
This motion appears EVERYWHERE in nature:
- A mass on a spring
- A pendulum (for small angles)
- Sound waves vibrating molecules
- AC electrical circuits
- Light waves
- Atomic vibrations
- Earthquake waves
- Musical instrument strings
- Quartz crystal in watches
- Heart valves
- Even orbital motion (in certain projections)
Understanding SHM is the gateway to understanding wave motion, quantum mechanics, music, electronics, and much more.
Hooke’s Law — where SHM begins
The fundamental equation describing the restoring force in SHM is Hooke’s Law:
F = −kx
Where:
- F is the restoring force (in Newtons)
- k is the spring constant (stiffness, in N/m)
- x is the displacement from equilibrium (in meters)
- The negative sign indicates force opposes displacement (returns toward equilibrium)
Hooke’s Law was formulated by Robert Hooke in 1678 — over 340 years ago — and remains accurate for small displacements of nearly every elastic system.
The mathematical solution
Combining Hooke’s Law with Newton’s second law (F = ma):
ma = −kx
This is a second-order differential equation whose solution is:
x(t) = A × cos(ωt + φ)
Where:
- A is amplitude (maximum displacement)
- ω is angular frequency
- t is time
- φ is the phase constant (initial position)
The mass oscillates sinusoidally — a perfect cosine (or sine) wave.
The key formulas
Several derived quantities matter for SHM:
Angular frequency (rad/s): ω = √(k/m)
Period (time for one complete oscillation): T = 2π/ω = 2π√(m/k)
Frequency (oscillations per second): f = 1/T = ω/(2π)
Maximum velocity (occurs at equilibrium position): v_max = Aω
Maximum acceleration (occurs at extreme positions): a_max = Aω² = (v_max)²/A
Total energy (constant throughout motion): E_total = ½kA²
The energy story of SHM
One of the most beautiful aspects of SHM is the constant exchange between kinetic and potential energy:
At extreme displacement (x = ±A):
- All energy is potential: E_p = ½kA²
- Velocity = 0
- Acceleration = maximum
- Position changing fastest in velocity
At equilibrium (x = 0):
- All energy is kinetic: E_k = ½mv_max²
- Velocity = maximum
- Acceleration = 0
- Position changing slowest in velocity
At any point:
- E_p + E_k = ½kA² (constant)
- Energy is continuously converted between forms
- Total mechanical energy is conserved (no friction)
This conservation makes SHM mathematically tractable and predictable.
The pendulum — a special case
A simple pendulum (mass on a string) approximates SHM for small angles:
ω = √(g/L) T = 2π√(L/g)
Where:
- L is pendulum length (meters)
- g is gravitational acceleration (9.81 m/s² on Earth)
A 1-meter pendulum on Earth has T = 2π√(1/9.81) ≈ 2.006 seconds.
Historically, this exact relationship was used to define the meter — a “seconds pendulum” that beats once per second has a specific length. The definition was later refined to be based on the speed of light.
Real pendulums vs SHM
The simple pendulum formula T = 2π√(L/g) only holds for small angles (under ~15°). For larger amplitudes:
- The period increases slightly
- The motion becomes anharmonic
- Exact solution requires elliptic integrals
For pendulum clocks operating at ±5° swing: SHM approximation is essentially perfect.
SHM in real-world systems
Many practical systems use SHM:
Mechanical clocks and watches:
- Quartz crystals oscillating at ~32,768 Hz (2^15)
- Pendulum clocks at ~1 Hz
- Balance wheel watches at 18,000-36,000 beats/hour
Musical instruments:
- Guitar strings: f = (1/2L)√(T/μ) where T is tension, μ is linear mass density
- Tuning forks: precisely tuned to specific frequencies
- Piano strings: longer/heavier for lower notes
Vehicle suspensions:
- Springs + dampers = damped SHM
- Engineers tune for ride quality and handling
Earthquake monitoring:
- Seismographs measure ground motion as oscillation
- Different frequencies indicate different wave types
Tuning electronics:
- LC circuits: f = 1/(2π√(LC))
- Radio tuning, antennas, filters
Damped harmonic motion
In real systems, friction or air resistance damps the motion:
m(d²x/dt²) + b(dx/dt) + kx = 0
Three regimes depending on damping coefficient b:
Under-damped (b small):
- Oscillates with decreasing amplitude
- Most musical instruments, vehicle suspensions tuned this way
- Most “natural” feeling motion
Critically damped (b = critical value):
- Returns to equilibrium fastest without oscillating
- Door closers, vehicle shock absorbers tuned this way
- Most efficient return to rest
Over-damped (b large):
- Slowly returns to equilibrium
- Like trying to move through honey
- Some specialized applications
Driven harmonic motion and resonance
When you push a swing in time with its natural frequency, amplitude grows:
Resonance: matching driving frequency to natural frequency causes amplitude buildup
- Tacoma Narrows Bridge collapsed in 1940 due to wind-driven resonance
- Microwave ovens resonate water molecules at 2.4 GHz
- MRI machines use radio frequency resonance with atoms
- Musical instruments resonate at specific frequencies
Resonance disasters:
- Tacoma Narrows Bridge (1940)
- Millennium Bridge London (2000, retrofit needed)
- Various wind-induced building oscillations
Resonance benefits:
- Filters tuned for specific frequencies
- Antenna design
- Energy storage (e.g., flywheels)
- Quartz oscillators
Quantum harmonic oscillator
In quantum mechanics, the simple harmonic oscillator is the most-studied system:
E_n = ℏω(n + ½)
Where:
- n is the quantum number (0, 1, 2, 3, …)
- ℏ is reduced Planck constant
- ω is classical angular frequency
Even at n = 0 (ground state), energy is ½ℏω — the “zero-point energy” that doesn’t disappear at absolute zero.
This quantum SHM describes:
- Vibrating molecules
- Black body radiation
- Quantum field theory ground states
- Cooling atoms to nano-Kelvin temperatures
SHM in everyday physics
Examples you encounter:
Car suspensions:
- Bumpy roads cause car body to oscillate
- Damping prevents continuous bouncing
- Properly tuned: bumps absorbed without overshoot
Doors and door closers:
- Pneumatic closers tuned to critical damping
- Close firmly without slamming
Guitar/musical strings:
- Frequency depends on length, tension, mass
- f = (1/2L)√(T/μ)
- Strings ring at specific tones
Trampolines and diving boards:
- SHM during oscillation
- Resonance can amplify motion (trampoline bouncing)
Buildings in earthquakes:
- Each building has natural frequency
- Engineers design to avoid resonance with seismic waves
Heart and other organs:
- Cardiac valves oscillate
- Vocal cords vibrate
Atomic-scale SHM
At the atomic level, SHM appears everywhere:
Molecular vibrations:
- Diatomic molecules vibrate as effective SHM
- Infrared spectroscopy uses vibrational frequencies
- Different bonds have different vibrational signatures
- Determines molecular identification
Solid-state physics:
- Atoms in crystals vibrate around equilibrium
- Phonons (quanta of vibration) are essential to heat capacity
- Lattice vibrations affect electrical resistance
Common SHM problem mistakes
- Confusing amplitude with displacement: A is max, x varies
- Mixing up frequency and angular frequency: f = ω/(2π)
- Forgetting energy is constant: total energy doesn’t decrease unless damped
- Wrong direction for force: F = -kx, not +kx
- Applying SHM to large pendulum angles: only works for <15°
- Period vs frequency: T = 1/f, often confused
- Wrong units: rad/s vs Hz vs RPM
- Forgetting gravity for pendulum: g matters
Bottom line
Simple harmonic motion describes back-and-forth motion when restoring force is proportional to displacement (Hooke’s Law). Key formulas: ω = √(k/m), T = 2π√(m/k), f = 1/T, v_max = Aω, a_max = Aω², E_total = ½kA². Energy continuously converts between kinetic (at equilibrium) and potential (at extremes), totaling ½kA². Real pendulums approximate SHM for angles <15°. Damping converts energy to heat; resonance occurs when driving frequency matches natural frequency. SHM appears everywhere from atomic vibrations to AC electrical circuits to musical instruments to vehicle suspensions. The mathematics extends to quantum mechanics, wave motion, and beyond. Understanding SHM is foundational for physics, engineering, and many applied sciences.