<<

1 of Variations

Namrata Vaswani, [email protected]

These notes are still under preparation. Please email me if you find any mistakes and typos. These notes are based on Chapter 1 of [1] and some web sources. Consider the problem of minimizing an energy E(u) which is an of a of an unknown function u(x) and its w.r.t. x. u and its derivatives are only known at the boundaries of the integration domain. is used to find the of a functional (here E(u)) w.r.t. a function (here u(x)), which we denote by ∇uE. Setting ∇uE = 0 gives the Euler-Lagrange equation and this is a necessary condition for the minimizing function to satisfy. In some cases the Euler-Lagrange can be solved directly in closed form. For other cases one uses numerical techniques for gradient descent, which gives rise to a Partial (PDE). In effect, Calculus of Variations extends to enable us to evaluate derivatives of functionals.

A. Evaluating ∇uE

I explain here the simplest case: how to evaluate ∇uE when E can be written as a definite integral ∂u of u and its first partial ux , ∂x and x is a , i.e. Z b E(u) = L(u, ux)dx (1) a and u(a) and u(b) are known (fixed), while u(x), x ∈ (a, b) is . Here L(u, ux) is referred to as the Lagrangian.

1) Defining ∇uE: From vector calculus (if u were a vector u = [u1, u2, ..un]), then the in a direction α is ∂E E(u + ²α) − E(u) = lim = ∇uE · α (2) ∂α ²→0 ² where the expands as Xn ∇uE · α = (∇uE)iαi (3) i=1 2

One way to evaluate ∇uE is to write out a first order Taylor expansion of E(u + ²α) and define

(∇uE)i by comparison as the term multiplying αi. We use this same methodology for calculus of variations, but now u is a of a R 2 b 2 variable x and α is also a continuous function of x with unit (||α|| = a α(x) dx = 1). The dot product is now defined as

Z b ∇uE · α = (∇uE)(x)α(x)dx. (4) a The boundary conditions, u(a) and u(b) are fixed and so α(a) = α(b) = 0. 2) The solution method: Expand E(u + ²α) using first order as

Z b E(u + ²α) ≈ E(u) + ²∇uE · α = E(u) + ² (∇uE)(x)α(x)dx (5) a and (∇uE)(x) is the term multiplying α(x) in this expansion. Applying this to (1), we get

Z b E(u + ²α) = L(u + ²α, ux + ²αx)dx a Z Z Z b b ∂L b ∂L ≈ L(u, ux)dx + ² ( )(x)α(x)dx + ² ( )(x)αx(x)dx a a ∂u a ∂ux

= E(u) + ²(T1 + T2) (6)

R b ∂L Now T1 is already in the form of a dot product with α. We need to bring T2 = αxdx also in this a ∂ux form. We do this using . Recall that

Z b Z b f(x)gx(x)dx = f(b)g(b) − f(a)g(a) − fx(x)g(x)dx (7) a a ∂L We apply this to T2 with f = , g = α and α(a) = α(b) = 0, so that the first two terms of (7) vanish. ∂ux Z Z b ∂L ∂L ∂L b ∂ ∂L T2 = αxdx = ( )(b)α(b) − ( (a))α(a) − αdx a ∂ux ∂ux ∂ux a ∂x ∂ux Z b ∂ ∂L = 0 − 0 − αdx (8) a ∂x ∂ux Thus combining (6) with (8), we get Z b ∂L ∂ ∂L E(u + ²α) = E(u) + ² [( ) − ]αdx (9) a ∂u ∂x ∂ux and thus by comparison with (5), we have

∂L ∂ ∂L (∇uE)(x) = [( ) − ](x) (10) ∂u ∂x ∂ux 3

Thus the Euler Lagrange equation (necessary condition for a minimizer) is ∂L ∂ ∂L [( ) − ] = 0 (11) ∂u ∂x ∂ux This can be either solved directly or using gradient descent. When using gradient descent to find the minimizing u, we get a PDE with an artificial time variable t as ∂u ∂L ∂ ∂L = −(∇uE) = −[( ) − ] (12) ∂t ∂u ∂x ∂ux

B. Extensions

The solution methodology can be easily extended to cases where (i) u is a function of multiple T variables, i.e. x is a vector (x = [x1, x2, ..xk] ) or (ii) when u itself is a vector of functions, i.e. u(x) = T [u1(x), u2(x)...um(x)] or (iii) when E depends on higher order derivatives of u. Please UNDERSTAND the basic idea in the above derivation carefully, some of these extensions may be Exam questions. Exercise: Show that if u = u(x, y) i.e. u is a function of two scalar variables x and y, then ∂L ∂ ∂L ∂ ∂L (∇uE) = ( ) − − (13) ∂u ∂x ∂ux ∂y ∂uy A trivial extension of this shows that if E is a function of two functions u(x, y) and v(x, y), then the Euler-Lagrange equation is given by ∂L ∂ ∂L ∂ ∂L (∇uE) = ( ) − − = 0 ∂u ∂x ∂ux ∂y ∂uy ∂L ∂ ∂L ∂ ∂L (∇vE) = ( ) − − = 0 ∂v ∂x ∂vx ∂y ∂vy (14)

One application of this is in estimating Optical Flow using Horn and Schunk’s method [2] (see Optical flow handout). More applications will be seen in Segmentation problems, which attempt to find the object contour C(p) = [Cx(p),Cy(p)] (where p is a parameter that goes from 0 to 1 over the contour and C(0) = C(1) for closed contour) that minimizes an image dependent energy functional E(C).

REFERENCES

[1] G.Sapiro, Geometric Partial Differential Equations and Image , Cambridge University Press, 2001. [2] B.K.P. Horn and B.G.Schunk, “Determining optical flow,” Artificial Intelligence, vol. 17, pp. 185–203, 1981.