Sub topic 12
Energy exchange in SHM
This chapter assumes you know the SHM equation and the sinusoidal solution x(t) = A cos(ωt + φ) from earlier chapters. It also assumes you know kinetic energy ½mv², elastic potential energy, and the derivatives of sine and cosine. Here you use energy conservation to answer questions about speed and position without solving for time.
Total energy of a spring-mass oscillator
A mass m on an ideal spring of constant k has two kinds of energy:
- Kinetic energy: K = ½mv²
- Elastic potential energy: U = ½kx², where x is measured from equilibrium
With no friction, the total E = K + U is constant. At the turning points x = ±A the mass is momentarily at rest, so K = 0 and all the energy is potential:
E = ½kA²
At the equilibrium point x = 0 the spring is relaxed, so U = 0 and all the energy is kinetic: E = ½mv_max². Setting these equal gives
v_max = A√(k/m) = ωA
This matches the maximum of the velocity v = −ωA sin(ωt + φ) you get by differentiating x(t). The energy method reaches the same result without calculus.
Speed at any position
Write E = K + U and solve for v:
½mv² = ½kA² − ½kx²
v = ±√(k/m) · √(A² − x²) = ±ω√(A² − x²)
The speed is largest at x = 0 and falls to zero at x = ±A. The ± sign records that the mass passes each position moving in both directions. Energy gives the speed but not the direction. You need extra information, such as "moving toward the right", to choose the sign.
Worked example
Take k = 20 N/m, m = 0.5 kg, and A = 0.10 m. Then ω = √(20/0.5) = 6.325 rad/s.
- Total energy: E = ½(20)(0.10)² = 0.100 J
- Maximum speed: ωA = 0.6325 m/s
- Speed at x = 0.06 m: U = ½(20)(0.06)² = 0.036 J, so K = 0.064 J and v = √(2·0.064/0.5) = 0.506 m/s
The formula gives the same value: 6.325 × √(0.10² − 0.06²) = 6.325 × 0.08 = 0.506 m/s.
import math
k, m, A = 20.0, 0.5, 0.10
omega = math.sqrt(k / m)
E = 0.5 * k * A**2
print(f"E = {E:.4f} J")
for x in (0.0, 0.05, 0.06, 0.0707, 0.10):
U = 0.5 * k * x**2
K = max(E - U, 0.0)
v_energy = math.sqrt(2 * K / m)
v_formula = omega * math.sqrt(max(A**2 - x**2, 0.0))
print(f"x = {x:.4f} m U = {U:.4f} J K = {K:.4f} J "
f"v = {v_energy:.4f} m/s (formula {v_formula:.4f})")The two speed columns agree on every row. At x = 0.0707 m, which is A/√2, the kinetic and potential energies are equal at 0.05 J each.
Energy as a function of time
Substitute x = A cos(ωt + φ) and v = −ωA sin(ωt + φ), and use ω² = k/m:
- U(t) = ½kA² cos²(ωt + φ)
- K(t) = ½mω²A² sin²(ωt + φ) = ½kA² sin²(ωt + φ)
Because cos² + sin² = 1, the sum is always ½kA². Each energy oscillates between 0 and E. Each completes two full cycles per displacement cycle, so the energy oscillates at angular frequency 2ω. Over a full period each form of energy averages E/2, since the average of cos² or sin² is ½.
The curves cross at 0.5 at t = T/8, 3T/8, and so on. At those moments |x| = A/√2.
Energy versus position
Plotted against x, U = ½kx² is a parabola. The total energy E is a horizontal line that touches the parabola at x = ±A. The gap between the line and the parabola at any x is the kinetic energy there. The mass cannot reach |x| > A, because K would have to be negative. This "energy well" picture is useful beyond springs. Any system near a stable equilibrium has a potential minimum that looks like a parabola for small displacements.
Energy of a pendulum
For a pendulum of length L and mass m, take the lowest point as zero potential energy. At angle θ the bob is raised by L(1 − cos θ), so
U = mgL(1 − cos θ)
The kinetic energy is ½mv², with v = Lθ̇. If the bob is released from rest at θ₀, energy conservation gives the speed at the bottom exactly:
v_max = √(2gL(1 − cos θ₀))
For small angles, 1 − cos θ ≈ θ²/2, so U ≈ ½mgLθ². Written with arc length s = Lθ, this is U ≈ ½(mg/L)s². That has the form ½ks² with an effective constant k = mg/L, which is why the small-angle pendulum is SHM.
Example: L = 1.00 m and θ₀ = 10° (0.1745 rad).
- Exact: v_max = √(2 · 9.81 · 1.00 · 0.015192) = 0.5460 m/s
- SHM estimate: ωA = √(g/L) · Lθ₀ = 3.132 × 0.1745 = 0.5467 m/s
The two differ by about 0.1%. The mass of the bob cancels in both.
import math
g, L = 9.81, 1.0
theta0 = math.radians(10)
v_exact = math.sqrt(2 * g * L * (1 - math.cos(theta0)))
v_shm = math.sqrt(g / L) * L * theta0
print(f"exact v_max = {v_exact:.4f} m/s, SHM estimate = {v_shm:.4f} m/s")Checking energy conservation numerically
A simulation gives a direct test of energy conservation. The semi-implicit Euler method from the simulation chapter does not conserve energy exactly, but the energy error stays small and does not grow over time. The error is largest when dt is large relative to the period.
k, m = 20.0, 0.5
x, v = 0.10, 0.0
dt = 0.001
E0 = 0.5 * m * v**2 + 0.5 * k * x**2
worst = 0.0
for _ in range(5000): # 5 seconds
v += -(k / m) * x * dt
x += v * dt
E = 0.5 * m * v**2 + 0.5 * k * x**2
worst = max(worst, abs(E - E0) / E0)
print(f"largest relative energy error over 5 s: {worst:.2%}")The printed error should be well under 1%. Try dt = 0.05 and watch it grow.
Common errors
- Using x in place of A for total energy. E = ½kA² uses the amplitude, not the current displacement. ½kx² is only the potential part.
- Forgetting the square. E is proportional to A². Doubling the amplitude quadruples the energy and doubles the maximum speed.
- Expecting amplitude to change the period. It does not in SHM. A larger amplitude means more energy and more speed, not a longer period.
- Dropping the sign. Energy gives |v|. Pick the direction from the physical situation.
- Mixing up the two energy frequencies. x(t) repeats every T, but K(t) and U(t) repeat every T/2.
When energy is not conserved
Real oscillators lose mechanical energy to friction and air drag, so the amplitude shrinks and E = ½kA² decreases with it. A driving force can add energy. The damping and resonance chapter covers both. The energy picture tells you what to expect. Damping removes energy each cycle, and resonance occurs when the driver supplies energy at the same rate the system loses it.
Exercise
A 0.25 kg mass on a spring with k = 100 N/m oscillates with amplitude 0.08 m. Find (a) the total energy, (b) the maximum speed, and (c) the speed at x = 0.04 m.
Show answer
(a) E = ½kA² = ½(100)(0.08)² = 0.32 J. (b) v_max = A√(k/m) = 0.08 × √(100/0.25) = 0.08 × 20 = 1.6 m/s. (c) v = ω√(A² − x²) = 20 × √(0.0064 − 0.0016) = 20 × 0.0693 = 1.39 m/s. As a check, U = ½(100)(0.04)² = 0.08 J, so K = 0.24 J and v = √(2 × 0.24 / 0.25) = 1.39 m/s.
Exercise
The amplitude of a spring-mass oscillator is tripled with k and m unchanged. By what factors do the total energy, the maximum speed, and the period change?
Show answer
The energy is proportional to A², so it grows by a factor of 9. The maximum speed ωA is proportional to A, so it grows by a factor of 3. The period T = 2π√(m/k) does not depend on amplitude, so it does not change.
Exercise
At what displacement, as a fraction of A, are the kinetic and potential energies of a spring-mass oscillator equal?
Show answer
Setting U = E/2 gives ½kx² = ½(½kA²), so x² = A²/2 and x = ±A/√2 ≈ ±0.707A.