ToolNestr

Simple Harmonic Motion Calculator

Solve x(t) = A cos(ωt), v(t) = −Aω sin(ωt), and a(t) = −Aω² cos(ωt) for a mass-spring oscillator, or find ω from spring constant and mass. Two 3D diagrams show the oscillator at its extremes and the phase relationship between displacement, velocity, and acceleration, with charts tracing displacement and velocity over one full period.

Reviewed by the ToolNestr Editorial Team — July 2026

Disclaimer: This tool is provided for educational purposes to support learning in physics. It is not a substitute for professional engineering or safety-critical calculations.
Physics
Displacement x
Velocity v
Acceleration a
Period T
v_max
a_max

Oscillator extremes and phase

1. Mass-spring system at its extremes

The mass shown at both extreme displacements (±A) with the spring compressed and stretched — the two turning points where velocity is momentarily zero.

2. Displacement, velocity, and acceleration vectors

At equilibrium, the velocity arrow (indigo) is longest while displacement and acceleration vanish — the 90° phase relationship in 3D form.

Simple harmonic motion graphs

Displacement x(t) over one full period
Velocity v(t) — 90° out of phase with displacement

How it works

The core idea in one line: in simple harmonic motion, the restoring force (and therefore acceleration) is always proportional to displacement and points back toward equilibrium, producing a smooth, endlessly repeating cosine-shaped oscillation whose period never depends on how far it swings.

x(t) = A cos(ωt)

displacement — A = amplitude, ω = angular frequency (rad/s)

v(t) = −Aω sin(ωt)

velocity — maximum magnitude Aω occurs at x = 0

a(t) = −Aω² cos(ωt) = −ω²x

acceleration — maximum magnitude Aω² occurs at x = ±A

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

for a mass-spring system — k = spring constant, m = mass

Starting from Newton's second law for a spring, F = −kx = ma, dividing through by m gives a = −(k/m)x — exactly the defining equation of SHM with ω² = k/m. Solving that differential equation produces x(t) = A cos(ωt), and differentiating once gives velocity v(t) = −Aω sin(ωt), and again gives acceleration a(t) = −Aω² cos(ωt) = −ω²x. Because ω depends only on k and m (not on A), the period T = 2π/ω is completely independent of amplitude.

Worked example 1 — mass-spring system at a mid-cycle instant

Given: A 0.5 kg mass on a spring with k = 200 N/m oscillates with amplitude A = 0.1 m. Find x, v, a at t = 0.05 s.

Angular frequency: ω = √(k/m) = √(200/0.5) = √400 = 20 rad/s (T = 2π/20 ≈ 0.314 s)
Phase: ωt = 20 × 0.05 = 1.0 rad → cos(1.0) ≈ 0.5403, sin(1.0) ≈ 0.8415
Displacement: x = A cos(ωt) = 0.1 × 0.5403 ≈ 0.0540 m
Velocity: v = −Aω sin(ωt) = −0.1 × 20 × 0.8415 ≈ −1.683 m/s
Acceleration: a = −Aω² cos(ωt) = −40 × 0.5403 ≈ −21.61 m/s²

v_max = Aω = 2 m/s and a_max = Aω² = 40 m/s² for this system — the instantaneous values above are partway between the extremes.

Worked example 2 — the quarter-period instant (x = 0, v = v_max)

Given: A different oscillator has period T = 2 s and amplitude A = 0.2 m. Find x, v, a at t = 0.5 s (exactly one quarter of the period).

Angular frequency: ω = 2π/T = 2π/2 = π ≈ 3.1416 rad/s
Phase: ωt = π × 0.5 = π/2 (90°) → cos(90°) = 0, sin(90°) = 1
Displacement: x = A cos(ωt) = 0.2 × 0 = 0 m (passing through equilibrium)
Velocity: v = −Aω sin(ωt) = −0.2 × 3.1416 × 1 ≈ −0.628 m/s (this is v_max)
Acceleration: a = −Aω² cos(ωt) = 0 m/s² (zero exactly at equilibrium)

This instant lands exactly at equilibrium, which is why velocity peaks at its maximum magnitude while acceleration drops to zero — the two are always 90° out of phase in SHM.

Period is independent of amplitude

Same spring (k = 200 N/m) and mass (m = 0.5 kg) at four different amplitudes — ω and T stay exactly the same, only the peak displacement, speed, and acceleration change.

Amplitude APeriod Tv_max = Aωa_max = Aω²
5 cm0.314 s1.00 m/s20.0 m/s²
10 cm0.314 s2.00 m/s40.0 m/s²
20 cm0.314 s4.00 m/s80.0 m/s²
40 cm0.314 s8.00 m/s160.0 m/s²

Notice the period column never changes — this is the defining, often counter-intuitive feature of ideal simple harmonic motion.

Where simple harmonic motion actually matters

🕰️ Pendulum clocks

Mechanical clocks use the near-constant period of a swinging pendulum (a small-angle SHM approximation) to keep reliable time, since the period barely changes as the swing gradually loses energy to friction.

🚗 Vehicle suspension systems

A car's suspension springs oscillate in a damped version of SHM after hitting a bump — engineers tune the spring constant and damping to control how quickly the oscillation settles down.

🎸 Musical instrument strings

A plucked guitar string vibrates in a pattern built from combinations of SHM at different frequencies (harmonics), which is why the same string produces a rich, layered tone rather than a single pure note.

🌍 Seismometers

Seismographs use a mass suspended on a spring that stays nearly still while the ground moves beneath it — the relative motion, governed by SHM physics, is what gets recorded as an earthquake's waveform.

Common misconceptions

"SHM moves at constant speed, like a car on cruise control."

Speed in SHM constantly changes — it peaks at the equilibrium position (v_max = Aω) and drops to exactly zero at the extreme displacements, where the object momentarily reverses direction.

"A bigger swing (larger amplitude) takes longer to complete one cycle."

For ideal SHM, period depends only on ω (from k and m for a spring, or g and length for a pendulum), never on amplitude — a small swing and a large swing of the same system complete a cycle in exactly the same time.

"Acceleration is greatest where speed is greatest."

The opposite is true — acceleration is maximum at the extremes of displacement (where speed is momentarily zero), and acceleration is zero at the equilibrium point (where speed is maximum). Displacement and acceleration are always exactly out of phase.

"Any periodic motion is simple harmonic motion."

SHM specifically requires the restoring force (and acceleration) to be directly proportional to displacement and always directed back toward equilibrium, a = −ω²x. Many periodic motions — like a bouncing ball or a swinging pendulum at large angles — do not satisfy this and are not true SHM.

Formula sources & further reading

The formulas here are standard, traceable to:

  • OpenStax, University Physics Volume 1 — Chapter 15, "Oscillations" (free, peer-reviewed). openstax.org
  • Halliday, Resnick & Walker, Fundamentals of Physics — Chapter 15, Oscillations.
  • Serway & Jewett, Physics for Scientists and Engineers — Chapter 15, Oscillatory Motion.

x(t)=A cos(ωt), v(t)=−Aω sin(ωt), a(t)=−Aω² cos(ωt), with ω=√(k/m)=2π/T=2πf. Phase offset φ is assumed zero (starting at maximum displacement) unless noted. Results are rounded for display.

How to use this calculator

1

Enter A and ω (or k, m, or T)

Provide amplitude plus angular frequency directly, or spring constant & mass, or the period — the calculator converts between them.

2

Pick a time t

Choose any instant within the cycle to evaluate displacement, velocity, and acceleration.

3

Compare on the charts

See how displacement and velocity trace out a full cycle, always 90° out of phase with each other.

Related tools

Frequently asked questions

What is simple harmonic motion?

Simple harmonic motion (SHM) is periodic back-and-forth motion where the restoring force (and acceleration) is always proportional to displacement and points back toward equilibrium: a = −ω²x. A mass on a spring and a small-angle pendulum are the two classic examples.

How do you find the angular frequency of a mass-spring system?

ω = √(k/m), where k is the spring constant (N/m) and m is the mass (kg). The period is T = 2π/ω = 2π√(m/k), and frequency is f = 1/T.

Does the period of SHM depend on amplitude?

No — for ideal SHM, the period depends only on ω (which comes from k and m for a spring), not on how far the amplitude is. A gentle swing and a wide swing of the same spring-mass system take exactly the same time per cycle.

Where is velocity greatest in SHM?

Velocity is greatest at the equilibrium position (x = 0), where v_max = Aω. Velocity is exactly zero at the two extreme displacements (x = ±A), where the oscillator momentarily reverses direction.

Where is acceleration greatest in SHM?

Acceleration is greatest in magnitude at the extremes of displacement (x = ±A), where a_max = Aω², and it is exactly zero at the equilibrium position — the opposite pattern from velocity.

All tool categories

⚛️ Physics (48 tools)
🎚️ Ohm's Law Calculator⚖️ Density Calculator💥 Force Calculator (F=ma)🔋 Parallel Resistor Calculator🔧 Work Calculator (Physics)🏃 Kinetic Energy Calculator📈 Gravitational Potential Energy Calculator🎯 Momentum & Impulse Calculator🎱 Elastic Collision Calculator🧲 Inelastic Collision Calculator〰️ Wavelength Calculator🌍 Newton's Law of Gravitation Calculator🎯 Projectile Motion Calculator⬇️ Free Fall Calculator🔄 Uniform Circular Motion Calculator🥍 Impulse Calculator🔩 Torque Calculator🌪️ Angular Acceleration Calculator🪩 Moment of Inertia Calculator🪀 Centripetal Force Calculator📍 Average Velocity Calculator🚀 Acceleration Calculator🪂 Terminal Velocity Calculator🛰️ Escape Velocity Calculator🪐 Weight on Other Planets Calculator⚙️ Mechanical Efficiency Calculator🛞 Work-Energy Theorem Calculator⛴️ Buoyancy (Archimedes' Principle) Calculator🤿 Pressure Calculator🕰️ Simple Pendulum Period Calculator🌡️ Heat Transfer Calculator⚡ Coulomb's Law Calculator🔌 Series Resistor Calculator💡 Electric Power Calculator🔦 Snell's Law (Refraction) Calculator🔍 Thin Lens Equation Calculator🧯 Specific Heat Calculator🪫 Capacitance Calculator📡 Electric Field Calculator🚨 Doppler Effect Calculator🛸 Orbital Velocity Calculator🌀 Magnetic Force Calculator🎻 Simple Harmonic Motion Calculator🔊 Sound Intensity Calculator📏 Thermal Expansion Calculator🛩️ Bernoulli's Equation Calculator📻 Frequency Calculator🪞 Mirror Equation Calculator
🌐 Networking & IP Tools (36 tools)
🧮 Everyday (26 tools)
💪 Health & Fitness (30 tools)
💰 Finance (34 tools)
🔢 Math (23 tools)
📄 PDF Tools (10 tools)
🎨 Creators (12 tools)
💻 Developers (24 tools)
⚡ Engineering & Science (24 tools)
🧪 Chemistry (50 tools)
🧬 Biology (50 tools)
🏠 Construction & Home Improvement (105 tools)
👗 Clothing & Garment Tools (68 tools)
🍳 Cooking & Baking (9 tools)
🚗 Automotive (26 tools)
🖼️ Image Tools (13 tools)
🔐 Security & Hash (15 tools)
📝 Text Tools (15 tools)
🔍 SEO Tools (11 tools)
🔄 Converters (69 tools)
🕐 Time & Date (15 tools)
📊 Chart Generators (11 tools)
🕌 Islamic Tools (16 tools)