14.4: Hamiltonian Mechanics Examples
- Page ID
- 7019
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)I’ll do two examples by hamiltonian methods – the simple harmonic oscillator and the soap slithering in a conical basin. Both are conservative systems, and we can write the hamiltonian as \( T+V\), but we need to remember that we are regarding the hamiltonian as a function of the generalized coordinates and momenta. Thus we shall generally write translational kinetic energy as \( \frac{p^{2}}{(2m)}\) rather than as \( \frac{1}{2}m\nu^{2}\), and rotational kinetic energy as \( \frac{L^{2}}{(2I)}\) rather than as \( \frac{1}{2}I\omega^{2}\)
Simple harmonic oscillator
The potential energy is \( \frac{1}{2}kx^{2}\), so the hamiltonian is
\[ H=\frac{p^{2}}{2m}+\frac{1}{2}kx^{2}. \nonumber \]
From equation D, we find that \( \dot{x}=\frac{p}{m}\), from which, by differentiation with respect to the time, \( \dot{p}=m\ddot{x}\). And from equation C, we find that \( \dot{p}=-kx\). Hence we obtain the equation of motion \( m\ddot{x}=-kx\).
Conical basin
We refer to Section 13.6:
\[ T=\frac{1}{2}m(\dot{r}^{2}+r^{2}\sin^{2}\alpha\dot{\phi}^{2}) \nonumber \]
\[ V=mgr\cos\alpha \nonumber \]
\[ L=\frac{1}{2}m(\dot{r}^{2}+r^{2}\sin^{2}\alpha\dot{\phi}^{2})-mgr\cos\alpha \nonumber \]
\[ L=\frac{1}{2}m(\dot{r}^{2}+r^{2}\sin^{2}\alpha\dot{\phi}^{2})+mgr\cos\alpha \nonumber \]
But, in the hamiltonian formulation, we have to write the hamiltonian in terms of the generalized momenta, and we need to know what they are. We can get them from the lagrangian and equation A applied to each coordinate in turn. Thus
\[ P_{r}=\frac{\partial L}{\partial \dot{r}}=m\dot{r} \label{14.4.1} \]
and
\[ P_{\phi}=\frac{\partial L}{\partial \dot{\phi}}=mr^{2}\sin^{2}\alpha\dot{\phi}. \label{14.4.2} \]
Thus the hamiltonian is
\[ H=\frac{P_{r}^{2}}{2m}+\frac{p_{\phi}^{2}}{2mr^{2}\sin^{2}\alpha}+mgr\cos\alpha. \label{14.4.3} \]
Now we can obtain the equations of motion by applying equation D in turn to \( r\) and \( \phi\) and then equation C in turn to \( r\) and \( \phi\):
\[ \dot{r}=\frac{\partial H}{\partial p_{r}}=\frac{p_{r}}{m}, \label{14.4.4} \]
\[ \dot{\phi}=\frac{\partial H}{\partial p_{\phi}}=\frac{p_{\phi}}{mr^{2}\sin^{2}\alpha}, \label{14.4.5} \]
\[ \dot{p}_{r}=-\frac{\partial H}{\partial r}=\frac{p_{\phi}^{2}}{mr^{3}\sin^{2}\alpha}-mg\cos\alpha, \label{14.4.6} \]
\[ \dot{p_{\phi}}=\frac{\partial H}{\partial\phi}=0. \label{14.4.7} \]
Equations \( \ref{14.4.2}\) and \( \ref{14.4.7}\) tell us that \( mr^{2}\sin^{2}\alpha\dot{\phi}\) is constant and therefore that
\[ r^{2}\dot{\phi} \quad is \quad constant, =h,\quad say. \label{14.4.8} \]
This is one of the equations that we arrived at from the lagrangian formulation, and it expresses constancy of angular momentum.
By differentiation of Equation \( \ref{14.4.1}\) with respect to time, we see that the left hand side of Equation \( \ref{14.4.6}\) is \( m\ddot{r}\). On the right hand side of Equation \( \ref{14.4.6}\), we have \( p_{\phi}\), which is constant and equal to \( mh\sin^{2}\alpha\). Equation \( \ref{14.4.6}\) therefore becomes
\[ \ddot{r}=\frac{h^{2}\sin^{2}\alpha}{r^{3}}- g \cos \alpha, \label{14.4.9} \]
which we also derived from the lagrangian formulation.