Linearization of the pendulum