← thecodex.expert
Simulations Hub Simple Harmonic Motion (concept)
Interactive Simulation · Classical Mechanics

Simple Harmonic Oscillator

InteractiveConfidence: HighLast verified: July 2026

A simple harmonic oscillator is a system — such as a mass on a spring — that experiences a restoring force directly proportional to its displacement from equilibrium, producing sinusoidal motion in time.

Interactive simulation

Position x: 0.00 m
Velocity v: 0.00 m/s
Acceleration a: 0.00 m/s²
Kinetic Energy: 0.00 J
Potential Energy: 0.00 J
Total Energy: 0.00 J
Period T: 0.00 s
Angular freq. ω: 0.00 rad/s
Common mistakeThe period of a mass-spring oscillator (T = 2π√(m/k)) does not depend on the amplitude (initial displacement) at all — only on mass and spring constant. Dragging the amplitude slider changes how far the mass swings, but the oscillation frequency and period stay exactly the same, a defining feature of genuinely simple harmonic motion.

The physics

x(t) = x₀ cos(ωt),   ω = √(k/m)
SymbolQuantitySI Unit
x(t)Displacement from equilibrium at time tmetre (m)
x₀Amplitude (initial displacement, released from rest)metre (m)
ωAngular frequencyrad/s
mMasskilogram (kg)
kSpring constantN/m

Velocity and acceleration follow by differentiation: v(t) = −x₀ω sin(ωt), and a(t) = −x₀ω² cos(ωt) = −ω²x(t). This last relationship — acceleration proportional to and opposite in sign to displacement — is the defining mathematical signature of simple harmonic motion, and follows directly from Newton's second law applied to Hooke's law, F = −kx: ma = −kx, so a = −(k/m)x = −ω²x.

Total mechanical energy, E = ½kx₀², remains constant throughout the motion (in this idealised, frictionless model), continuously exchanging between kinetic energy (maximum at x = 0) and spring potential energy (maximum at the extremes of motion, x = ±x₀) — visible directly in the simulation's live energy readouts.

Sources

  • Hooke, R. (1678). De Potentia Restitutiva — original statement of Hooke's law.
  • Taylor, J.R. (2005). Classical Mechanics. University Science Books, Ch. 5.
Last verified: July 2026 · Source: Taylor (2005) · Confidence: high