Potential energy of a pendulum problem