What this calculator does
In simple harmonic motion the total energy stays constant while continually trading between two forms. At the extremes of the swing everything is potential energy stored in the spring; passing through the middle it is all kinetic.
The total is set by the amplitude alone, at half the spring constant times amplitude squared. Where that energy sits at any instant depends on where the mass is in its cycle.
The formula
Position follows a cosine of angular frequency times time, and velocity its negative sine. Potential energy is half k x squared, kinetic energy is half m v squared, and the two always add to the same total.
| Term | Meaning |
|---|---|
| Total mechanical energy | Half the spring constant times the amplitude squared, constant throughout the motion. |
| Equilibrium | The rest position, where potential energy is zero and speed is greatest. |
| Phase | How far through the cycle the oscillation has progressed, set here by the time since passing equilibrium. |
The inputs explained
| Field | What to enter |
|---|---|
| Mass (kg) | The oscillating mass in kilograms. |
| Spring constant (N/m) | The spring constant in newtons per metre. |
| Amplitude (m) | The amplitude in metres, which alone determines the total energy. |
| Time since passing equilibrium (s) | Time in seconds since the mass passed through equilibrium. |
When to use it
Tracking the energy exchange
Evaluating at several times through a cycle shows the continuous trade between kinetic and potential energy.
Finding the speed at a given point
Energy conservation gives the speed at any displacement without needing to solve the motion equation.
Checking a physics problem
Most oscillation questions can be answered from energy conservation more quickly than from the equations of motion.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
How does energy shift between kinetic and potential through a cycle?
The same oscillation sampled at a range of times after passing equilibrium.
| Time since equilibrium | Kinetic energy | Potential energy |
|---|---|---|
| 0 s | 0 J | 0.025000 J |
| 0.1 s | 0.008736 J | 0.016264 J |
| 0.25 s | 0.024997 J | 0.00000267 J |
| 0.5 s | 0.00001070 J | 0.024989 J |
Questions
Where is the mass moving fastest?
At the equilibrium position, where the spring is neither stretched nor compressed. All the energy is kinetic there, so the speed is at its maximum.
Where is the acceleration greatest?
At the extremes of the swing, where displacement and therefore restoring force are largest. That is also where speed is momentarily zero, which is a point people often find counterintuitive.
Does the total energy change over time?
Not in this idealised model. In reality friction and air resistance drain it gradually, which is why a real oscillation decays and eventually stops.
How does amplitude affect the energy?
Energy depends on amplitude squared, so doubling the amplitude quadruples the energy. The period, however, does not change at all, which is the defining feature of simple harmonic motion.
For the period and frequency of the same system, see the mass-spring period calculator. For the spring constant itself, see the spring constant calculator.