Hamilton's Equations

Hamilton's Equations

As discussed before, Hamiltonian is defined as $$H\equiv \sum_\alpha p_\alpha \dot{q}_\alpha -L$$ The total differential of the Lagrangian is $$dL=\sum_\alpha\left(\frac{\partial L}{\partial q_\alpha}dq_\alpha+\frac{\partial L}{\partial \dot{q}_\alpha}d\dot{q}_\alpha\right)+\frac{\partial L}{\partial t}dt.$$ The total differential of the Hamiltonian is $$dH = \sum_\alpha(\dot{q}_\alpha dp_\alpha + p_\alpha d\dot{q}_\alpha)-dL.$$ So, \begin{align} dH &= \sum_\alpha\left(\dot{q}_\alpha dp_\alpha + p_\alpha d\dot{q}_\alpha - \frac{\partial L}{\partial q_\alpha}dq_\alpha - \frac{\partial L}{\partial \dot{q}_\alpha}d\dot{q}_\alpha\right)-\frac{\partial L}{\partial t}dt \\ &= \sum_\alpha\left[\dot{q}_\alpha dp_\alpha + \left(p_\alpha - \frac{\partial L}{\partial \dot{q}_\alpha}\right)\right]-\frac{\partial L}{\partial t}dt \end{align} As the generalized momentum is defined as $$p_\alpha \equiv \frac{\partial L}{\partial \dot{q}_\alpha} \implies p_\alpha - \frac{\partial L}{\partial \dot{q}_\alpha}=0,$$ the total derivative of the Hamiltonian becomes $$dH = \sum_\alpha\left(\dot{q}_\alpha dp_\alpha - \frac{\partial L}{\partial q_\alpha}dq_\alpha\right)-\frac{\partial L}{\partial t}dt.$$ The total derivative of the Hamiltonian can also be expressed as $$dH = \sum_\alpha\left(\frac{\partial H}{\partial q_\alpha}dq_\alpha+\frac{\partial H}{\partial p_\alpha}dp_\alpha\right)+\frac{\partial H}{\partial t}dt.$$ Compare the terms, we have $$ \bbox[5px,border:2px solid #666] { \dot{q}_\alpha = \frac{\partial H}{\partial p_\alpha}\\ \dot{p}_\alpha = \frac{\partial L}{\partial q_\alpha}=-\frac{\partial H}{\partial q_\alpha}\\ \frac{\partial H}{\partial t} = -\frac{\partial L}{\partial t} } $$ These equations are called Hamilton's equations, or canonical equations.

Example

Find the equations of motion of a spherical pendulum of mass \(m\) and length \(l\).

Solution: The kinetic energy is $$T=\frac{1}{2}ml^2\dot{\theta}^2+\frac{1}{2}ml^2\sin^2\theta\dot{\phi}^2.$$ The potential energy is $$U=-mgl\cos\theta.$$ The Lagrangian is $$L = \frac{1}{2}ml^2\dot{\theta}^2+\frac{1}{2}ml^2\sin^2\theta\dot{\phi}^2 + mgl\cos\theta $$ The generalized momenta are \begin{align} p_{\theta} &= \frac{\partial L}{\partial \dot{\theta}} = ml^2\dot{\theta} \\ p_{\phi} &= \frac{\partial L}{\partial \dot{\phi}} = ml^2\sin^2\theta\dot{\phi}. \end{align} The Hamiltonian is \begin{align} H &= T + U \\ &= \frac{1}{2}ml^2\frac{p_{\theta}^2}{m^2l^4} + \frac{1}{2}\frac{ml^2\sin^2\theta p^2_{\phi}}{m^2l^4\sin^4\theta} - mgl\cos\theta \\ &= \frac{p^2_{\theta}}{2ml^2} + \frac{p^2_{\phi}}{2ml^2\sin^2\theta} - mgl\cos\theta. \end{align} The Hamilton's equations are \begin{align} \dot{\theta} &= \frac{\partial H}{\partial p_{\theta}} = \frac{p_{\theta}}{ml^2} \\ \dot{\phi} &= \frac{\partial H}{\partial p_{\phi}} = \frac{1}{ml^2\sin^2\theta}p_{\phi} \\ \dot{p}_{\theta} &= - \frac{\partial H}{\partial \theta} = \frac{p^2_{\phi}\cos\theta}{ml^2\sin^3\theta} - mgl\sin\theta\\ \dot{p}_{\phi} &= - \frac{\partial H}{\partial \phi} = 0 \end{align}

Checkpoint (Marion, Thornton Q7.29)

A pendulum consists of a mass \(m\) and a massless spring with unextended length \(b\) and force constant \(k\). The pendulum's point of support is rising vertically at a constant acceleration \(a\). Find the Hamilton's equations.

The coordinates are \begin{align} x &= l\sin\theta \\ y &=\frac{1}{2}at^2 - l\cos\theta. \end{align} So, the velocity components are \begin{align} \dot{x} &= \dot{l}\sin\theta + l\dot{\theta}\cos\theta \\ \dot{y} &= at - \dot{l} \cos\theta + l\dot{\theta}\sin\theta. \end{align} The kinetic energy is $$T = \frac{1}{2}m(\dot{x}^2+\dot{y}^2).$$ The potential energy is $$U = mgy + \frac{1}{2}k(l-b)^2.$$ The Lagrangian is \begin{align} L &= T - U \\ &= \frac{1}{2}m[\dot{l}^2+l^2\dot{\theta}^2+a^2t^2+2at(l\dot{\theta}\sin\theta-\dot{l}\cos\theta)]\\ &+mg\left(l\cos\theta-\frac{1}{2}at^2\right) - \frac{k}{2}(l-b)^2. \end{align} The generalized momenta are \begin{align} p_l &= \frac{\partial L}{\partial \dot{l}}=m\dot{l} - mat\cos\theta\\ p_{\theta} &= \frac{\partial L}{\partial \dot{\theta}} = ml^2\dot{\theta} + matl\sin\theta. \end{align} Invert the generalized momenta, we have \begin{align} \dot{l} &= \frac{p_l}{m} + at\cos\theta \\ \dot{\theta} &= \frac{p_{\theta}}{ml^2} - \frac{at\sin\theta}{l}. \end{align} The Hamiltonian is \begin{align} H &= \sum{p_i\dot{q}_i}-L \\ &= p_l\dot{l}+p_{\theta}\dot{\theta}-L\\ &= \frac{p^2_l}{2m}+\frac{p^2_\theta}{2ml^2}-\frac{at}{l}p_{\theta}\sin\theta+atp_l\cos\theta\\ &+\frac{1}{2}k(l-b)^2+\frac{1}{2}mgat^2-mgl\cos\theta. \end{align} The Hamilton's equations are \begin{align} \dot{p}_{l} + \frac{at}{l^2}p_{\theta}\sin\theta+k(l-b)-mg\cos\theta+\frac{p^2_{\theta}}{ml^3} &=0\\ \dot{p}_{\theta}-\frac{at}{l}p_{\theta}\cos\theta-atp_l\sin\theta+mgl\sin\theta &= 0 \end{align}

Time derivative of Hamiltonian

From the Hamilton's equations, we know that $$\frac{\partial H}{\partial t} = -\frac{\partial L}{\partial t}.$$ From the definition of the Hamiltonian, $$\frac{dH}{dt} = -\frac{\partial L}{\partial t}.$$ That means $$\frac{\partial H}{\partial t} = \frac{dH}{dt}.$$ Analyze the total time derivative of Hamiltonian, \begin{align} \frac{dH}{dt}&=\sum_\alpha\left(\frac{\partial H}{\partial q_\alpha}\dot{q}_\alpha + \frac{\partial H}{\partial p_\alpha}\right)+\frac{\partial H}{\partial t}\\ &= \sum_\alpha\left[\frac{\partial H}{\partial q_\alpha}\left(\frac{\partial H}{\partial p_\alpha}\right)+\frac{\partial H}{\partial p_\alpha}\left(-\frac{\partial H}{\partial q_\alpha}\right)\right]+\frac{\partial H}{\partial t}\\ &= \frac{\partial H}{\partial t}. \end{align}

Legendre Tranformation

Suppose a function \(f(x,y)\) is known. Define a new function with new variable \(x,p\), $$g(x,y,p)\equiv py-f(x,y)$$ The total differential of \(g(x,y,p)\) is \begin{align} dg &= pdy + ydp - \frac{\partial f}{\partial x}dx - \frac{\partial f}{\partial y}dy\\ &= \left(p-\frac{\partial f}{\partial y}\right)dy + ydp - \frac{\partial f}{\partial x}dx. \end{align} Define $$p = p(x,y) \equiv \frac{\partial f}{\partial y}$$ such that $$dg = ydp - \frac{\partial f}{\partial x}dx.$$ As the total differential of \(g\) is $$dg = \frac{\partial g}{\partial x}dx + \frac{\partial g}{\partial p}dp,$$ we have $$\frac{\partial g}{\partial p}=y$$ and $$\frac{\partial g}{\partial x}=-\frac{\partial f}{\partial x}.$$ We can use these kind of transformation to get back \(f\) if \(g\) is given or \(g\) if \(f\) is give. That is to say, we can use Legendre transformation to obtain Lagrangian if Hamiltonian is given, or obtain Hamiltonian if Lagrangian is given.

Example

Given a function $$L(x,y)\equiv \frac{1}{2}my^2-V(x).$$ Apply Legendre transformation to generate a new function. Show that apply the Legendre transformation again will obtain the original function.

Solution: $$p\equiv \frac{\partial L}{\partial y}=my$$ Then, $$y=\frac{p}{m}.$$ A new function is defined as $$H(x,p)\equiv py-L=\frac{p^2}{2m}+V(x).$$ To get back to original function, define $$y\equiv\frac{\partial H}{\partial p}=\frac{p}{m}.$$ Then, $$p=my.$$ A new function is defined as \begin{align} L_{\text{new}}(x,y)&\equiv yp - H\\ &= \frac{1}{2}my^2-V(x)\\ &= L(x,y), \end{align} which is equivalent to the original function \(L(x,y)\).

Comments

Popular Posts