Unknownpgr

Lagrangian Mechanics[1] - Calculus of Variations

2020-10-22 22:30:26 | English, Korean

This post was translated from Korean into English by AI.

I studied Lagrangian mechanics briefly a long time ago. I think it was probably when I was a high school senior, back when everything except studying for school exams was interesting, and I needed to do some complicated physics calculations for something. I do not remember exactly what I was trying to do, though. I think it may have been to simulate a double pendulum.

Anyway, I have occasion to use it again, so I would like to organize my notes on it this time.

Double Pendulum: Naver Blog

Calculus of Variations

Lagrangian mechanics uses a branch of mathematics called the calculus of variations, which extends ordinary calculus.

The calculus of variations deals with things called functionals. A functional is a function whose domain is a set of functions. Its codomain could, of course, also be any number of sets, but this post will cover only the case where the codomain is the real numbers. In other words, if the set of functions covered in this post is denoted by F\mathbb{F} and the set of real numbers by R\mathbb{R}, a functional here means a function J:FRJ:\mathbb{F}\rightarrow\mathbb{R}. The following is an example of a simple functional.

J[f]=01(f(t))2dtJ[f] = \int_0^1(f(t))^2dt

The functional JJ in the expression above takes some function ff as its argument (assuming that ff is a real-valued function) and returns a real number.

In calculus, given a function, we examine the relationship between an infinitesimal change in its argument and the corresponding infinitesimal change in the function's value. Likewise, the calculus of variations deals with the relationship between an infinitesimal change in its argument—a function—and the infinitesimal change (variation) in the functional. Cases that maximize or minimize a functional are particularly important. Such maximum or minimum values are called stationary values, and a function that makes a functional attain a maximum or minimum is called a stationary function or stationary point. For example, the functional above has the stationary value 00 only when f=0f=0, and f=0f=0 is its stationary point (or stationary function).

Euler–Lagrange Equation

There are, of course, countless important principles in the calculus of variations that I do not know, but the Lagrangian mechanics we will discuss is derived mainly from an important equation called the Euler–Lagrange equation.

The Euler–Lagrange equation is an equation used to find a stationary point of a functional SS of the following form for some function qq.

S(q)=abL(t,q(t),q(t))dtS(q)=\int_a^bL(t,q(t),q'(t))dt

Here, LL is an arbitrary three-variable function whose partial derivatives are all continuous. (It is an ordinary function, not a functional.) And, of course, qq must be differentiable. For example, if we assume that L(a,b,c)=a2+cL(a,b,c)=a^2+c, the expression above can be written as follows.

S(q)=abt2+q(t)dtS(q)=\int_a^bt^2+q'(t)dt

(In this case, it is not difficult to see that S(q)=q(b)q(a)+(b3a3)/3S(q)=q(b)-q(a)+(b^3-a^3)/3.)

If some stationary point of a functional SS of this form is q0q_0, then q0q_0 satisfies the following equation.

Lq0ddtLq0=0\frac{\partial L}{\partial q_0}-\frac{d}{dt}\frac{\partial L}{\partial q_0'}=0

This equation is called the Euler–Lagrange equation.

Fundamental Lemma of the Calculus of Variations

To prove the Euler–Lagrange equation, we first need to understand the fundamental lemma of the calculus of variations. The fundamental lemma of the calculus of variations states that if

In a way, this seems quite obvious. If integrating ff multiplied by anything always gives zero, then ff is zero.

Proof

I actually major in computer science, not mathematics, so I do not know much about the condition “compactly supported smooth.” From what I have found, however, it seems fine to regard this as meaning infinitely differentiable at every real number (continuous at every real number, with no divergent values).

Let us prove this by contradiction. That is, suppose there exists some remarkable ff such that abf(x)η(x)dx=0\int_a^bf(x)\eta(x)dx=0 for every η\eta, but for which at least one x0x_0 exists such that f(x0)0f(x_0)\not=0.

First, let us consider the case where f(x0)>0f(x_0)>0.

Since ff is continuous, by the definition of continuity there exists some interval [c,d][c,d] containing x0x_0 for which f(x)>0f(x)>0 for every x[c,d]x\in[c,d]. Of course, [c,d][a,b][c,d]\subset[a,b].

Now consider the following function.

η(x)=((xc)(xd))4 where x[c,d]η(x)=0 else\eta(x) = ((x-c)(x-d))^4 \text{ where }x\in[c,d]\\ \eta(x) = 0 \text{ else}

This is a compactly supported smooth function. Then,

abf(x)η(x)dx=acf(x)η(x)dx+cdf(x)η(x)dx+dbf(x)η(x)dx=cdf(x)η(x)dx\int_a^bf(x)\eta(x)dx\\ =\int_a^cf(x)\eta(x)dx+\int_c^df(x)\eta(x)dx+\int_d^bf(x)\eta(x)dx\\ =\int_c^df(x)\eta(x)dx

When we chose the interval [c,d][c,d], we chose it so that f>0f>0, and η>0\eta>0 as well. Therefore, cdf(x)η(x)dx>0\int_c^df(x)\eta(x)dx>0, and consequently abf(x)η(x)dx>0\int_a^bf(x)\eta(x)dx>0. But this contradicts our initial assumption that abf(x)η(x)dx=0\int_a^bf(x)\eta(x)dx=0. The assumption is therefore false, and no such ff exists.

The case where f(x0)<0f(x_0)<0 can be proved in the same way.

An Easier Proof (?)

Thinking about it, I believe that a considerable number of the functions dealt with in physics (especially mechanics) are compactly supported and smooth. So let us add one more constraint: suppose that ff is compactly supported and smooth.

In that case, setting η=f\eta=f gives η(x)f(x)=(f(x))20\eta(x)f(x)=(f(x))^2\geq0, so abf(x)η(x)dx0\int_a^bf(x)\eta(x)dx\geq0, and we can intuitively see that equality holds only when f=0f=0.

Proof of the Euler–Lagrange Equation

Before looking at a functional, let us first examine an ordinary function. In calculus, saying that a function of a vector f(x):RnRf(\bold{x}):\mathbb{R}^n\rightarrow\mathbb{R} has a local minimum (or maximum) at x0\bold{x}_0 meant that, for any x\bold{x}, if

limh0f(x0+hx)f(x0)h=df(x0+hx)dh=g(h)\lim_{h\rightarrow0}\frac{f(\bold{x}_0+h\bold{x})-f(\bold{x}_0)}{h}=\frac{df(\bold{x}_0+h\bold{x})}{dh}=g(h)

then g(0)=0g(0)=0. (We could in fact just write f(x0)=0f'(\bold{x}_0)=0, but I deliberately introduced a new function g(h)g(h) to put this into exactly the same form as the functional below.) In other words, we regarded a point as an extremum if an infinitesimal change in any direction around that point produced zero change.

We can think about a functional's stationary value in a similar way.

Let us look once again at the functional described above. (From this point on, several variables appear, including t,h,q,t,h,q, and η\eta. The first two are real numbers, while the latter two are functions. To avoid confusion as much as possible, when something is a function I have tried to indicate both that it is a function and what its argument is, as in q0(t)q_0(t).)

S(q)=abL(t,q(t),q(t))dtS(q)=\int_a^bL(t,q(t),q'(t))dt

If q0q_0 is a stationary point of the functional SS—that is, if it minimizes or maximizes SS—then for any differentiable function η\eta such that η(a)=η(b)=0\eta(a)=\eta(b)=0, it will satisfy the following (as in the case of a vector function).

Let limh0S(q0(t)+hη(t))S(q0(t))h=dS(q0(t)+hη(t))dh=g(h)Then, g(0)=0\text{Let }\lim_{h\rightarrow0}\frac{S(q_0(t)+h\eta(t))-S(q_0(t))}{h}=\frac{dS(q_0(t)+h\eta(t))}{dh}=g(h)\\ \text{Then, }g(0)=0

This means that even if we change the function q0q_0 infinitesimally by adding the very small function hηh\eta, the value of SS will barely change.

Now let us substitute the original expression back into SS and simplify it.

dS(q0+hη)dh=d(abL(t,q0(t)+hη(t),q0(t)+hη(t))dt)dh=abL(t,q0(t)+hη(t),q0(t)+hη(t))dhdt\frac{dS(q_0+h\eta)}{dh}\\ =\frac{d\left(\int_a^bL(t,q_0(t)+h\eta(t),q_0'(t)+h\eta'(t))dt\right)}{dh}\\ =\int_a^b\frac{L(t,q_0(t)+h\eta(t),q_0'(t)+h\eta'(t))}{dh}dt

The integrand looks complicated, but that is only because it contains so many symbols; it is nothing more than the total derivative of a multivariable function. Let us expand it.

L(t,q0(t)+hη,q0(t)+hη(t))dh=Ltth+L(q0(t)+hη(t))(q0(t)+hη(t))h+L(q0(t)+hη(t))(q0(t)+hη(t))h\frac{L(t,q_0(t)+h\eta,q_0'(t)+h\eta'(t))}{dh}\\ =\frac{\partial L}{\partial t}\frac{\partial t}{\partial h} +\frac{\partial L}{\partial (q_0(t)+h\eta(t))}\frac{\partial (q_0(t)+h\eta(t))}{\partial h} +\frac{\partial L}{\partial (q_0'(t)+h\eta'(t))}\frac{\partial(q_0'(t)+h\eta'(t))}{\partial h}

The expression has become even more complicated. There is a trick hidden here, however: when differentiating as in df(x)/dtdf(x)/dt, the result is zero if the variable of the function being differentiated and the variable with respect to which it is differentiated are different. For example, this applies to th\frac{\partial t}{\partial h} in the first term Ltth\frac{\partial L}{\partial t}\frac{\partial t}{\partial h}, so it becomes zero. Eliminating all the terms that become zero in this way gives the following relatively neat expression. (From this point on, there is little risk of confusing the arguments, so for readability I will omit the function argument (t)(t). However, because LL is an ordinary function rather than a functional, it can take only scalars as arguments. Please note, therefore, that we are passing function values as arguments, not the functions themselves.)

ηL(q0+hη)+ηL(q0+hη)\eta\frac{\partial L}{\partial (q_0+h\eta)} +\eta'\frac{\partial L}{\partial (q_0'+h\eta')}

Let us put this back inside the integral sign.

dS(q0+hη)dh=abηL(q0+hη)+ηL(q0+hη)dt=g(h)\frac{dS(q_0+h\eta)}{dh}=\int_a^b\eta\frac{\partial L}{\partial (q_0+h\eta)} +\eta'\frac{\partial L}{\partial (q_0'+h\eta')}dt=g(h)

Now let us return to our initial discussion.

If q0q_0 is a stationary point of the functional SS—that is, if it minimizes or maximizes SS—then for any differentiable function η\eta such that η(a)=η(b)=0\eta(a)=\eta(b)=0, it will satisfy the following.

Let limh0S(q0+hη)S(q0)h=dS(q0+hη)dh=g(h)Then, g(0)=0\text{Let }\lim_{h\rightarrow0}\frac{S(q_0+h\eta)-S(q_0)}{h}=\frac{dS(q_0+h\eta)}{dh}=g(h)\\ \text{Then, }g(0)=0

So let us set g(0)=0g(0)=0. We then obtain the following expression.

abηLq0+ηLq0dt=g(0)=0\int_a^b\eta\frac{\partial L}{\partial q_0} +\eta'\frac{\partial L}{\partial q_0'}dt=g(0)=0

To eliminate η\eta' here, let us integrate the second term by parts. The formula for integration by parts is as follows.

abg(t)f(t)dt=[g(t)f(t)]ababg(t)f(t)dt\int_a^b g(t)f'(t)dt=\left[g(t)f(t)\right]_a^b-\int_a^b g'(t)f(t)dt

Let us integrate by parts with η=f\eta=f and Lq0=g\frac{\partial L}{\partial q_0'}=g.

abη(t)Lq0+η(t)Lq0dt=abη(t)Lq0dt+[η(t)Lq0]ababη(t)ddtLq0dt=abη(t)Lq0η(t)ddtLq0dt+[η(t)Lq0]ab=ab[Lq0ddtLq0]η(t)dt+[η(t)Lq0]ab=0\int_a^b\eta(t)\frac{\partial L}{\partial q_0}+\eta'(t)\frac{\partial L}{\partial q_0'}dt\\ =\int_a^b\eta(t)\frac{\partial L}{\partial q_0}dt+\left[\eta(t)\frac{\partial L}{\partial q_0'}\right]_a^b-\int_a^b\eta(t)\frac{d}{dt}\frac{\partial L}{\partial q_0'}dt\\ =\int_a^b\eta(t)\frac{\partial L}{\partial q_0}-\eta(t)\frac{d}{dt}\frac{\partial L}{\partial q_0'}dt+\left[\eta(t)\frac{\partial L}{\partial q_0'}\right]_a^b\\ =\int_a^b\left[\frac{\partial L}{\partial q_0}-\frac{d}{dt}\frac{\partial L}{\partial q_0'}\right]\eta(t)dt+\left[\eta(t)\frac{\partial L}{\partial q_0'}\right]_a^b=0

But when we first defined η\eta, we said

...if it maximizes SS, then for any differentiable function η\eta such that η(a)=η(b)=0\eta(a)=\eta(b)=0...

Therefore, the second term becomes zero, and the expression simplifies as follows.

ab[Lq0ddtLq0]η(t)dt=0\int_a^b\left[\frac{\partial L}{\partial q_0}-\frac{d}{dt}\frac{\partial L}{\partial q_0'}\right]\eta(t)dt=0

It is now time to use the fundamental lemma of the calculus of variations that we proved earlier. η\eta is not a special function; it is an arbitrary differentiable function. According to the fundamental lemma of the calculus of variations, if the integral of a function multiplied by an arbitrary function is always zero, that function itself must be zero.

Lq0ddtLq0=0\frac{\partial L}{\partial q_0}-\frac{d}{dt}\frac{\partial L}{\partial q_0'}=0

From this, we obtain the Euler–Lagrange equation. If you scroll back to the section near the top where the Euler–Lagrange equation was introduced, you will see that it has exactly the same form.

References

Wikipedia

NamuWiki


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -