Simple harmonic motion calculator
Enter the amplitude, frequency, phase angle and time, and get the displacement u(t), the velocity and the acceleration, together with the angular frequency and the period.
Fill in the fields; the answer appears here straight away.
How it's worked out
How it works
-
Enter the values
Type the numbers or the formula. Decimals may use a point or a comma. No idea? Click Fill in an example.
-
Instant answer
The answer appears as you type, with the most important intermediate values.
-
See the working
Under "How it's worked out" you see the steps, handy for checking your own calculation.
The formulas
For an oscillation u(t) = A · sin(2πf·t + φ):
- angular frequency ω = 2πf
- period T = 1/f
- velocity v(t) = Aω · cos(ωt + φ)
- acceleration a(t) = −Aω² · sin(ωt + φ)
The acceleration always points back towards the middle and is largest at the extremes, where the velocity is zero.
Examples
A mass on a spring, a pendulum with small swings, a tuning fork and alternating current all follow this motion. Enter the frequency in hertz and the time in seconds; the phase angle can be in radians or degrees.
The calculator's example
With A = 0.05 m, f = 2 Hz, φ = 0 and t = 0.1 s: ω = 2π × 2 ≈ 12.57 rad/s and T = 0.5 s. At t = 0.1 s the displacement is 0.05 × sin(1.2566) ≈ 0.0476 m, the velocity is ≈ 0.194 m/s and the acceleration ≈ −7.51 m/s². The negative sign means the acceleration points back towards the middle.
Frequency of a mass on a spring or a pendulum
- Spring: f = (1 ÷ 2π) × √(k ÷ m). A mass of 0.5 kg on a spring of 200 N/m has ω = √400 = 20 rad/s, so f ≈ 3.18 Hz.
- Pendulum (small swings): T = 2π × √(L ÷ g). A pendulum of 1 m takes about 2.01 s per swing back and forth, using g = 9.81 m/s².
Constants like g are in the physical constants table.
Damped oscillations
Real oscillations fade because of friction. Their amplitude shrinks exponentially, which you can model with the exponential decay calculator. The simple harmonic motion shown here is the idealised case with no damping.
Frequently asked questions
What is the phase angle for?
It sets where in the cycle the motion starts at t = 0. With φ = 0 the displacement starts at zero, and with φ = π/2 it starts at the maximum, because sin(π/2) = 1.
How do I find the frequency from the period?
f = 1 / T. A swing that takes 0.5 s per cycle has a frequency of 2 Hz.
What are the maximum velocity and acceleration?
The maximum speed is Aω, reached when passing the middle, and the maximum acceleration is Aω², reached at the extremes. For A = 0.05 m and f = 2 Hz, that is about 0.628 m/s and 7.90 m/s².
Which units do I use?
Any consistent set: with the amplitude in metres, the time in seconds and the frequency in hertz, the velocity is in m/s and the acceleration in m/s².