Simple Harmonic Motion

A mass on a spring with live position, velocity and energy graphs

Beginner

Drag the block left or right to set the starting displacement, then let go. The dot on the circle moves at a constant angular speed ω; its horizontal shadow is the block's position.

Last 6 s, each scaled to its peakx / Av / Aωa / Aω²
ω = √(k/m)
6.32 rad/s
T = 2π/ω
0.993 s
f = 1/T
1.007 Hz
Amplitude A
0.150 m
Position x
0.150 m
Velocity v
0.000 m/s
Acceleration a
-6.00 m/s²
Force F = −kx
-6.00 N

Energy

Kinetic ½mv²0.000 J
Spring potential ½kx²0.450 J
Total ½kA²0.450 J

What is simple harmonic motion?

A spring pulls back on a mass with a force proportional to how far it is stretched or squashed. This is Hooke's law, F = −kx. The minus sign means the force always points back toward equilibrium. Combine it with Newton's second law and you get a = −(k/m)x: the acceleration is proportional to the displacement and opposite to it.

Any system that obeys this rule oscillates sinusoidally, x(t) = A cos(ωt + φ). The amplitude A depends on how you start the motion, but the period does not: a stiffer spring (bigger k) makes it faster, and a heavier mass (bigger m) makes it slower. Doubling the amplitude does not change the period at all.

Velocity and acceleration are also sinusoids. Velocity is a quarter cycle ahead of position, so the mass is fastest as it passes through x = 0. Acceleration is exactly opposite to position, so it is largest at the turning points where the mass momentarily stops.

The reference circle under the spring shows why the motion is a cosine. A point going round a circle of radius A at constant angular speed ω has a horizontal coordinate A cos(ωt). Its shadow on the horizontal axis moves exactly like the mass, which is why ω is called the angular frequency even though nothing is rotating.

Key formulas

Equation of motion

F = −kx  ⇒  a = −(k/m) x = −ω²x

k
spring constant (N/m)
m
mass (kg)

Solution

x(t) = A cos(ωt + φ)

A
amplitude (m)
φ
phase constant, set by the starting conditions

Angular frequency, period and frequency

ω = √(k/m),   T = 2π√(m/k),   f = 1/T

Velocity, acceleration and energy

vmax = Aω,   amax = Aω²,   E = ½mv² + ½kx² = ½kA²

How to use this visualizer

  1. 1
    Drag the blue block left or right to set the starting displacement, then let go. It is released from rest, so that displacement is the amplitude.
  2. 2
    Change the mass and spring constant and watch ω, T and f update. Quadruple the mass and the period doubles.
  3. 3
    Compare the graph traces: v (green) peaks a quarter period before x (blue), and a (orange) is always the mirror image of x.
  4. 4
    Watch the energy bars. Kinetic and spring potential energy trade places twice per cycle while the total stays at ½kA².
  5. 5
    Follow the dot on the reference circle. Its horizontal position always matches the block.

Real-world applications

Clocks and watches

A balance wheel on a hairspring or a quartz crystal oscillates with a steady period that keeps time.

Buildings and bridges

Structures sway like springs. Engineers compute their natural periods so wind and earthquakes do not excite them.

Musical instruments

Strings, tuning forks and air columns vibrate in nearly simple harmonic motion, producing pure tones.

Vehicle suspension

Car springs let the body oscillate over bumps; shock absorbers then damp the motion out.

Practice problems

Problem 1: Period of a spring

A 0.50 kg mass hangs on a spring with k = 200 N/m. Find the angular frequency, the period and the frequency of its oscillation.
Show solution

ω = √(k/m) = √(200 / 0.50) = √400 = 20 rad/s

T = 2π/ω = 2π / 20 = 0.314 s

f = 1/T = 3.18 Hz

ω = 20 rad/s, T ≈ 0.31 s, f ≈ 3.2 Hz

Problem 2: Maximum speed from energy

A 2.0 kg block on a spring with k = 50 N/m is pulled 0.10 m from equilibrium and released. What is its maximum speed, and what is its speed when x = 0.06 m?
Show solution

Total energy: E = ½kA² = ½ × 50 × 0.10² = 0.25 J

At x = 0 all of it is kinetic: ½mvmax² = 0.25 J

vmax = √(2 × 0.25 / 2.0) = 0.50 m/s (check: Aω = 0.10 × √(50/2) = 0.50 m/s)

At x = 0.06 m: ½mv² = 0.25 − ½ × 50 × 0.06² = 0.25 − 0.09 = 0.16 J

v = √(2 × 0.16 / 2.0) = 0.40 m/s

vmax = 0.50 m/s, v(0.06 m) = 0.40 m/s

Discussion

Questions, ideas or a different approach? Join the conversation.