For an isolated mass-spring system, the total mechanical energy, kinetic energy, elastic potential energy and gravitational potential energy, remains constant
$E_e = E_g$
$E_e = E_k$
$E_e = E_k + E_g$
A perpetual motion machine is one that can operate forever without restarting or refuelling
Damped harmonic motion is periodic motion in which friction causes a decrease in the amplitude of motion and the total mechanism energy