Tag

Example: simple pendulum

The Hamiltonian for the simple pendulum is:

H=T+V=ml2θ˙22+mglsin⁡θ.\begin{align} H &= T + V \tag{1} \\ &= \dfrac{ml^2 \dot{\theta}^2}{2} + mgl\sin{\theta}. \tag{2} \end{align}

Problem is, however, that this is written in terms of qiq_i and q˙i\dot{q}_i not qiq_i and pip_i. First we need to determine what our canonical momentum is. Equations (??) yields:

pθ=∂L∂θ˙pθ=ml2θ˙.\begin{align} p_{\theta} &= \dfrac{\partial L}{\partial \dot{\theta}} \notag \\ p_{\theta} &= ml^2\dot{\theta}. \tag{3} \end{align}

Rewriting Equation (3) with θ˙\dot{\theta} as its subject:

θ˙=pθml2.\begin{align} \dot{\theta} &= \dfrac{p_{\theta}}{ml^2}. \tag{4} \end{align}

Substituting Equation (7) into Equation (2) yields:

H=ml22(pθml2)2+mglsin⁡θ=ml22pθ2m2l4+mglsin⁡θ.\begin{aligned} H &= \dfrac{ml^2}{2} \left( \dfrac{p_{\theta}}{ml^2} \right)^2 + mgl\sin{\theta} \\ &= \dfrac{ml^2}{2} \dfrac{p_{\theta}^2}{m^2l^4} + mgl\sin{\theta}. \end{aligned}

Cancelling out common factors in the numerator and denominator of the kinetic energy term yields:

H=pθ22ml2+mglsin⁡θ.\begin{align} H &= \dfrac{p_{\theta}^2}{2ml^2} + mgl\sin{\theta}. \tag{5} \end{align}

Hence the equations of motion are:

p˙θ=−∂H∂θ=−mglcos⁡θθ˙=∂H∂pθ=pθml2.\begin{align} \dot{p}_{\theta} &= -\dfrac{\partial H}{\partial \theta} \notag \\ &= - mgl\cos{\theta} \tag{6} \\ \dot{\theta} &= \dfrac{\partial H}{\partial p_{\theta}} \notag \\ &= \dfrac{p_{\theta}}{ml^2}. \tag{7} \end{align}

As we can see, Hamiltonian mechanics yields a series of first-order ordinary differential equations (ODEs) instead of second-order ODEs. Which is important because Lagrangian mechanics and Newtonian mechanics both yield second-order ODE systems. That being said, if you rewrite Equation (7) to make pθp_{\theta} its subject and substitute it into Equation (6) and rearrange it to make θ¨\ddot{\theta} the subject, you will obtain Equation (??).