# Different Methods of Classical Mechanics

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

Keywords: classical mechanics, lagrangian, physics

## 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:

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

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

## Newton’s method

$\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:

$\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:

$\vec{F} = \begin{pmatrix} 0 \\ 0 \\ -mg \end{pmatrix} \\$

which is equivalent to:

$\therefore \frac{d(m\vec{v})}{dt} = \begin{pmatrix} 0 \\ 0 \\ -mg \end{pmatrix}$

We can now solve the equation of motion:

$\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, \dot{q}) = T(\dot{q}) - V(q) \\$

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

$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:

$\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:

$\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):

$\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 = \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 = \vec{p} \cdot \dot{\vec{q}} - L \\$

Which means:

$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:

$\frac{dp_q}{dt} = -\frac{\partial{H}}{\partial{q}} \\ \frac{dq}{dt} = \frac{\partial{H}}{\partial{p_q}} \\$

Therefore:

$\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}} \\$
$\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:

$\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.

## 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