Harmonic Oscillator Energy Calculator

Inputs

Total mechanical energy1.00 J
Potential energy at x0.36 J
Kinetic energy at x0.64 J
Angular frequency20.00 rad/s
Period0.31 s
Maximum speed2.00 m/s
How this was calculated
  1. Inputs: mass 0.50 kg, spring constant 200 N/m, amplitude 0.10 m and displacement 0.06 m.
  2. Total energy: 1/2 x 200 x 0.10^2 = 1.00 J.
  3. At x = 0.06 m: potential energy 0.36 J, kinetic energy 0.64 J.
  4. Harmonic oscillator result: total energy 1.00 J with a period of 0.31 s.

A mass on a spring holds a fixed stock of mechanical energy and spends the whole cycle moving it between two accounts. Stretched or compressed, the spring holds potential energy; moving, the mass holds kinetic; and at any displacement x the split is already decided - potential energy is one half k x squared, kinetic is whatever of the total remains. The total itself is set once, by the amplitude: E = 0.5 x k x A^2. Give the calculator a displacement as well as the amplitude and it itemises the ledger at that exact point of the swing, alongside the angular frequency, the period and the peak speed.

Enter the mass, the spring constant, the amplitude and a displacement, and this calculator returns the total mechanical energy with the potential and kinetic energies at that displacement, the angular frequency, period and maximum speed. The worked examples cover a stiff bench oscillator, a heavy slow spring, and a light, fast one.

Worked examples

Half-kilo mass on a stiff spring

(0.5 kg · 200 N/m · 0.1 m · 0.06 m)

Total mechanical energy1.00 J
Potential energy at x0.36 J
Kinetic energy at x0.64 J
Angular frequency20.00 rad/s
Period0.31 s
Maximum speed2.00 m/s

Slow, large-amplitude oscillator

(2 kg · 50 N/m · 0.25 m · 0.1 m)

Total mechanical energy1.56 J
Potential energy at x0.25 J
Kinetic energy at x1.31 J
Angular frequency5.00 rad/s
Period1.26 s
Maximum speed1.25 m/s

Light mass, very stiff spring

(0.25 kg · 320 N/m · 0.05 m · 0.03 m)

Total mechanical energy0.40 J
Potential energy at x0.14 J
Kinetic energy at x0.26 J
Angular frequency35.78 rad/s
Period0.18 s
Maximum speed1.79 m/s

The ledger at a point in the swing

The first example is a bench-scale oscillator: mass 0.50 kg, spring constant 200 N/m, amplitude 0.10 m. Its total energy is 0.5 x 200 x 0.10^2 = 1.00 J, and that joule is the whole story's budget. Ask about the point x = 0.06 m - three-fifths of the way out - and the split is potential 0.36 J, kinetic 0.64 J. The proportions are no accident: potential energy grows with displacement squared, and three-fifths squared is 0.36, so at three-fifths of the amplitude the spring holds thirty-six hundredths of the energy and the mass keeps the rest as motion.

At the extremes the ledger is one-sided - all potential at full stretch, all kinetic at the centre - and the maximum speed records the kinetic account at its richest: 2.00 m/s, reached at the centre crossing, equal to the angular frequency times the amplitude. The angular frequency here is 20.00 rad/s and the period 0.31 s, so the full exchange of accounts happens twice in every third of a second, potential peaking at both ends of the swing and kinetic at both crossings.

Nothing in the total consults the mass. The 1.00 J was fixed by stiffness and amplitude alone; the mass decides only how fast the ledger turns over - through omega = sqrt(k / m) - and how the kinetic account translates into speed.

  • Total energy E = 0.5 x k x A^2; potential at displacement x is 0.5 x k x^2, kinetic is the remainder.
  • The potential share at any point is (x / A)^2 of the total - three-fifths out means 0.36 of the energy.
  • Maximum speed = omega x A, reached at the centre; omega = sqrt(k / m) sets the tempo.
  • Mass and stiffness set the period; amplitude alone sets the energy.

A heavy spring and a light one

The second example slows everything down: a 2 kg mass on a 50 N/m spring, amplitude 0.25 m. The total energy is 1.56 J - larger than the first example's despite the softer spring, because the amplitude is two and a half times greater and amplitude enters squared. At x = 0.10 m the split is potential 0.25 J and kinetic 1.31 J: only two-fifths of the way out, so only a small share has been banked in the spring. The angular frequency is 5.00 rad/s, the period 1.26 s and the peak speed 1.25 m/s - a stately oscillation, energy sloshing at walking pace.

The third example runs the other direction: a light 0.25 kg mass on a stiff 320 N/m spring with a small amplitude of 0.05 m. Total energy falls to 0.40 J, split at x = 0.03 m into potential 0.14 J and kinetic 0.26 J, but the tempo leaps - angular frequency 35.78 rad/s, period 0.18 s, peak speed 1.79 m/s. Stiffness divided by a small mass is a large ratio, and its square root is a fast clock.

Set the three side by side and the design levers separate cleanly. Energy answers to amplitude first and stiffness second; tempo answers to the stiffness-to-mass ratio; and the split at a chosen displacement answers to geometry alone - where in the swing you ask.

ExampleMass / k / amplitudeTotal energyPE / KE at xPeriod
Bench oscillator0.50 kg / 200 N/m / 0.10 m1.00 J0.36 J / 0.64 J0.31 s
Heavy spring2 kg / 50 N/m / 0.25 m1.56 J0.25 J / 1.31 J1.26 s
Light, stiff spring0.25 kg / 320 N/m / 0.05 m0.40 J0.14 J / 0.26 J0.18 s
The heavy spring holds the most energy, 1.56 J, and the slowest tempo, 1.26 s; the light spring holds the least, 0.40 J, and cycles in 0.18 s. Amplitude buys energy; the k-to-m ratio buys speed.

Worked examples

Example 1: Mass 0.5; Spring constant k 200; Amplitude 0.1; Displacement x 0.06. Total mechanical energy = 1.00 J. Supporting values: Potential energy at x 0.36 J; Kinetic energy at x 0.64 J; Angular frequency 20.00 rad/s; Period 0.31 s; Maximum speed 2.00 m/s. Inputs: mass 0.50 kg, spring constant 200 N/m, amplitude 0.10 m and displacement 0.06 m. Total energy: 1/2 x 200 x 0.10^2 = 1.00 J. At x = 0.06 m: potential energy 0.36 J, kinetic energy 0.64 J. Harmonic oscillator result: total energy 1.00 J with a period of 0.31 s.

Example 2: Mass 2; Spring constant k 50; Amplitude 0.25; Displacement x 0.1. Total mechanical energy = 1.56 J. Supporting values: Potential energy at x 0.25 J; Kinetic energy at x 1.31 J; Angular frequency 5.00 rad/s; Period 1.26 s; Maximum speed 1.25 m/s. Inputs: mass 2.00 kg, spring constant 50 N/m, amplitude 0.25 m and displacement 0.10 m. Total energy: 1/2 x 50 x 0.25^2 = 1.56 J. At x = 0.10 m: potential energy 0.25 J, kinetic energy 1.31 J. Harmonic oscillator result: total energy 1.56 J with a period of 1.26 s.

Example 3: Mass 0.25; Spring constant k 320; Amplitude 0.05; Displacement x 0.03. Total mechanical energy = 0.40 J. Supporting values: Potential energy at x 0.14 J; Kinetic energy at x 0.26 J; Angular frequency 35.78 rad/s; Period 0.18 s; Maximum speed 1.79 m/s. Inputs: mass 0.25 kg, spring constant 320 N/m, amplitude 0.05 m and displacement 0.03 m. Total energy: 1/2 x 320 x 0.05^2 = 0.40 J. At x = 0.03 m: potential energy 0.14 J, kinetic energy 0.26 J. Harmonic oscillator result: total energy 0.40 J with a period of 0.18 s.

Why the split follows (x / A) squared

The geometry of the split is worth one slow pass, because it explains the strobe-photo look of oscillation - the mass lingering at the extremes and flashing through the centre. Potential energy is quadratic in displacement, so the outer reaches of the swing are where the energy concentrates; the mass must slow as it climbs that quadratic hill, trading speed for stretch at an ever-steeper rate, until at the amplitude the account is entirely potential and the mass stops, turns, and falls back through the accounts in reverse.

The first example's numbers are the cleanest illustration the page owns: at 0.06 m of a 0.10 m amplitude, displacement ratio three-fifths, energy ratio 0.36 to 0.64. Ask at nine-tenths of the amplitude and the potential share would be eighty-one hundredths - the last stretch of travel is where nearly all the kinetic energy is surrendered, which is why oscillators appear to pause at their extremes. The pause is bookkeeping, not friction.

Averages, and what the peaks hide

Averaged over a full cycle, potential and kinetic energy are exactly equal - each averages half the total, a consequence of the virial theorem for a quadratic potential. The first example's joule therefore averages half a joule in each account, even though instantaneously the split runs from 1.00 J in one account to 1.00 J in the other. The calculator reports the instantaneous split at your chosen displacement because that is the question experiments ask - a photogate at a position measures a speed, and the kinetic energy there is the total minus the potential at that point.

The peak speed is the same bookkeeping at the centre: all 1.00 J kinetic in the first example means a peak of 2.00 m/s for its half-kilogram mass. In the heavy example, 1.56 J across 2 kg peaks at only 1.25 m/s - energy per unit mass, not energy alone, is what speed sees.

Beyond the ideal spring

The idealisations are worth naming. The spring is massless and perfectly Hookean - force proportional to displacement at every stretch; the motion is undamped, so the total the calculator returns is the total forever. Real springs add their own mass to the moving system, stiffen near their limits, and leak energy to friction and air, so a measured period drifts slightly long and a measured total decays. The ideal numbers here are the reference those measurements are compared against - the heavy example's 1.26 s period is the prediction a real 2 kg mass on a real 50 N/m spring should land close to, and the size of its miss is the diagnosis.

Where the model is exact, it is very widely exact: molecular bonds vibrate as springs with the same energy ledger at femtojoule scale, and the quantum harmonic oscillator's evenly spaced levels are spaced by the same omega this page computes classically. The bench oscillator is the smallest copy of a pattern physics reuses at every scale.

FAQs

What is the total energy of a 0.50 kg mass on a 200 N/m spring at 0.10 m amplitude?

1.00 J - one half times 200 times 0.10 squared. At a displacement of 0.06 m that joule splits into 0.36 J of potential energy and 0.64 J of kinetic, and the peak speed at the centre is 2.00 m/s.

Why is the potential energy at 0.06 m exactly 0.36 J?

Because the potential share is the squared displacement ratio. The point 0.06 m is three-fifths of the 0.10 m amplitude, and three-fifths squared is 0.36 - so 0.36 of the 1.00 J total sits in the spring there, leaving 0.64 J as kinetic energy.

How can the heavy example hold more energy on a softer spring?

Amplitude enters the total squared. The 2 kg example's spring is only 50 N/m, but its amplitude of 0.25 m is two and a half times the first example's, and that factor squared outweighs the softer spring: 1.56 J against 1.00 J - at a much slower period of 1.26 s.

What sets the period, if not the energy?

The ratio of stiffness to mass, through omega = sqrt(k / m). The light example pairs 320 N/m with 0.25 kg and cycles in 0.18 s at 35.78 rad/s; the heavy one pairs 50 N/m with 2 kg and takes 1.26 s. Amplitude changes the energy without touching the clock.

Where is the mass moving fastest, and how fast?

At the centre, where the kinetic account holds everything. The peak speeds are 2.00 m/s for the bench oscillator, 1.25 m/s for the heavy spring and 1.79 m/s for the light stiff one - each equal to omega times the amplitude.

What do the cycle averages of potential and kinetic energy come to?

Exactly half the total each - the virial theorem for a quadratic potential. The bench oscillator's 1.00 J averages half a joule in the spring and half in motion, even though the instantaneous split swings between the accounts completely, twice per cycle.

Sources

Related calculators

Simple Harmonic Motion Calculator
From amplitude and period to frequency, angular frequency, peak speed and peak acceleration of an oscillator.
Spring Potential Energy Calculator
Half kx²: the energy stored in a stretched or compressed spring, with the Hooke's-law force at that displacement alongside.
Pendulum Calculator
A pendulum's period and frequency from its length — or the length needed for a target period — on Earth, Mars or the Moon. The physics behind the grandfather clock.