Lagrangian Mechanics and the Wonders They can Work on Your Lagrangian Car

Well, it’s a beautiful Sunday evening on Hawaii. There is a clear sky and the air is pleasantly warm. Anyway, for the second installment of antique mechanics, we turn to Lagrangian and Hamiltonian mechanics. The conversational choice for the hermit in spe.

Newtonian mechanics is all about solving equations of the form F = ma. That sounds easy, you probably think, and most people would agree with you: Newtonian mechanics just lacks that satisfying, elitist feel of being inaccessible to the common person. Cue Lagrangian mechanics. But first two quick asides on notation and energy.

Notation
As before x will denote position. We will imagine that we have N particles with positions x_1, \ldots, x_N and respective masses m_1, \ldots, m_N. We denote time derivatives with a cute dot on top and if f is a scalar function dependent on the positions, \frac{\partial f}{\partial x_i} denotes the gradient of f with respect to x_i. The letter “k” – even if appearing in the context of a word – will denote unconditional love beaming happily at you from the screen. Bear this in mind and reading this post will leave you sated with a warm, blissful feeling.

Energy

In many cases the force acting on the ith particle, F_i, can be expressed as the gradient \frac{\partial U}{\partial x_i} for some scalar function U = U(x_1, \ldots, x_N) called the potential energy. To make things nice a minus-sign is added. That is,

\quad F_i = - \frac{\partial U}{\partial x_i}.

If one were in a quiet moment to differentiate U with respect to time, one would find that

\quad \frac{dU}{dt} = \frac{\partial U}{\partial x_1}\dot{x}_1 + \cdots + \frac{\partial U}{\partial x_N} \dot{x}_N .

Replacing the derivatives of U with the corresponding forces, \frac{\partial U}{\partial x_i} = - F_i = - m_i \ddot{x}_i, we find

- \frac{dU}{dt} = m_1 \dot{x}_1 \ddot{x}_1 + \cdots + m_N \dot{x}_N \ddot{x}_N = \frac{d}{dt} \left( \frac{1}{2} m_1 \dot{x}_1^2 + \cdots + \frac{1}{2} m_N \dot{x}_N^2 \right).

So, defining the kinetic energy of the ith particle as T_i = \frac{1}{2} m_i \dot{x}_i^2 and the total kinetic energy, T, as the sum of the T_i‘s, T = \sum_i T_i, the total energy, defined as E = T+U, is consequently constant.

Lagrangian Mechanics

The usual way of showing that Lagrangian mechanics and Newtonian mechanics are equivalent feels very much like trying to prove that Paris and London are connected by road by driving a car all the way from Vladivostok to Paris, stopping for a quick cappucino, and then continuing on to London. I will break tradition by starting the car in Paris but I will show pictures from the Vladivostok-Paris trip afterwards.

We assume in the following we are dealing with a system where the force is given by a potential energy as in the discussion above.

Now, Newton’s 2nd law can be written F_i - m_i \ddot{x}_i = 0. Defining the Lagrangian L = T - U and noting that F_i = - \frac{\partial U}{\partial x_i} = \frac{\partial L}{\partial x_i} and that m_i \ddot{x}_i = \frac{d}{dt} \frac{\partial}{\partial \dot{x}_i} (\frac{1}{2} m_i \dot{x}_i^2) = \frac{d}{dt} \frac{\partial L}{\partial \dot{x}_i} , we see that Newton’s 2nd law can be rewritten as

\quad \frac{\partial L}{\partial x_i} - \frac{d}{dt} \frac{\partial L}{\partial \dot{x}_i} = 0, \quad \quad i =1, \ldots, N .

And that is the Euler-Lagrange equations that define Lagrangian mechanics (for a special choice of variables). A simple rewrite of Newton’s 2nd law, a fancy French name and sim-sa-la-bim it has the air of something that will separate you from the rabble. But it gets even better!

So what was this Vladivostok-Paris trip I was talking about? Well, imagine that instead of the coordinates x_1, \ldots, x_N (which is really 3N variables as each x_i is a vector) you wish to use some other variables q_1, \ldots, q_{3N}. As variables go, rather than using the positions, it is often easier to use angles, positions relative to other particles and whatnot to exploit symmetries and simplify expressions. If you do that it can be shown that the motion of the system is still described by the Euler-Lagrange equations of the following form:

\frac{\partial L}{\partial q_i} - \frac{d}{dt} \frac{\partial L}{\partial \dot{q}_i} = 0, \quad \quad i =1, \ldots, 3N .

This can be shown directly by mucking about with partial derivatives but there is a more elegant way in which the Euler-Lagrange equation is shown to have as solution the motion t \mapsto x(t) for which the functional t \mapsto \Phi(t) = \int_{t_0}^{t_1} L(x(t),\dot{x},t) dt is extremal (in a sense that a minimal regard for brevity stops me from going into). The important point to make here is that being “extremal” is independent of the variables chosen. And this independence of the choice of variables is exactly what the Vladivostok-Paris trip is about.

That the Euler-Lagrange equations describe the extremals of the functional \Phi is called Hamilton’s form of the principle of least action. I find this naming convention very sad because not only is it not true that every extremal is a minimum, it also misses out on a perfect opportunity of appealing to today’s students by giving it the more correct and far cooler name of “Hamilton’s principle of extreme action!!!”

Hamiltonian Mechanics

While impromptu soliloquies on Lagrangian mechanics is sure to impress everyone at your local pub, it will earn you little more than a speedy exit from a more upscale bar. For the discerning audience you will have to turn to Hamiltonian mechanics.

The obscurity – and thus that comforting, superior feeling of flying 1st class – of Hamiltonian mechanics relies on the application of the Legendre transformation. The Legendre transformation is basically reparametrizing a function f in terms of its slope. For a function f : \mathbb{R} \rightarrow \mathbb{R} with f'' > 0, the Legendre transformation of f is

F(p) = p x_p - f(x_p)

where x_p is the unique point satisfying f'(x_p) = p. A funny exercise (in the sense that it is funny to watch people struggling with notation trying to do it) is to show that using the Legendre transformation twice brings you back to the original function.

In the following I will assume that the Lagrangian only depends on one single variable q as well as it’s time derivative \dot{q} and the time t. That is, L = L(q, \dot{q}, t). Considering the Lagrangian as a function of \dot{q} we can apply the Legendre transformation to obtain a new function,

H(q,p,t) = p \dot{q}_p - L(q, \dot{q}_p,t)

where the relationship between p and \dot{q} is given by p = \frac{\partial L}{\partial \dot{q}}.

In Hamiltonian mechanics the motion of the system is given by the Hamiltonian equations:

\dot{p} = - \frac{\partial H}{\partial q} \quad \text{and} \quad \dot{q} = \frac{\partial H}{\partial p}.

Hamiltonian mechanics can be shown to be equivalent to Lagrangian mechanics and thus also to Newtonian mechanics simply by writing out the partial derivatives. You will not be surprised that I am not going to do that.

An important observation about the Hamiltonian is that if you were a bit careful in the choice of your variables, the Hamiltonian function H is simply the total energy of the system. Since energy is generally a known function of the system, it is easy to write down the Hamiltonian and get on with the fun of differentiating.

Comments I should have worked into the above but didn’t

  1. Lagrangian and Hamiltonian mechanics come about by rather simple rewrites of Newton’s 2nd law and so it is hardly to be expected that they bring very great revelations to the table. Within the framework of classical mechanics their main advantage lies in providing an easy way to solve problems. Anyone who has ever tried to find the motion of a system involving trolleys, balls and flying monkeys knows how tedious it can get writing all the forces, adding up, balancing out and then integrating. The Lagrangian and Hamiltonian functions are usually much simpler to write and the differential equations are only first order as compared to the 2nd order differential equation in the Newtonian case.
  2. Another – and arguably more important – advantage to Lagrangian and Hamiltonian mechanics is that they are easier to generalize to quantum mechanics for instance than Newtonian mechanics. Not really easy, but easier.
  3. Should you ever need it, you will be glad to know that Lagrangian mechanics provides an easy philosophical shutdown (I will trademark that term) of undergraduate physics students. Simply ask them what the physical interpretation of the Lagrangian and its being an extremal of the aforementioned functional \Phi really is. If the student has had just two beers, I guarantee that you will hear no more from him. It’s the equivalent of pointing out a logical error in the guiding principles of the killer robot you face guarding the door to the Evil Plans and Holding Your Girlfriend Hostage R Us Corporation (LLC) or shouting “DO YOU HAVE FREE WILL?” into the cafeteria at the institute of philosophy.

3 thoughts on “Lagrangian Mechanics and the Wonders They can Work on Your Lagrangian Car

  1. Bravo! I have always wanted to know a way to shut up pesky physics undergrad’s (and killer robots). I am only missing one important piece of the puzzle: where can I buy a Lagrangian car?

  2. In reality, what we stand to gain, and get rid of, is always acknowledged, and also
    is not transformed. We offer many versions about this investing formulation, using the “higher or even lower”, or perhaps Electronic solution currently being only the standard.
    In inclusion Are Binary Options A Scam offers excellent investment
    decision programs as observed on their adding web page which include substantial purchase
    bonuses, individually expert advice and many different benefits.

Leave a comment