Physics & Chemistry

Simple Harmonic Motion Simulator

Mass on a spring — period, amplitude, energy and the displacement curve, all from k and m.

Standards: Hooke’s law · SHM equations Format: browser simulator Cost: free, no sign-up Reviewed: November 2026
Simple Harmonic Motion Simulator — live Hooke’s law · SHM equations
Change the amplitude and the period stays the same — that amplitude independence is what makes the motion "simple".

Inputs

1 kg
100 N/m
0.1 m

Presets

Angular frequency ω10.000 rad/s
Period T0.628 s
Frequency f1.592 Hz
Maximum velocity1.000 m/s
Maximum acceleration10.00 m/s²
Total energy0.500 J
Static deflection under the mass98.1 mm
Period check from static sag0.628 s

Every number below is substituted from the current input state — change a slider and the arithmetic changes with it.

Angular frequency
→ ω = √(k/m) = √(100/1) = 10.000 rad/s
Period
→ T = 2π√(m/k) = 2π/ω = 0.628 s
Displacement
→ x(t) = A·cos(ωt) with A = 0.1 m
Velocity and acceleration
→ v_max = Aω = 1.000 m/s · a_max = Aω² = 10.00 m/s²
Energy
→ E = ½kA² = ½ × 100 × 0.1² = 0.500 J

Notice that the period does not depend on amplitude — that is the defining property of simple harmonic motion, and it only holds while the spring stays linear.

Practice problem

Simple harmonic motion is the most reused model in physics: any system with a linear restoring force, displaced slightly from equilibrium, oscillates this way. Pendulums, springs, LC circuits and molecules all share the same equation.

This simulator takes the two constants that define a mass–spring system — stiffness and mass — and derives the period, the peak velocity and acceleration, and the energy stored at the amplitude.

One equation, many systems

Write the restoring force as F = −kx and Newton’s second law gives ẍ + (k/m)x = 0. The solution is a sinusoid with ω = √(k/m), and that square root is the whole content of the model.

The same equation appears for a pendulum (with k/m replaced by g/L), for a floating body (buoyancy as the restoring force) and for an LC circuit (charge oscillating between capacitor and inductor). Learning one is learning all of them.

Why the period ignores amplitude

A larger amplitude means a larger distance to cover, but also a proportionally larger force and therefore a larger acceleration. The two effects cancel exactly, so the period depends only on m and k.

That cancellation holds only while the force stays linear. Push a spring past its elastic limit, or swing a pendulum past about 20°, and the period starts to depend on amplitude — the isochronism is an approximation, not a law.

Energy in the oscillation

The energy sloshes between kinetic and potential twice per cycle, at twice the oscillation frequency. That doubling matters when you are measuring vibration: an accelerometer spectrum shows the energy peak at 2f, not f.

QuantityExpressionAt amplitude A
Kinetic energy½mv²zero at the extremes
Potential energy½kx²maximum at the extremes
Total energy½kA²constant
Maximum velocityAωat the centre
Maximum accelerationAω²at the extremes

Where the model fails

Real springs have mass, so part of the kinetic energy is in the spring itself — the usual correction adds one third of the spring mass to the suspended mass. Damping removes energy, so the amplitude decays and the damped frequency is slightly lower.

Large deflections take the spring outside its linear range, and coil springs can surge internally at frequencies unrelated to the fundamental. At that point a single-degree-of-freedom model is no longer adequate.

Frequently asked questions

Does a heavier mass oscillate faster or slower?

Slower — period scales with √m. Doubling the mass multiplies the period by about 1.41, because more inertia has to be accelerated by the same spring force.

Why does the static deflection predict the period?

Because at equilibrium mg = kδ, so k/m = g/δ, giving T = 2π√(δ/g). Measure the sag and you have the period without knowing either k or m.

Is a pendulum simple harmonic?

Only for small angles, where sin θ ≈ θ. Beyond roughly 20° the period lengthens noticeably, and beyond 90° the motion is not sinusoidal at all.

What does damping do to the period?

It slightly lengthens it, and it makes the amplitude decay exponentially. Lightly damped systems are almost unaffected; near critical damping the concept of a period stops being useful.

BR

Written and reviewed by Bloom Rocket editorial desk

Bloom Rocket is built and maintained by a small independent team. Every page states the equations it implements and the standards it references, so the working can be checked rather than taken on trust.

How these simulators are built and checked →

Keep going

More science simulators

All Science →