236861 Numerical Geometry of Images Tutorial 1 Introduction to the Calculus of Variations Alex Bronstein c 2005 1
Calculus Calculus of variations 1. Function Functional f : R n R Example: f(x, y) =x 2 + y 2 f : F R, in particular f(u) = Ω F (x, u(x),u (x),...) dx Example: f (u) = Ω u(x, y) 2 dxdy 2. Derivative Variation df (x) dx = lim f(x + x) f(x) δf(u) x 0 x δu = lim f(u + ɛδu) f(u) ɛ 0 ɛ df = ɛ f(x + ɛ x) ɛ=0 δf = ɛ f(u + ɛδu) ɛ=0 2
Calculus Calculus of variations 3. Local (relative) minimum f(x ) f(x) f(u ) f(u) x : x x α u : max x Ω u(x) u (x) α 4. Necessary condition for local extremum df (x) dx =0 δf(u) δu =0 5. Sufficient condition for local extremum d 2 f(x) dx 2 0 More complex theory 3
Calculus Calculus of variations 3. Constrained local minimum min f(x) min F (x, u(x),u (x))dx x u(x) Ω s.t. g(x) = 0 s.t. G(x, u(x),u (x)) = 0 4. Lagrangian l(x) =f(x)+λg(x) l(u) = Ω (F + λ(x)g) dx 5. Method of Lagrange multipliers dl(x ) dx =0 δl(u ) δu =0 g(x) =0 G(x, u (x),u (x)) = 0 4
Examples of functionals 1. Curve length L(y) = x1 x 0 1+y 2 dx The length of a non-parametric curve y(x). 1 2. Curve length L(x, y) = x 2 + y 2 dt The length of a parametric curve (x(t),y(t)). 3. Surface area A(z) = 1+zx 2 + zydxdy 2 S The area of a non-parametric surface S =(x, y, z(x, y)). 4. Total variation TV(y) = 0 x1 x 0 y dx The oscillation strength of a non-parametric curve y(x). 5
The Euler-Lagrange equation Let us be given the functional f(u) = x1 x 0 F (x, u(x),u (x)) dx with F C 3 and all admissible u(x) having fixed boundary values u(x 0 )=u 0 and u(x 1 )=u 1. An extremum of f(u) satisfies the differential equation F u d dx F u = 0 with the boundary conditions u(x 0 )=u 0 and u(x 1 )=u 1. 6
The second Euler-Lagrange equation A second, less known Euler-Lagrange equation is satisfied along u (x). d dx (F u F u ) F x = 0 7
The E-L equation (independent on x) If the integrand does not depend on the independent variable x, f(u) = x1 x 0 F (u(x),u (x)) dx, the second E-L equation becomes a first-order differential equation or d dx (F u F u ) = 0 F u F u = const. 8
The E-L equation (independent on u(x)) If the integrand does not depend on u(x), f(u) = x1 x 0 F (u(x),u (x)) dx, the E-L equation becomes a first-order differential equation or d dx F u = 0 F u = const. 9
The E-L equation (independent on u (x)) If the integrand does not depend on u (x), f(u) = x1 x 0 F (u(x),u (x)) dx, the E-L equation becomes an algebraic equation F u (x, u(x)) = 0. 10
The E-L equation (high-order functionals) Given the functional f(u) = x1 x 0 F ( x, u(x),u (x),..., u (n) (x) ) dx with F C n+2 and fixed boundary values u (i) (x 0 )=u (i) 0 and u (i) (x 1 )=u (i) 1 for i =0,..., n 1. The Euler-Lagrange equation (also known as the Euler-Poisson equation) is F u d dx F u + d2 dx F dn 2 u +( 1)n dx F n u (n) = 0. 11
The E-L equation (multiple independent variables) Given the functional f(u) = with x R n and u( Ω) = u Ω. Ω F (x, u(x),u x1 (x),..., u xn (x)) dx An extremum of f(u) satisfies the differential equation F u x 1 F u x1... x n with the boundary condition u( Ω) = u Ω. F u xn = 0 12
The E-L equation (multiple functions) Given the functional f(u) = x1 x 0 F (x, u 1 (x),..., u n (x),u 1(x),..., u n(x)) dx with F C 3 and all admissible u(x) having fixed boundary values u i (x 0 )=u 0 i and u i (x 1 )=u 1 i. An extremum of f(u) satisfies the system of differential equations F ui d dx F u = 0 i with the boundary conditions u(x 0 )=u 0 and u(x 1 )=u 1. 13
Problem 1: Minimum distance on a plane Prove that the family of curves minimizing the distance in the plane are straight lines. L = 1 1 1+y 2 dx, Solution The Euler-Lagrange equation Integration w.r.t. x yields 0 = d dx F y F y = d dx ( ) y. 1+y 2 y 1+y 2 = γ = const. 14
Problem 1: Minimum distance on a plane (cont.) Substitute y = tan θ: y 1+y 2 = sin θ cos θ 1+ sin2 θ cos 2 θ = sin θ cos θ sin 2 +cos 2 θ cos 2 θ = sin θ cos 2 cos θ 1 = sinθ, from where sin θ = γ. Substituting again yields y = tan θ = sin θ cos θ = ± sin θ 1 sin 2 θ = ±γ 1 γ = α = const, from where y = αx + β, β = const. The solution describes a line in the plane; the exact values of α, β are determined from the endpoint values. 15
Problem 2: Constrained maximum Find a curve y(x) with fixed endpoints y(±1) = 0 and perimeter which maximizes the area S = 1 1 A(y) = 1+y 2 dx, 1 1 ydx. Solution Construct the Lagrangian L(y) = and denote 1 1 ( y + λ ) 1+y 2 dx + const, F (x, y, y ) = y + λ 1+y 2. 16
Problem 2: Constrained maximum (cont.) The Euler-Lagrange equation Integration w.r.t. x yields 0 = d dx F y F y = d dx ( ) λy 1+y 2 1. λy 1+y 2 = x α, where α = const. Substitute y = tan θ: y λ 1+y 2 = λ sin θ cos θ 1+ sin2 θ cos 2 θ = λ sin θ cos θ sin 2 +cos 2 θ cos 2 θ = λ sin θ cos 2 cos θ 1 = λ sin θ, from where sin θ = x α λ. 17
Problem 2: Constrained maximum (cont.) Substituting again y = tan θ = sin θ cos θ = ± sin θ 1 sin 2 θ = ±(x α) λ 1 (x α)2 λ 2 = ±(x α) λ2 (x α) 2. Integration w.r.t. x yields (table of integrals or Mathematica) y = λ 2 (x α) 2 + β 2, or (x α) 2 +(y β) 2 = λ 2 where β = const. The latter equation describes a part of a circle with radius λ centered at (α, β). The exact values of the constants are determined by demanding the endpoint conditions and the perimeter constraint. 18