working version of the single inverted pendulum to confirm dynamics