 us as we introduce new algorithms throughout this book.</p>

    <subsection id="energy_shaping"><h1>Energy-shaping control</h1>

      <p>In the specific case of the pendulum, we can give a satisfying
      hand-designed nonlinear controller based on our intuition of pumping
      energy into the system.  We have already observed that the total energy of
      the pendulum is given by $$E = \frac{1}{2} m l^2 \dot\theta^2 -
      mgl\cos\theta.$$  To understand how to control the energy, let us examine
   