Logo

MonoCalc

/

Simple Harmonic Motion Calculator

Physics

Describe the oscillator

A spring and mass, a small-angle pendulum, or a directly known timing value.
Load a realistic oscillator to see the magnitudes involved.
Stiffness of the spring. Must be greater than zero.
The oscillating mass. Must be greater than zero.
Maximum displacement from equilibrium. A negative entry is normalised with a 180° phase shift.
The phase at t = 0. Zero means the motion starts at a turning point.
The instant to evaluate. Negative values are allowed — the solution is defined for all t.
Decimal places, 0 to 10.
Dragging updates the displacement, velocity, acceleration and energy split together.

Timing

Angular frequency ω
20 rad/s
Period T
0.3142 s
Frequency f
3.1831 Hz
Amplitude does not appear here
Change the amplitude and every kinematic value moves, but ω, T and f stay exactly where they are. Quadruple the mass instead and the period doubles.

State at t = 0.05 s

Phase angle ωt + φ
1 rad

57.2958°

Displacement x
0.054 m

5.403 cm

Velocity v
-1.6829 m/s
Acceleration a
-21.6121 m/s²

-2.2038 g

v_max = Aω (at x = 0)
2 m/s
a_max = Aω² (at x = ±A)
40 m/s²
Total energy E = ½kA²
1 J

Cross-check: a = −ω²x = -21.6121 m/s², which is the acceleration above. That identity is the definition of simple harmonic motion.

The oscillator

equilibrium (x = 0)−A+A
x = A·cos(ωt + φ)radius = A, angular speed = ω

The phasor on the right rotates at ω on a circle of radius A. Its horizontal shadow is exactly x(t) — which is why φ is called a phase angle. The velocity arrow (solid) and the acceleration arrow (dashed colour) on the mass point in opposite senses whenever the mass is heading back toward equilibrium.

Displacement, velocity and acceleration

Between 1 and 10 periods.

Velocity leads displacement by a quarter cycle, and acceleration is the exact mirror of displacement. The zero crossings of x are the v_max points; the peaks of x are the a_max points. The dashed vertical marker is the instant you entered.

Energy

Kinetic KE = ½mv²
0.7081 J

70.81 % of total

Potential PE = ½kx²
0.2919 J

29.19 % of total

Total E
1 J

also ½m·v_max²

Both energies complete two full swings per oscillation — they run at twice the displacement frequency — while their sum is the flat line across the top. That flat line is conservation of energy, drawn.

Energy against displacement

Half the amplitude, a quarter of the energy
Potential energy is a parabola in x, so at x = A/2 it reaches only ¼ of the total and three quarters of the energy is still kinetic. The mass is travelling at about 87 % of its top speed there.

Query a displacement

May be negative. Must not exceed the amplitude.

Solve A and φ from initial conditions

Enter where the mass starts and how fast it is moving, and the amplitude and phase that define the whole motion fall out. Both may be negative.

Damped oscillation

Leave blank for the ideal undamped case. Zero or greater.
How far into the decay to sample the amplitude and energy.

Unit conversions

Period

s0.3142
ms314.1593
min0.0052

Frequency

Hz3.1831
rad/s20
rpm190.9859
°/s1,145.9156

Displacement at t

m0.054
cm5.403
mm54.0302
in2.1272
ft0.1773

Velocity at t

m/s-1.6829
km/h-6.0586
ft/s-5.5215
mph-3.7646

Acceleration at t

m/s²-21.6121
g-2.2038
ft/s²-70.9058

Total energy

J1
mJ1,000
kJ0.001
cal0.239
ft·lb0.7376
Where the ideal model stops
Everything here assumes a perfectly linear restoring force and, in pendulum mode, a small angle. Real springs stiffen or soften past their elastic limit, and driven systems near resonance need a forced-oscillation treatment this calculator does not cover.

About This Tool

Simple Harmonic Motion Calculator – Period, Kinematics and Energy

Simple harmonic motion is what happens whenever a system is pushed away from equilibrium and the force pushing it back is proportional to how far it has moved. Write that restoring force as F = −kx, feed it into Newton's second law, and you get mẍ = −kx — a differential equation whose solution is a pure sinusoid, x(t) = A·cos(ωt + φ). This calculator takes a description of the oscillator and returns the whole picture: its period, frequency and angular frequency, its displacement, velocity and acceleration at any instant, and how the total energy is split between kinetic and potential at any point in the swing.

The three timing numbers

For a mass on a spring the angular frequency is ω = √(k/m), the period is T = 2π√(m/k), and the frequency is f = 1/T = ω/2π. A 200 N/m spring carrying 0.5 kg gives ω = 20 rad/s exactly, a period of 0.31416 s, and a frequency of 3.1831 Hz. Notice what is missing from all three expressions: the amplitude. Pull the mass twice as far and it feels twice the restoring force, so it accelerates twice as hard over twice the distance and arrives back in exactly the same time. That property is called isochronism, and it is the reason pendulum clocks could keep time long before electronics existed.

Displacement, velocity and acceleration

Differentiating the solution twice gives v = −Aω·sin(ωt + φ) and a = −Aω²·cos(ωt + φ). The second of those collapses to a = −ω²x, which is the defining signature of SHM — the acceleration is always proportional to the displacement and always pointing the other way. The three curves are each a quarter-cycle apart: velocity peaks at v_max = Aω when the mass sweeps through equilibrium, and acceleration peaks at a_max = Aω² at the turning points, where the mass is momentarily stationary. They are never both at maximum together.

Where the energy goes

The total mechanical energy of an ideal oscillator is constant at E = ½kA², which is also ½m·v_max² — two independent routes to the same number. At any position the potential energy is ½kx² and the kinetic energy is the remainder. The squaring is what surprises people.

Half the amplitude is not half the energy
At x = A/2 the potential energy is ½k(A/2)² = ¼ × ½kA² — a quarter of the total, not a half. Three quarters remains kinetic, so the mass is still travelling at about 87 % of its top speed when it is halfway out.

Because both energies depend on squared quantities, each one rises and falls twice per cycle — at double the frequency of the displacement itself — while their sum traces a perfectly flat line. Watch the energy chart and the constant total is the clearest visual proof of conservation you will find.

Recovering amplitude and phase from a measurement

Real experiments rarely start neatly at a turning point. Given a starting displacement x₀ and a signed starting velocity v₀, the motion is fixed by A = √(x₀² + (v₀/ω)²) and φ = atan2(−v₀/ω, x₀). Using atan2 rather than a plain arctangent matters: it puts the phase in the correct quadrant and copes with x₀ = 0 without a special case. A mass released at 6 cm while moving at −1.6 m/s in a 20 rad/s system turns out to have a 10 cm amplitude and a phase of 0.9273 rad, or 53.13°.

Pendulums and the price of the small-angle approximation

A simple pendulum becomes SHM only once you replace sin θ with θ, giving ω = √(g/L) and T = 2π√(L/g). The mass of the bob cancels out entirely, which is why a heavy pendulum and a light one of the same length keep the same time. The approximation is not free, though: the first-order correction is T ≈ T₀(1 + θ₀²/16), so a 5° swing runs about 0.048 % slow and a 10° swing about 0.19 %. Because the error grows as θ₀², it climbs fast, and this calculator reports it live rather than hiding it.

Adding damping

Add a drag term and the amplitude decays inside an exponential envelope: x(t) = A₀·e^(−γt)·cos(ω_d t + φ) with γ = b/2m. The damped angular frequency ω_d = √(ω₀² − γ²) is always slightly lower than the undamped value. The damping ratio ζ = γ/ω₀ classifies the behaviour: below 1 the system rings, at exactly 1 it is critically damped and returns to rest in the shortest time without overshoot, and above 1 it creeps back. The quality factor Q = ω₀/2γ measures how long the ringing lasts, and because energy goes as amplitude squared, it decays at twice the amplitude rate: E(t) = E₀·e^(−2γt).

Where the ideal model stops
Everything here assumes a perfectly linear restoring force. Real springs stiffen or soften past their elastic limit, wide pendulum swings pick up an amplitude-dependent period, and driven systems near resonance need a forced-oscillation treatment that this calculator does not cover.

Between them these relations describe an enormous range of physical systems — car suspensions tuned to about 1 Hz, tuning forks at 440 Hz, seconds pendulums in clock cases, and atoms vibrating on their lattice bonds at terahertz rates. The arithmetic is identical in every case; only the numbers change.

Frequently Asked Questions

Is the Simple Harmonic Motion Calculator free?

Yes, Simple Harmonic Motion Calculator is totally free :)

Can I use the Simple Harmonic Motion Calculator offline?

Yes, you can install the webapp as PWA.

Is it safe to use Simple Harmonic Motion Calculator?

Yes, any data related to Simple Harmonic Motion Calculator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

How does this simple harmonic motion calculator work?

Describe the oscillator — a spring constant and mass, a pendulum length, or a directly known ω, T or f — then add an amplitude, a phase and the instant you want evaluated. The calculator converts everything to SI, finds ω = √(k/m), T = 2π√(m/k) and f = 1/T, and evaluates x = A·cos(ωt + φ) together with its two derivatives. It then reports the maximum speed and acceleration, the kinetic/potential energy split, a full unit-conversion strip, and a step-by-step derivation, with optional panels for damping and for solving A and φ from measured initial conditions.

Why doesn't the amplitude affect the period?

Because the restoring force grows in exact proportion to the displacement. Pull the mass twice as far and it feels twice the force, so it accelerates twice as hard over twice the distance — and arrives back in exactly the same time. That cancellation is what makes the motion isochronous, and it is why ω = √(k/m) contains no A. It is also a property of the ideal linear spring only: a real spring pushed past its elastic limit, or a pendulum swung wide, does start to show an amplitude-dependent period.

Why is the potential energy only a quarter of the total at half the amplitude?

Because elastic potential energy goes as the square of the displacement: PE = ½kx². At x = A/2 that gives ½k(A/2)² = ¼ × ½kA², so a quarter of the total, leaving three quarters as kinetic energy. The mass is therefore still moving at √3/2 ≈ 87 % of its top speed when it is halfway out. The same quadratic law means kinetic and potential energy each oscillate at twice the frequency of the displacement, while their sum stays perfectly constant.

How do I find the amplitude and phase from initial conditions?

Enter the starting displacement x₀ and the signed starting velocity v₀ and the calculator solves A = √(x₀² + (v₀/ω)²) and φ = atan2(−v₀/ω, x₀). Using atan2 rather than a plain arctangent matters, because it places the phase in the right quadrant and handles x₀ = 0 without a special case. The tool substitutes the solved values straight back into x(0) and v(0) so you can see both initial conditions reproduce exactly.

When does a pendulum stop being simple harmonic motion?

A pendulum is only SHM while sin θ ≈ θ, which is the small-angle approximation. The first-order correction to the period is T ≈ T₀(1 + θ₀²/16), so a 5° swing runs about 0.048 % slow relative to the ideal and a 10° swing about 0.19 %. Because the error grows with θ₀², it climbs quickly: past roughly 30° the SHM result should be treated as indicative only. The calculator shows this error live rather than hiding it.

What do the damping ratio and quality factor actually mean?

The damping rate γ = b/2m sets how fast the amplitude envelope A₀e^(−γt) decays, and the damping ratio ζ = γ/ω₀ compares that decay to the oscillation itself. Below ζ = 1 the system is underdamped and still rings; at exactly 1 it is critically damped and returns to rest in the shortest possible time without overshooting; above 1 it is overdamped and creeps back slowly. The quality factor Q = ω₀/2γ counts roughly how many radians of oscillation happen before the energy falls by a factor of e, so a high-Q system rings for a long time. Note that energy decays at twice the amplitude rate, since E ∝ A².