Simple harmonic motion (SHM) describes the smooth, repeating back-and-forth motion of a mass on a spring, a swinging pendulum at small angles, or any system where the restoring force scales directly with displacement. This calculator models the classic mass-spring case, turning three physical inputs — mass, spring constant, and amplitude — into the full picture of how the system moves over time.
How the Simple Harmonic Motion Calculator works
The calculator starts from Newton's second law applied to a spring obeying Hooke's law, F = -kx. Solving that differential equation shows the mass oscillates with angular frequency ω = √(k/m), independent of how far it's pulled back. From ω, the period T = 2π/ω and frequency f = 1/T follow directly. Assuming the mass is released from rest at its maximum displacement, its position at any later time is x(t) = A·cos(ωt), with velocity and acceleration obtained by differentiating that expression once and twice respectively.
Inputs and what they mean
Mass (m) and spring constant (k) together set the timing of the oscillation — how fast it repeats — through ω = √(k/m). Amplitude (A) sets the scale of the motion — how far the mass travels — but has no effect on the period or frequency, a defining feature of simple harmonic motion. Time (t), used only on the Position/Velocity tab, lets you sample the motion at any instant to see exactly where the mass is and how it's moving.
Limits and edge cases
This model assumes an ideal, massless spring with no friction or air resistance, so the amplitude never decays — real systems lose energy and the motion is technically damped harmonic motion. It also assumes the mass is released from rest at maximum displacement (t = 0 at the amplitude extreme); if your system starts at a different point in its cycle, the position/velocity/acceleration values will be phase-shifted from what's shown here, though the period and frequency remain unchanged either way.