Simple Harmonic Motion Calculator

📚 Confused about how this is calculated? Read the full Why the Same Motion Appears Everywhere in Nature →

The Motion That Keeps Repeating Itself Exactly

A mass bobbing on a spring, a guitar string vibrating, a swinging pendulum at small angles — all trace out the same mathematical pattern known as simple harmonic motion. What makes it "simple" is that the restoring force is always proportional to displacement, which produces a smooth, perfectly repeating sinusoidal oscillation with a fixed period no matter how large the displacement was to start.

The Formulas

Position: x(t) = A × cos(ωt + φ)
Velocity: v(t) = −Aω × sin(ωt + φ)
Acceleration: a(t) = −Aω² × cos(ωt + φ)

A is amplitude, ω is angular frequency (2π/period or 2π×frequency), φ is phase angle, and t is time. Notice that velocity leads position by 90° and acceleration is always directed back toward the center, proportional to and opposite in sign to displacement — the defining signature of this kind of motion.

Where This Pattern Governs Real Systems

  • Mechanical vibration analysis — suspension systems, engine mounts, and structural components are modeled as spring-mass oscillators to predict resonance and fatigue.
  • Musical instruments — vibrating strings, air columns, and reeds all produce sound through some form of simple harmonic motion, with frequency setting pitch.
  • Clocks and timekeeping — quartz crystal oscillators use the same underlying physics as a spring, vibrating at an extremely stable and predictable frequency.
  • Seismology — buildings and structures respond to earthquake shaking in ways that can be approximated using harmonic oscillator models, especially near a structure's natural frequency.

One Full Cycle, Point by Point

For a 0.1 m amplitude oscillator with a 2-second period (ω = π rad/s) and zero phase, position, velocity, and acceleration trade off through the cycle:

Position, velocity, and acceleration through one cycle (A = 0.1 m, T = 2 s)
TimePositionVelocityAcceleration
t = 00.1 m0 m/s−0.98696 m/s²
t = T/40 m−0.31416 m/s0 m/s²
t = T/2−0.1 m0 m/s0.98696 m/s²
t = 3T/40 m0.31416 m/s0 m/s²

Velocity peaks exactly when position crosses zero, and acceleration peaks exactly when position is at its extremes — the two are always 90° and 180° out of phase with position, respectively.

How to Use This Calculator

  1. Choose a mode: Using Period or Using Frequency.
  2. Enter Amplitude (m), Phase Angle (degrees, defaults to 0), and Time (seconds, defaults to 0).
  3. Enter Period T (s) or Frequency f (Hz) depending on the mode.
  4. Select Calculate to see position, velocity, and acceleration at that instant, plus maximum velocity and acceleration, along with the worked formula.

Related Calculations

For the specific case of a gravity-driven pendulum's period, see the Pendulum Period Calculator, or convert between this motion's frequency and period directly with the Frequency Calculator.

Principles of Simple Harmonic Motion (SHM) and Oscillator Dynamics

A Simple Harmonic Motion (SHM) calculator computes the angular frequency (ω), oscillation period (T), natural frequency (f), displacement x(t), velocity v(t), acceleration a(t), and total mechanical energy for linear mass-spring systems and harmonic oscillators. In classical mechanics, SHM describes any physical system where a Restoring Force is directly proportional to displacement from an equilibrium position (Hooke's Law: F = -k·x).

The Fundamental Kinematic and Energy Formulas of SHM

Hooke's Law & Equation of Motion: F = -k · x = m · a &implies; m · ( d2x / dt2 ) + k · x = 0
Angular Frequency: ω = √( k / m )  (rad/s)
Period of Oscillation: T = 2 · π · √( m / k )  (seconds)
Natural Cyclic Frequency: f = 1 / T = [ 1 / ( 2π ) ] · √( k / m )  (Hertz)
Displacement: x(t) = A · cos( ω t + φ )
Velocity: v(t) = -A · ω · sin( ω t + φ ) &implies; Maximum Velocity: vmax = A · ω
Acceleration: a(t) = -ω2 · x(t) &implies; Maximum Acceleration: amax = A · ω2
Total Mechanical Energy: Etotal = ½ · k · A2 = ½ · k · x2 + ½ · m · v2

Phase Relationships in Simple Harmonic Motion

  • Displacement vs. Velocity (90° / π/2 Lead): When displacement is at maximum amplitude (x = ±A), velocity is zero (instantaneous turnaround). When passing equilibrium (x = 0), velocity is maximized (v = ±vmax).
  • Displacement vs. Acceleration (180° / π Out of Phase): Acceleration vector always points directly opposite to displacement vector toward equilibrium.

Step-by-Step Worked Calculation Example

Example: Calculating Dynamics of a 0.50-kg Mass on a 200 N/m Spring

Problem: A mass m = 0.50 kg is attached to a frictionless horizontal spring with spring constant k = 200.0 N/m. The spring is pulled to amplitude A = 0.10 meters and released from rest at t = 0 (phase angle φ = 0). Calculate: (1) Angular frequency (ω); (2) Oscillation period (T); (3) Maximum velocity (vmax); (4) Maximum acceleration (amax); and (5) Total mechanical energy (E).

Step 1: Calculate Angular Frequency (ω):

ω = √( k / m ) = √( 200.0 / 0.50 ) = √( 400.0 ) = 20.0 rad/s

Step 2: Calculate Period (T = 2π / ω):

T = 2 × 3.14159265 / 20.0 = 0.3142 Seconds (f = 3.183 Hz)

Step 3: Calculate Maximum Velocity (vmax = A·ω):

vmax = 0.10 m × 20.0 rad/s = 2.00 m/s

Step 4: Calculate Maximum Acceleration (amax = A·ω2):

amax = 0.10 m × ( 20.0 )2 = 0.10 × 400.0 = 40.0 m/s2

Step 5: Compute Total Mechanical Energy:

Etotal = ½ × 200.0 N/m × ( 0.10 m )2 = 100.0 × 0.010 = 1.000 Joule

Conclusion: The oscillator executes 3.18 complete cycles per second with 1.0 Joule of conserved mechanical energy.

Damped Harmonic Oscillations and the Damping Ratio (ζ)

Real mechanical oscillators experience viscous drag friction, described by the second-order differential equation:

m · ( d2x / dt2 ) + b · ( dx / dt ) + k · x = 0
Damping Ratio: ζ = b / ( 2 · √[ k · m ] )
  • Underdamped (ζ < 1.0): System oscillates with exponentially decaying amplitude envelopes.
  • Critically Damped (ζ = 1.0 — Engineering Ideal): System returns to equilibrium in the fastest possible time without overshoot (used in automotive shock absorbers and precision galvanometer needles).
  • Overdamped (ζ > 1.0): Heavy viscous friction causes sluggish return to equilibrium.

Forced Harmonic Oscillations and Mechanical Resonance

When an external periodic driving force (F(t) = F0 · cos(ωd t)) acts upon a damped oscillator:

The oscillation amplitude A(ωd) surges dramatically as driving frequency ωd approaches the system's natural resonance frequency ω0 = √(k/m). In civil engineering (suspension bridges, skyscraper wind tuned mass dampers), structural engineers design tuned damping absorbers to prevent destructive aerodynamic harmonic resonance.

Torsional Pendulums and Rotational Simple Harmonic Motion

In mechanical watches (balance wheels) and Cavendish gravitational balance experiments:

Oscillation occurs through rotational twisting of an elastic wire with torsional spring constant κ:

Torsional Oscillation Period: T = 2 · π · √( I / κ )
Where I is the rotational mass moment of inertia (kg·m2) and κ is torsional stiffness (N·m/rad).

Phase Space Trajectories in Harmonic Systems

Plotting velocity v(t) against displacement x(t) produces an elliptical Phase Space Orbit. In lossless conservative SHM, the phase space trajectory area is conserved according to Liouville's Theorem, demonstrating continuous energy conservation between kinetic and potential states.

Lissajous Figures in 2D Oscillators

Superimposing two mutually perpendicular simple harmonic motions on an oscilloscope produces intricate geometric Lissajous Figures that electrical engineers use to measure exact phase differences.