Energy Check
If energy only changes form, does the loop keep the books balanced?
Table of contents
Table of contents
The premise
With no friction, nothing takes energy out of the swing and nothing puts it in. The rod’s kinetic energy (from moving) plus its potential energy (from height) stays the same at every moment. The energy only changes form.
Follow it through one swing:
- At release, the rod is held at \(\theta_0 = 20^\circ\) and is not moving. All of its energy is potential.
- As it falls, it loses height and gains speed. Potential energy turns into kinetic energy.
- At the bottom, it is at its lowest and fastest. The energy is all kinetic.
- Up the other side, the kinetic energy turns back into potential, until the rod stops at \(-20^\circ\) and the trade runs the other way.
Three angles keep this straight, all measured from the vertical, just as in the model:
| Angle | What it is |
|---|---|
| \(0^\circ\) | the vertical reference: the rod hanging straight down, at home |
| \(\theta_0\) | the release angle, here \(20^\circ\) |
| \(\theta(t)\) | the running angle, where the rod is at time \(t\) |
To turn the premise into a check, we need a formula for each energy in terms of the angle \(\theta\) and the angular velocity \(\omega\).
Potential energy
Potential energy depends on height. Take a point on the rod at distance \(r\) from the pivot. When the rod sits at angle \(\theta\), that point is \(r\cos\theta\) below the pivot (the vertical part of its distance). At home, \(\theta = 0\), it is the full \(r\) below. So its height above its lowest position is
\[h = r - r\cos\theta = r\,(1 - \cos\theta)\]For the whole rod, one point stands in for all of it: the centre of mass, halfway down at \(L/2\). That is the same \(L/2\) that served as the lever arm on the torque page. Its rise is the rod’s rise:
\[PE = m g \,\frac{L}{2}\,(1 - \cos\theta)\]At home, \(\cos 0 = 1\), so the potential energy is zero. The further the rod swings out, the larger it gets.
Kinetic energy
Kinetic energy depends on speed, and different parts of the rod move at different speeds. The tip sweeps a big arc while the part near the pivot barely moves. So we cut the rod into the same thin slices as on the moment of inertia page.
A slice of mass \(dm\) at radius \(r\) travels along an arc of length \(s = r\theta\), so its speed is \(v = r\omega\). Like any small mass, it carries
\[dKE = \tfrac{1}{2}\,dm\,(r\omega)^2\]Every slice turns at the same \(\omega\), so adding up the slices lets \(\tfrac{1}{2}\omega^2\) come out of the sum:
\[KE = \tfrac{1}{2}\,\omega^2 \int_0^L r^2\, dm\]That integral is exactly the moment of inertia, \(I = \frac{mL^2}{3}\). So
\[KE = \tfrac{1}{2}\, I\, \omega^2\]The balance
The energy at any angle \(\theta\) equals the energy at release, where the rod was at rest at \(\theta_0\):
\[\tfrac{1}{2}\cdot\frac{mL^2}{3}\,\omega^2 + m g\,\frac{L}{2}\,(1 - \cos\theta) = m g\,\frac{L}{2}\,(1 - \cos\theta_0)\]Move the potential energy across and simplify:
\[\omega^2 = \frac{3g}{L}\left(\cos\theta - \cos\theta_0\right)\]The mass cancels, just as it did in the equation of motion.
This gives the rod’s speed at any angle directly. Two things are missing from it, on purpose:
- No small-angle swap. It uses the real \(\cos\theta\), so it holds at \(20^\circ\), or at \(90^\circ\), just as well.
- No time. It says how fast the rod moves at a given angle, not when it gets there.
That makes it a second, independent way to get the speed, and a sharp check on the loop.
Check 1: speed at the bottom
At the bottom, \(\theta = 0\) and \(\cos\theta = 1\). For the 0.3 m rod released from \(20^\circ\):
\[\omega = \sqrt{\frac{3g}{L}\left(1 - \cos 20^\circ\right)} = \sqrt{\frac{3 \times 9.81}{0.3}\,(1 - 0.9397)} = 2.4323 \ \text{rad/s}\]The loop from The Simulation, with \(\Delta t = 1\) ms, first crosses \(\theta = 0\) at \(t = 0.226\) s, moving at
\[|\omega| = 2.4323 \ \text{rad/s}\]| Speed at the bottom | |
|---|---|
| Energy balance | 2.4323 rad/s |
| Loop | 2.4323 rad/s |
They agree to four decimal places. The cosine on the Swing Time page only matched the loop to about 0.7%, because it treated \(20^\circ\) as a small angle. The energy balance makes no such swap, so nothing is left to separate it from the loop.
Check 2: the books over 5 s
The loop never uses energy. It only steps the angular acceleration forward, one snapshot at a time. So the energy is a fair outside auditor: take the loop’s \(\theta\) and \(\omega\) at every step, work out
\[E = \tfrac{1}{2} I \omega^2 + m g\,\frac{L}{2}\,(1 - \cos\theta)\]and see whether the total holds still. If the step errors were quietly inventing energy, the total would creep up. If they were leaking it, the total would creep down.
Kinetic and potential energy trade places twice every swing, each one full when the other is empty. The total, in pink, runs flat across the top.
Up close, the numbers for the 1 kg, 0.3 m rod over 5 s:
| Total energy | |
|---|---|
| At release | 0.0887 J |
| Lowest | 0.0884 J |
| Highest | 0.0891 J |
| After 5 s | 0.0886 J |
The total wobbles by about \(\pm 0.35\%\) within each swing, and the wobble does not build up. More than five swings later, the total is still inside the same narrow band it started in.
This is the semi-implicit Euler behaviour described on the Swing Time page: updating \(\omega\) first and then moving the angle with the new \(\omega\) gives a small wobble, but no drift. A loop with the steps in the other order would show the total climbing a little with every swing.
Math, not physics
The two checks look at the loop from two sides. Swing Time checked its timing. Energy checks its speed and its bookkeeping. The loop passes both.
But all of it is still math done on the model. It tells us the loop faithfully follows the equation, not that the equation describes the real rod. The real rod has friction in its bearings and air to push through, so its energy will slowly drain away, and how fast it drains is something only a measurement can tell us.
That test belongs to the rod itself, with the ESP32 reading the MT6835 encoder as it swings: Model vs Reality.