Block on a spring: energy conservation

Under 15Energy never disappears: it just changes form. A block held up high has stored energy from its height. As it falls, that turns into movement energy. When it squashes the spring, the energy gets stored in the spring, which then throws the block back up. Watch the coloured bars swap around while the total stays the same!
20+ · going deeperWhile in contact, the block obeys m ÿ = −k(y − L₀) − mg, simple harmonic motion with ω = √(k/m) about the shifted equilibrium y = L₀ − mg/k; the full bounce is SHM joined to free-flight parabolas. The simulation integrates with RK4 at a fine step, so the total energy drifts by well under 0.01%; a real spring would lose energy to internal friction.

Drop a block onto a spring. With only conservative forces (gravity and an ideal spring), the energy keeps moving between kinetic ½mv², gravitational mgy and spring ½kx², but the total never changes. Heights are measured from the ground; the spring is 1 m long when relaxed. Drag the block up or down to set the drop height.

Kinetic ½mv²
Gravitational mgy
Spring ½kx²
Total
Max compression