13.4.1.1 Calculus of variations

Lagrangian mechanics is based on the calculus of variations, which is the subject of optimization over a space of paths. One of the most famous variational problems involves constraining a particle to travel along a curve (imagine that the particle slides along a frictionless track). The problem is to find the curve for which the ball travels from one point to the other, starting at rest, and being accelerated only by gravity. The solution is a cycloid function called the Brachistochrone curve [841]. Before this problem is described further, recall the classical optimization problem from calculus in which the task is to find extremal values (minima and maxima) of a function. Let $ {{\tilde{x}}}$ denote a smooth function from $ {\mathbb{R}}$ to $ {\mathbb{R}}$, and let $ x(t)$ denote its value for any $ t \in {\mathbb{R}}$. From standard calculus, the extremal values of $ {{\tilde{x}}}$ are all $ t \in {\mathbb{R}}$ for which $ {\dot x}= 0$. Suppose that at some $ t' \in {\mathbb{R}}$, $ {\tilde{x}}$ achieves a local minimum. To serve as a local minimum, tiny perturbations of $ t'$ should result in larger function values. Thus, there exists some $ d > 0$ such that $ x(t' + \epsilon) > x(t')$ for any $ \epsilon \in [-d,d]$. Each $ \epsilon$ represents a possible perturbation of $ t'$.

Figure: The variation is a ``small'' function that is added to $ {{\tilde{x}}}$ to perturb it.
\begin{figure}\centerline{\psfig{file=figs/variation.eps,width=3.5in}}\end{figure}

The calculus of variations addresses a harder problem in which optimization occurs over a space of functions. For each function, a value is assigned by a criterion called a functional.13.10 A procedure analogous to taking the derivative of the function and setting it to zero will be performed. This will be arrived at by considering tiny perturbations of an entire function, as opposed to the $ \epsilon$ perturbations mentioned above. Each perturbation is itself a function, which is called a variation. For a function to minimize a functional, any small enough perturbation of it must yield a larger functional value. In the case of optimizing a function of one variable, there are only two directions for the perturbation: $ \pm
\epsilon$. See Figure 13.12. In the calculus of variations, there are many different ``directions'' because of the uncountably infinite number of ways to construct a small variation function that perturbs the original function (the set of all variations is an infinite-dimensional function space; recall Example 8.5).

Let $ {{\tilde{x}}}$ denote a smooth function from $ T = [t_0,t_1]$ into $ {\mathbb{R}}$. The functional is defined by integrating a function over the domain of $ {{\tilde{x}}}$. Let $ L$ be a smooth, real-valued function of three variables, $ a$, $ b$, and $ c$.13.11 The arguments of $ L$ may be any $ a,b
\in {\mathbb{R}}$ and $ c \in T$ to yield $ L(a,b,c)$, but each has a special interpretation. For some smooth function $ {{\tilde{x}}}$, $ L$ is used to evaluate it at a particular $ t \in T$ to obtain $ L(x,{\dot x},t)$. A functional $ \Phi $ is constructed using $ L$ to evaluate the whole function $ {{\tilde{x}}}$ as

$\displaystyle \Phi({{\tilde{x}}}) = \int_T L(x(t),{\dot x}(t),t) dt .$ (13.114)

The problem is to select an $ {{\tilde{x}}}$ that optimizes $ \Phi $. The approach is to take the derivative of $ \Phi $ and set it equal to zero, just as in standard calculus; however, differentiating $ \Phi $ with respect to $ {{\tilde{x}}}$ is not standard calculus. This usually requires special conditions on the class of possible functions (e.g., smoothness) and on the vector space of variations, which are implicitly assumed to hold for the problems considered in this section.

Example 13..9 (Shortest-Path Functional)   As an example of a functional, consider

$\displaystyle L(x,{\dot x},t) = \sqrt{1 + {\dot x}^2} .$ (13.115)

When evaluated on a function $ {{\tilde{x}}}$, this yields the arc length of the path. $ \blacksquare$

Another example of a functional has already been seen in the context of motion planning. The cost functional (8.39) assigns a cost to a path taken through the state space. This provided a natural way to formulate optimal path planning. A discrete, approximate version was given by (7.26).

Let $ h$ be a smooth function over $ T$, and let $ \epsilon \in {\mathbb{R}}$ be a small constant. Consider the function defined as $ x(t) + \epsilon
h(t)$ for all $ t \in [0,1]$. If $ \epsilon = 0$, then (13.114) remains the same. As $ \epsilon$ is increased or decreased, then $ \Phi({{\tilde{x}}}+ \epsilon h)$ may change. The function $ h$ is like the ``direction'' in a directional derivative. If for any smooth function $ h$, their exists some $ \epsilon > 0$ such that the value $ \Phi({{\tilde{x}}}+ \epsilon h)$ increases, then $ {{\tilde{x}}}$ is called an extremal of $ \Phi $. Any small perturbation to $ {{\tilde{x}}}$ causes the value of $ \Phi $ to increase. Therefore, $ {{\tilde{x}}}$ behaves like a local minimum in a standard optimization problem.

Let $ g = \epsilon h$ for some $ \epsilon > 0$ and function $ h$. The differential of a functional can be approximated as [39]

\begin{displaymath}\begin{split}\Phi({{\tilde{x}}}+ g) - \Phi({{\tilde{x}}}) & =...
...\dot x}} g \right)\Bigg\vert_{t_0}^{t_1} + \cdots , \end{split}\end{displaymath} (13.116)

in which $ \cdots$ represents higher order terms that will vanish in the limit. The last step follows from integration by parts:

$\displaystyle \left( \frac{\partial L}{\partial {\dot x}} g \right)\Bigg\vert_{...
...}} {\dot g}dt + \int_T \frac{d}{dt} \frac{\partial L}{\partial {\dot x}} h dt ,$ (13.117)

which is just $ uv = \int v du + \int u dv$. Consider the value of (13.116) as $ \epsilon$ becomes small, and assume that $ h(t_0) = h(t_1) = 0$. For $ {{\tilde{x}}}$ to be an extremal function, the change expressed in (13.116) should tend to zero as the variations approach zero. Based on further technical assumptions, including the Fundamental Lemma of the Calculus of Variations (see Section 12 of [39]), the Euler-Lagrange equation,

$\displaystyle \frac{d}{dt} \frac{\partial L}{\partial {\dot x}} - \frac{\partial L}{\partial x} = 0 ,$ (13.118)

is obtained as a necessary condition for $ {{\tilde{x}}}$ to be an extremum. Intuition can be gained by studying the last line of (13.116). The integral attains a zero value precisely when (13.118) is satisfied. The other terms vanish because $ h(t_0) = h(t_1) = 0$, and higher order terms disappear in the limit process.

The partial derivatives of $ L$ with respect to $ {\dot x}$ and $ x$ are defined using standard calculus. The derivative $ \partial L/\partial
{\dot x}$ is evaluated by treating $ {\dot x}$ as an ordinary variable (i.e., as $ \partial L/\partial b$ when the variables are named as in $ L(a,b,c)$). Following this, the derivative of $ \partial L/\partial
{\dot x}$ with respect to $ t$ is taken. To illustrate this process, consider the following example.

Example 13..10 (A Simple Variational Problem)   Let $ L$ be a functional defined as

$\displaystyle L(x,{\dot x},t) = x^3 + {\dot x}^2.$ (13.119)

The partial derivatives with respect to $ x$ and $ {\dot x}$ are

$\displaystyle \frac{\partial L}{\partial x} = 3 x^2$ (13.120)

and

$\displaystyle \frac{\partial L}{\partial {\dot x}} = 2 {\dot x}.$ (13.121)

Taking the time derivative of (13.121) yields

$\displaystyle \frac{d}{dt} \frac{\partial L}{\partial {\dot x}} = 2 {\ddot x}$ (13.122)

Substituting these into the Euler-Lagrange equation (13.118) yields

$\displaystyle \frac{d}{dt} \frac{\partial L}{\partial {\dot x}} - \frac{\partial L}{\partial x} = 2 {\ddot x}- 3x^2 = 0 .$ (13.123)

This represents a second-order differential constraint that constrains the acceleration as $ {\ddot x}= 3x^2/2$. By constructing a 2D phase space, the constraint could be expressed using first-order differential equations. $ \blacksquare$

Steven M LaValle 2020-08-14