Different Methods of Classical Mechanics

We're seeing the differences in the Newtonian, Hamiltonian, and Lagrangian mechanics.

Keywords: classical mechanics, lagrangian, physics

By Carmen Cincotti Β 

Introduction

This week, I continued my studies on classical mechanics and how one can derive equations of motion. I ended up finding a pretty easy problem described below (this is an example found in No-Nonsense Classical Mechanics):

I’m on the Tower of Pisa and I drop a ball straight down. I would like to calculate the equation of motion describing the free fall of the ball towards the ground:

Drawing depicting the proposed physics problem

To find this, we can use three different methods. These methods are:

  • Newton’s method
  • The Lagrange method
  • Hamilton’s method

Newton’s method

We start with Newton’s second law:

F⃗=ma⃗=dp⃗dtp⃗=mv⃗\vec{F} = m\vec{a} = \dfrac{d\vec{p}}{dt} \\ \vec{p} = m\vec{v} \\

where F is the force (in 3D), a is the acceleration, p is the momentum, parameterized by t.

Knowing this law, we can rewrite the equation like so:

F⃗=d(mv⃗)dt=m(vxvyvz)ddt\vec{F} = \dfrac{d(m\vec{v})}{dt} = m\begin{pmatrix} v_{x} \\ v_{y} \\ v_{z} \end{pmatrix} \dfrac{d}{dt} \\

Neglecting wind resistance, and assuming the point where we drop the ball is the origin, we can see that the only driving force is gravity:

Fβƒ—=(00βˆ’mg)\vec{F} = \begin{pmatrix} 0 \\ 0 \\ -mg \end{pmatrix} \\

which is equivalent to:

∴d(mvβƒ—)dt=(00βˆ’mg)\therefore \frac{d(m\vec{v})}{dt} = \begin{pmatrix} 0 \\ 0 \\ -mg \end{pmatrix}

We can now solve the equation of motion:

∫0t(00βˆ’g)dt=∫0tddt(vxvyvz)dt∡∫abdfdtdt=f(b)βˆ’f(a)(00βˆ’gt)=(vx(t)vy(t)vz(t))βˆ’(vx(0)vy(0)vz(0))∫0t(00βˆ’gt)dt=∫0t((vx(t)vy(t)vz(t))βˆ’(vx(0)vy(0)vz(0)))dt(00βˆ’12gt2)=(xx(t)xy(t)xz(t))βˆ’(xx(0)xy(0)xz(0))βˆ’(vx(0)(t)vy(0)(t)vz(0)(t))+(vx(0)(0)vy(0)(0)vz(0)(0))∡InitialΒ conditions:Β v(0)=(000),x(0)=(000)∴(00βˆ’12gt2)=(xx(t)xy(t)xz(t))\int_0^t \begin{pmatrix} 0 \\ 0 \\ -g \end{pmatrix} dt = \int_0^t \dfrac{d}{dt} \begin{pmatrix} v_{x} \\ v_{y} \\ v_{z} \end{pmatrix} dt\newline \because \int_a^b \dfrac{df}{dt}dt = f(b) - f(a) \newline \begin{pmatrix} 0 \\ 0 \\ -gt \end{pmatrix} = \begin{pmatrix} v_{x}(t) \\ v_{y}(t) \\ v_{z}(t) \end{pmatrix} - \begin{pmatrix} v_{x}(0) \\ v_{y}(0) \\ v_{z}(0) \end{pmatrix} \newline \int_0^t \begin{pmatrix} 0 \\ 0 \\ -gt \end{pmatrix}dt = \int_0^t (\begin{pmatrix} v_{x}(t) \\ v_{y}(t) \\ v_{z}(t) \end{pmatrix} - \begin{pmatrix} v_{x}(0) \\ v_{y}(0) \\ v_{z}(0) \end{pmatrix}) dt \newline \begin{pmatrix} 0 \\ 0 \\ -\dfrac{1}{2}gt^2 \end{pmatrix} = \begin{pmatrix} x_{x}(t) \\ x_{y}(t) \\ x_{z}(t) \end{pmatrix} - \begin{pmatrix} x_{x}(0) \\ x_{y}(0) \\ x_{z}(0) \end{pmatrix} - \begin{pmatrix} v_{x}(0)(t) \\ v_{y}(0)(t) \\ v_{z}(0)(t) \end{pmatrix} + \begin{pmatrix} v_{x}(0)(0) \\ v_{y}(0)(0) \\ v_{z}(0)(0) \end{pmatrix} \newline \because Initial\ conditions:\ v(0) = \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}, x(0) = \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix} \\ \therefore \begin{pmatrix} 0 \\ 0 \\ -\dfrac{1}{2}gt^2 \end{pmatrix} = \begin{pmatrix} x_{x}(t) \\ x_{y}(t) \\ x_{z}(t) \end{pmatrix}

Well, after seeing that it is possible to solve this problem with Newton’s method, let’s move on to Lagrange’s method.

Lagrange’s method

In general, in Lagrangian mechanics, the Lagrangian is::

L(q,qΛ™)=T(qΛ™)βˆ’V(q)L(q, \dot{q}) = T(\dot{q}) - V(q) \\

where T is the kinetic energy, and V is the potential energy.

T=12mvβƒ—2Β andΒ V=mgz∴L=12m(vx2+vy2+vz2)βˆ’mgh T = \frac{1}{2}m\vec{v}^2\ and\ V = mgz \\ \therefore L = \frac{1}{2}m(v_x^2 + v_y^2 + v_z^2) - mgh \\

Recall that the Euler-Lagrange equation is as follows:

βˆ‚Lβˆ‚q=ddt(βˆ‚Lβˆ‚vq) \frac{\partial{L}}{\partial{q}} = \frac{d}{dt}(\frac{\partial{L}}{\partial{v_q}}) \\

So we just need to rewrite the Euler-Lagrange equation using our variables:

βˆ‚(12m(vx2+vy2+vz2))βˆ’mgzβˆ‚x=ddtβˆ‚(12m(vx2+vy2+vz2))βˆ’mgzβˆ‚vx \frac{\partial{(\frac{1}{2}m(v_x^2 + v_y^2 + v_z^2))} - mgz}{\partial{x}} = \frac{d}{dt}\frac{\partial{(\frac{1}{2}m(v_x^2 + v_y^2 + v_z^2))} - mgz}{\partial{v_x}} \\

After having solved the partial derivatives, we end here because we already derived the equation of motion above (under Newton’s method):

d(mvβƒ—)dt=(00βˆ’mg) \frac{d(m\vec{v})}{dt} = \begin{pmatrix} 0 \\ 0 \\ -mg \end{pmatrix}

Hamilton’s method

To use the Hamiltonian method, we must first calculate the generalized momenta using the Lagrangian:

L=12m(vx2+vy2+vz2)βˆ’mgz∡pq=βˆ‚Lβˆ‚vqpq=βˆ‚(12m(vx2+vy2+vz2))βˆ’mgzβˆ‚vqpx=mvxpy=mvypz=mvz∴vx=pxm∴vy=pym∴vz=pzm L = \frac{1}{2}m(v_x^2 + v_y^2 + v_z^2) - mgz \\ \because p_q = \frac{\partial{L}}{\partial{v_q}} \\ p_q = \frac{\partial{(\frac{1}{2}m(v_x^2 + v_y^2 + v_z^2))} - mgz}{\partial{v_q}} \\ p_x = mv_x \\ p_y = mv_y \\ p_z = mv_z \\ \therefore v_x = \frac{p_x}{m} \\ \therefore v_y = \frac{p_y}{m} \\ \therefore v_z = \frac{p_z}{m} \\

The Hamiltonian is described as:

H=pβƒ—β‹…qβƒ—Λ™βˆ’L H = \vec{p} \cdot \dot{\vec{q}} - L \\

Which means:

H=(pxpxm+pypym+pzpzm)βˆ’(12m((pxm)2+(pym)2+(pzm)2)βˆ’mgz)∴H=12(px2m+py2m+pz2m)+mgz H = (p_x\frac{p_x}{m} + p_y\frac{p_y}{m} + p_z\frac{p_z}{m}) - (\frac{1}{2}m((\frac{p_x}{m})^2 + (\frac{p_y}{m})^2 + (\frac{p_z}{m})^2) - mgz) \\ \therefore H = \frac{1}{2}(\frac{p_x^2}{m} + \frac{p_y^2}{m} + \frac{p_z^2}{m}) + mgz \\

The Hamilton equations are:

dpqdt=βˆ’βˆ‚Hβˆ‚qdqdt=βˆ‚Hβˆ‚pq \frac{dp_q}{dt} = -\frac{\partial{H}}{\partial{q}} \\ \frac{dq}{dt} = \frac{\partial{H}}{\partial{p_q}} \\

Therefore:

dpqdt=βˆ’βˆ‚Hβˆ‚q=βˆ’βˆ‚(12(px2m+py2m+pz2m)+mgz)βˆ‚q \frac{dp_q}{dt} = -\frac{\partial{H}}{\partial{q}} = -\frac{\partial{(\frac{1}{2}(\frac{p_x^2}{m} + \frac{p_y^2}{m} + \frac{p_z^2}{m}) + mgz)}}{\partial{q}} \\
(dpxdtdpydtdpzdt)=(00βˆ’mg)dqdt=βˆ‚Hβˆ‚pq=βˆ‚(12(px2m+py2m+pz2m)+mgz)βˆ‚pq(dxdtdydtdzdt)=(pxmpympzm) \begin{pmatrix} \frac{dp_x}{dt} \\ \frac{dp_y}{dt} \\ \frac{dp_z}{dt} \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ -mg \end{pmatrix} \\ \frac{dq}{dt} = \frac{\partial{H}}{\partial{p_q}} = \frac{\partial{(\frac{1}{2}(\frac{p_x^2}{m} + \frac{p_y^2}{m} + \frac{p_z^2}{m}) + mgz)}}{\partial{p_q}} \\ \begin{pmatrix} \frac{dx}{dt} \\ \frac{dy}{dt} \\ \frac{dz}{dt} \end{pmatrix} = \begin{pmatrix} \frac{p_x}{m} \\ \frac{p_y}{m} \\ \frac{p_z}{m} \end{pmatrix} \\

Finally:

∴(d(mdxdt)dtd(mdydt)dtd(mdzdt)dt)=d(mvβƒ—)dt=(00βˆ’mg) \therefore \begin{pmatrix} \frac{d(m\frac{dx}{dt})}{dt} \\ \frac{d(m\frac{dy}{dt})}{dt} \\ \frac{d(m\frac{dz}{dt})}{dt} \end{pmatrix} = \frac{d(m\vec{v})}{dt} = \begin{pmatrix} 0 \\ 0 \\ -mg \end{pmatrix}

To conclude, the three methods are able to find the equation of motion. But, as you can probably tell, each method has its pros and cons. For example, the Newtonian method requires knowledge of each force acting on the ball. On the other hand, the Hamiltonian is really too wordy and annoying to solve.

The next steps are to understand how to simulate constraints using the Lagrange multiplier.

Resources


Comments for Different Methods of Classical Mechanics



Written by Carmen Cincotti, computer graphics enthusiast, language learner, and improv actor currently living in San Francisco, CA. Β Follow @CarmenCincotti

Contribute

Interested in contributing to Carmen's Graphics Blog? Click here for details!