Simple Harmonic Motion Calculator
Work out position, velocity, acceleration and energy in simple harmonic motion. Solve x(t) = A cos(ωt + φ) at any time, find when a position is reached, get the amplitude and phase from a starting push, or follow a damped oscillation with its damping ratio and Q.
How to Use
- Pick a mode: the motion at a given time, the time to reach a position, the amplitude and phase from a starting position and velocity, or a damped oscillation.
- Enter the amplitude and the frequency. The frequency box takes hertz, rpm or rad/s, or a period in seconds: the unit you choose beside it says which.
- Add the phase φ if the motion does not start at the top of its swing (0° means it starts at x = +A), and a mass if you want the energy and spring constant.
- For damping, enter the damping ratio ζ: below 1 it rings down, 1 is critically damped, above 1 it creeps back.
- Read the results, the mass on its spring drawn where it is, and the displacement, velocity and acceleration plotted against time.
- Press a preset to load an example and check Show Work for every step.
Worked Example
A mass on a spring. 0.5 kg swinging 10 cm at 2 Hz, starting at the top (φ = 0). ω = 2π × 2 = 12.566 rad/s. At t = 0.1 s the phase is 1.2566 rad, so x = 0.1 × cos 1.2566 = 3.090 cm, v = −0.1 × 12.566 × sin 1.2566 = −1.195 m/s (heading back through the centre) and a = −ω²x = −4.880 m/s². The spring constant is k = mω² = 78.96 N/m and the energy ½kA² = 0.3948 J.
Amplitude from a push. Released at x₀ = 5 cm with v₀ = 0.6 m/s at 1.5 Hz (ω = 9.425 rad/s): A = √(x₀² + (v₀ ÷ ω)²) = √(0.05² + 0.06366²) = 8.095 cm, and φ = atan2(−v₀ ÷ ω, x₀) = −51.85°.
The common mistake: assuming steady speed. A swing with a 2 s period and 5 cm amplitude starts at the end. Half-way to the centre is half of a quarter-period, 0.25 s, only if the speed were constant. In fact cos(ωt) = 0.5 at ωt = 60°, so t = T ÷ 6 = 0.333 s: the mass starts from rest at the end and spends longer near it.
Show Work
Formulas
From Galileo’s Pendulum to the Q Factor
Galileo Galilei noticed in the early 1600s that a pendulum’s small swings take the same time whatever their size, the defining property of simple harmonic motion. Christiaan Huygens turned that into the pendulum clock in 1656 and in Horologium Oscillatorium (1673) showed that only a cycloidal path makes the period exactly independent of amplitude.
Robert Hooke published the law that makes a spring oscillate harmonically in 1678, “ut tensio, sic vis” (as the extension, so the force), after hiding it in an anagram two years earlier. A force proportional to displacement and pointing back to the centre, F = −kx, is exactly what gives a = −ω²x and the sine-wave motion on this page, with ω = √(k ÷ m).
Real oscillators lose energy. The quality factor Q, now used for everything from bridges to quartz crystals, was introduced around 1914 by the engineer K. S. Johnson at Western Electric for radio coils. Critical damping, ζ = 1, is the design target for instrument needles, door closers and vehicle shock absorbers, which are tuned somewhat below it for comfort.
About This Tool
This calculator works through simple harmonic motion four ways: the state at any moment, the time a given position is reached (with the next time as well), the amplitude and phase that follow from a starting position and push, and a damped oscillation released from rest, with its regime, Q, ringing frequency and settling time. One box takes the frequency in hertz or rpm, the angular frequency in rad/s, or the period, chosen by its unit. The mass is drawn on its spring at the moment you asked about, and displacement, velocity and acceleration are plotted against time so you can see each one lead the next by a quarter-cycle.
Everything runs in your browser; nothing you enter is sent anywhere.
Related tools: Pendulum Calculator, Spring (Hooke’s Law) Calculator, and Standing Waves & Harmonics Calculator.
Frequently Asked Questions
What is the equation for simple harmonic motion?
x(t) = A cos(ωt + φ), with ω = 2πf. Then v = −Aω sin(ωt + φ) and a = −ω²x. A mass swinging 10 cm at 2 Hz (ω = 12.566 rad/s) starting at the top is at x = 0.1 × cos(1.2566) = 3.090 cm after 0.1 s, moving at −1.195 m/s with an acceleration of −4.880 m/s².
What are the maximum speed and acceleration?
The speed peaks at v_max = Aω as the mass passes the centre, and the acceleration peaks at a_max = Aω² at the ends. For 10 cm at 2 Hz that is 1.257 m/s and 15.79 m/s² (1.61 g). A tuning fork tine moving 0.1 mm at 440 Hz reaches only 0.2765 m/s, but 764.3 m/s², about 78 g.
How long does it take to get from the end to half the amplitude?
One sixth of a period, not one eighth. From x = A, cos(ωt) = 0.5 when ωt = 60°, which is T ÷ 6. For a swing with a 2 s period that is 0.333 s; assuming steady speed would give 0.25 s, because the mass starts slowly at the end of its swing.
What do the damping ratio and Q factor mean?
ζ compares the damping with the amount that just stops oscillation (ζ = 1), and Q = 1 ÷ 2ζ. With ζ = 0.3 and a natural frequency of 1.2 Hz, Q = 1.667, each peak is 13.86% of the one before, the ringing is at 1.145 Hz and it settles within 2% in 1.75 s. A lightly damped ζ = 0.01 (Q = 50) keeps 93.9% of its swing each cycle.
How much energy is stored in an oscillator?
E = ½kA² = ½mω²A², constant if there is no damping, swapping between kinetic and potential energy. A 0.5 kg mass at 2 Hz needs k = mω² = 78.96 N/m; swinging 10 cm it holds 0.3948 J, and doubling the amplitude to 20 cm quadruples that to 1.579 J.
How do I use the Simple Harmonic Motion Calculator?
Just type your numbers. The answer shows up right away — there is no button to press. Change anything and it updates by itself.
Do I need to install or sign up for anything?
Not at all — it runs in the browser with nothing to install and no account. After it loads once, it even works without an internet connection.
Is my information private?
Yes. Everything happens in your browser. Nothing you type is sent to a server or saved anywhere.
Common Use Cases
Spring–mass homework
A 0.5 kg mass, 10 cm amplitude, 2 Hz: at t = 0.1 s it is at 3.09 cm moving at 1.195 m/s, with 0.357 J kinetic and 0.0377 J potential energy.
A push from a starting point
Released at 5 cm with a 0.6 m/s push at 1.5 Hz, a mass swings with amplitude √(0.05² + (0.6 ÷ 9.425)²) = 8.095 cm and phase −51.85°.
Car suspension
A 1.2 Hz suspension with ζ = 0.3 (illustrative) overshoots, then settles within 2% of rest in 1.75 s; a 400 kg corner needs a spring of 22,740 N/m.
Tuning forks and vibration
A 440 Hz tine with 0.1 mm amplitude accelerates at up to 764.3 m/s² (78 g), why small vibrations can loosen screws and crack solder.
Door closers and instruments
Critical damping (ζ = 1) at 1 Hz returns from 10 cm to within 2% in 0.93 s with no overshoot, the target for meter needles and door closers.
Last updated: