Physics

Simple Harmonic Motion (Spring–Mass) – Tutorial

On this page, you can find the logic, usage, and important details of the Simple Harmonic Motion (Spring–Mass) calculator.

Page
Tutorial
Quick jump
Follow the headings below
Hint
Results are for informational purposes

What Is Simple Harmonic Motion (SHM)?

Simple harmonic motion occurs when the force pulling an object back toward equilibrium is directly proportional to the displacement from that equilibrium. Because of this proportionality, the motion is described by periodic functions such as sine and cosine.

Restoring force: F = −k·x

Here k is the spring constant (N/m), x is the displacement from equilibrium (m), and the "−" sign means the force always points back toward equilibrium. If the object moves right, the force points left; if it moves left, the force points right.


Setting Up the Model: Why a Differential Equation?

Let's write Newton's Second Law for the spring–mass system:

Newton: ΣF = m·a = m·x''

Assuming the spring force is the only force (frictionless, horizontal system):

m·x'' = −k·x  →  m·x'' + k·x = 0

This equation says "acceleration is proportional to displacement but in the opposite direction." This is precisely what produces sine/cosine solutions: because the second derivative of cosine returns to cosine with a sign change.


Where Does Angular Frequency (ω) Come From?

The standard solution to the equation is:

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

Where: A is the amplitude (maximum displacement), φ is the initial phase (sets initial conditions), ω is the angular frequency (rad/s).

Substituting into the equation (x'' = −A·ω²·cos(ωt+φ)):

m·(−A·ω²·cos) + k·(A·cos) = 0
A·cos(ωt+φ)·(k − mω²) = 0  →  ω² = k/m

ω = √(k/m)

Interpretation: the stiffer the spring (larger k), the faster the oscillation. The larger the mass (larger m), the more "sluggish" the system — the oscillation slows down.


Period (T) and Frequency (f)

The time for one complete oscillation is the period. Its relation to angular frequency:

T = 2π / ω

Frequency is the number of oscillations per second:

f = 1 / T

A cultural note: in physics "frequency" is analogous to everyday "speed," but its unit is Hz (1/s). The pitch of musical notes (e.g. A = 440 Hz) is exactly "how many vibrations per second."


Displacement–Velocity–Acceleration Equations

Once we know the displacement, velocity is its derivative and acceleration is the derivative of velocity:

x(t) = A·cos(ωt + φ)
v(t) = x'(t) = −A·ω·sin(ωt + φ)
a(t) = x''(t) = −A·ω²·cos(ωt + φ) = −ω²·x(t)

The last line gives a powerful insight: a = −ω² x. That is, acceleration is always opposite in direction to displacement and proportional in magnitude. This is why the object is constantly "pulled" toward equilibrium.


Maximum Velocity and Maximum Acceleration

Since the absolute value of sine/cosine cannot exceed 1:

vmax = A·ω
amax = A·ω²

Interpretation: maximum velocity occurs at the equilibrium point (all energy is kinetic), maximum acceleration occurs at the extreme points (all energy is stored in the spring and the restoring force is strongest).


Energy Perspective: Why "Harmonic"?

The elegance of SHM is the regular exchange of energy between two forms:

  • Spring potential energy: U = (1/2)·k·x²
  • Kinetic energy: K = (1/2)·m·v²

In the ideal frictionless case, total energy is constant: E = K + U. At the extreme points v=0 (all energy in the spring); at equilibrium x=0 (all energy in motion).


What Does the Initial Phase (φ) Do?

The phase determines "where in the cycle the motion begins":

  • φ = 0: x(0) = A — the system starts from the extreme point (cos 0 = 1).
  • φ = 90°: x(0) = 0 — the system starts from the equilibrium point (cos 90° = 0).

In practice, the initial conditions (initial position and velocity) determine which combination of φ and A is consistent.


Where Does SHM Appear?

  • Spring–mass systems: sensors, damper-like models (small oscillations close to ideal).
  • Pendulum (small angle): at small angles a pendulum approximately exhibits SHM behavior.
  • Molecular vibrations: bond vibrations in chemistry, IR spectroscopy (approximate harmonic oscillator).
  • Electronic circuits: in an LC circuit energy oscillates between the electric and magnetic fields (same mathematics).
  • Sound and music: vibrations of strings and air columns — the concept of "harmonics" also extends into music theory.

Real-World Note: Damping and Nonlinearity

This tool solves ideal SHM: no friction, linear spring (Hooke's law valid), amplitude not too large. In reality:

  • With damping, amplitude decreases over time (energy dissipates as heat).
  • With large amplitude, the spring may behave nonlinearly and the period can shift slightly.
  • Air resistance and internal friction cause the real v(t) and a(t) values to differ slightly from the table.

Summary Formulas: F=−kx, m x'' + kx = 0, ω=√(k/m), T=2π/ω, f=1/T, x=Acos(ωt+φ), v=−Aω sin(ωt+φ), a=−Aω² cos(ωt+φ)=−ω²x.