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.
The same pattern turns up in a mass on a spring, a pendulum at small angles, sound waves, AC circuits, atomic vibrations, and the quartz crystal in a watch. Get SHM and you have the groundwork for wave motion and a good deal of quantum mechanics.
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 published it in 1678, and it still holds 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, tracing a perfect cosine 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.
This relationship was once proposed as the definition of the meter, since a “seconds pendulum” that beats once per second has a fixed length of about 0.994 m. The meter is now defined by the speed of light instead, partly because g varies from place to place and a pendulum standard would too.
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.
Where you actually meet it
The quartz crystal in a cheap watch is cut to oscillate at 32,768 Hz, which is 2¹⁵, so fifteen divide-by-two stages turn it into a one-second tick with nothing but flip-flops. That single design choice is why a $10 watch keeps better time than a mechanical movement costing a thousand times more.
Mechanical watches run a balance wheel at 18,000 to 36,000 beats per hour, and a pendulum clock at about 1 Hz. All three are the same equation with different values of the restoring force.
Elsewhere: LC circuits resonate at f = 1/(2π√(LC)), which is how a radio picks one station out of the air. Seismographs read ground motion as oscillation, and the frequency tells you which kind of wave arrived. Vehicle springs and dampers are damped SHM, tuned by feel as much as by calculation.
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, the ground state, the energy is ½ℏω. That zero-point energy does not go away at absolute zero.
This quantum SHM describes:
- Vibrating molecules
- Black body radiation
- Quantum field theory ground states
- Cooling atoms to nano-Kelvin temperatures
Two mistakes worth naming
The first is mixing up frequency and angular frequency. They differ by a factor of 2π, they are both called “frequency” in conversation, and swapping them is the single most common source of a wrong answer in an SHM problem. Check the units: rad/s is ω, Hz is f.
The second is that the period of a spring-mass system does not depend on amplitude at all. Pull the mass twice as far and it takes exactly as long to get back. That feels wrong the first time you meet it, and it is the whole reason oscillators make usable clocks: the timing survives the amplitude decaying away.
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.