Conservation of mechanical energy problem using pendulum