Numerical Methods for Partial Differential Equations Eric de Sturler University of Illinois at Urbana-Champaign The calculus of variations deals with maxima, minima, and stationary values of (definite) integrals. Consider the following minimization problem. Find the minimum over all (sufficiently smooth and bounded) functions v(x) of t f (v, v t, x)dx (or f (v, v )dx as in the book), such that v() = v and v() = v. Note that this is (again) a minimization problem over a space of functions. It turns out that this problem can be replaced by an equivalent partial differential equation. Also f(r, s, x) must be sufficiently smooth. Typically, the integral measures the total energy of some system. Eric de Sturler 2-2 /27/
The basic idea is that we add an arbitrary other function (a variation) to the unknown minimizer (maximizer, stationarizer(?)) and derive the conditions that this should always increase (for minimizer,...) the value of the integral. So assume u(x) with u() = u and u() = u is the minimizer and add v(x) to u(x) for an arbitary function v(x) with ævæ =, v() = and v() =. If u(x) solves our problem, we must have the following d t d f (u + v, u + v, x)dx = =. The directional derivative in any direction must vanish at u ( = ). The conditions this places on u(x) allow us to compute this function by deriving an equivalent partial differential equation. Eric de Sturler 2 Given the regularity assumptions on u and v we can differentiate under the integral to get d t d f (u + v, u + v, x)dx = = v + v dx, Integration by parts of the second term gives v dx = dv = [f u v] This gives for the whole integral vd = d dx vdx d t d f (u + v, u + v, x)dx = = v + v dx = d dx vdx =. Eric de Sturler 2 3-4 /27/
Now the equation d dx vdx =, for all v, means that d dx = for all x. Otherwise, assume d dx > (or < ) over some small interval. We can choose v such that it is nonzero over (part of) that interval and zero everywhere else. Clearly, this would violate the equation above. Hence, u is given by the partial differential equation d dx = for x c (, ) and u() = u and. u() = u This is called the Euler-Lagrange equation for the minimization problem. Eric de Sturler 2 Now consider the minimization problem, find u(x) with u() = u, u () = u, u() = u, u () = u, that minimizes F (u, u, u, x)dx. d We consider again F (u + v, u + v, u + v, x)dx =. d This gives (note v = v = at the end points) v + v + v dx = v dx = g v d dx v + v dx = dv = v d dx v dx = d dx = dv = d 2 dx 2 vdx Substituting this gives d dx + d2 for all : dx 2 vdx = v d dx + d2 dx 2 for x c (, ). Eric de Sturler 2 5-6 /27/
We also have the concept of essential and natural boundary conditions: In the case of fixed boundary values (Dirichlet) we see that that the boundary values must be enforced by restricting the trial (and test) space. Now consider we minimize f (u, u, x)dx without requiring specific boundary values. The analogous procedure gives d dx vdx +, for all. v = v Now taking functions v such that v() = v() = implies d dx =. This leaves the condition v, which must hold for arbitrary values = of v() and v() since there are no (such) restrictions on v. This implies = at the end points (natural boundary conditions). Eric de Sturler 2 Of course, more general boundary conditions can also be included. Note that the procedure described gives stationary points. In many cases (especially static problems) the functional is quadratic or, more generally, convex and the stationary point (function) gives a minimum. For example, the minimum of the total energy of some mechanical system. In other cases (especially dynamic problems) the functional is not minimized but we find a stationary point (function) of a functional. For example a stationary point of the difference between kinetic and potential energy. Eric de Sturler 2 7-8 /27/
The first example is the total energy of an elastic bar under tangential load ; see section 8..2. Find (with ) that minimizes f(x) v(x) v() = v() = the total energy given by I (v, v )dx = [ 2 av2 fv]dx The integral represents the internal elastic energy and the load potential. ØI We have Øv = f ØI and Øv = av, so the Euler-Lagrange equation gives ØI Øv ØI Øv dx = f av dx = (which is the weak formulation) Integration by parts then gives [ f ( av ) ] dx = for all : f (av ) = with v() = v() = Eric de Sturler 2 The second example concerns the movement of a system consisting of a mass connected to a spring moving frictionless over some (hor.) surface. Let r(t) denote the displacement, such that r = means no force applied. Kinetic energy: T = 2 mṙ2 = 2 mṙ (t) 2 Potential energy: U = 2 kr2 = 2 kr (t) 2 Total energy: E = T + U = 2 mṙ2 + 2 kr2 Langrangian: L = T U = 2 mr.2 2 kr2 We assume as initial conditions r() = r and r () = r. Now Hamilton s principle states that we look for a stationary point of the integral over the Lagrangian. Eric de Sturler 2 9- /27/
Find r such that r() = r and ṙ() = ṙ and r is a stationary point of L(r, ṙ) = 2mṙ 2 2kr 2 dt Using variations with () = () = the Euler-Lagrange equation gives. kr + mṙ dt = e mr + kr = Note that for this system the total energy is constant in time: d dt E = mṙr + krṙ = ṙ (mr + kr) = Excluding the less useful choice ṙ = we find again mr + kr =. Eric de Sturler 2 Clearly these two derivations are related. Hamilton showed that the following coupled system of first order equations is equivalent to the Euler-Lagrange equations (in general). Let H(p, r, t) = pṙ L(r, ṙ, t) (the Legendre transformation of L(ṙ) ), where p = ØL Øṙ and ṗ = ØL Ør. Then the coupled system ṗ = ØH Ør and q. = ØH Øp is equivalent to the EL equation. For our problen ṗ = ØH Ør = ØL Ør = kr is the force exerted by the spring, and p = ØL Øṙ = mṙ is the momentum of the system. Now if the Lagrangian represents a mechanical system with L = T U, the difference between kinetic and potential energy, and the kinetic energy is a quadratic function of ṙ, then the Hamiltonian H represents the total energy: H = ØL Ør. ṙ + L = mṙ 2 L = 2T (T U) = T + U = E. Eric de Sturler 2-2 /27/
These characterizations of static and dynamic systems are the subject of analytical mechanics (introduced by Euler and Lagrange). For more details see (two excellent books): The Variational Principles of Mechanics, C. Lanczos, Dover Mathematical Methods of Classical Mechanics, V.I. Arnold, Springer Another good book discussing these minimizations and their relation to differential equations in weak form and finite element solution is Finite Element Solution of Boundary Value Problems (Theory and Computation), O. Axelsson and V.A. Baker, SIAM (Classics in Applied Mathematics) Eric de Sturler 2 We now briefly consider the variational method in higher dimensions. F(u, u x, u y, x, y)dxdy for x c u = for x c Ø Adding a function with = on the boundary and taking the directional derivative gives + x x + y y dxdy = Applying Gauß theorem gives and (weak formulation) Ø Ø x x dxdy = Ø x n ds Øx x dxdy = Øx x dxdy Ø Ø y y dxdy = Ø y n 2 ds Øy y dxdy = Øy y dxdy Ø Øx x Ø Øy y dxdy = Eric de Sturler 2 3-4 /27/
The following theorems are very useful Gauss: $ u d = Ø u $ n ds Where d is the unit surface/volume element, and ds is the unit line/surface element. u If we apply Gauss theorem to the function v we get u 2 v 2 v Øx + 2v 2 Øx 2 d = Ø (u v )n + (u 2 v 2 )n 2 ds Now assume v 2 = (constant): v Øx d = Øx v + u Øv Øx d = Ø (u v )n ds uv x d = Ø (uv)n ds u x vd, or applying the same idea for y uv y d = Ø (uv)n 2 ds u y vd Eric de Sturler 2 Clearly, exactly the same derivation in three dimensions will give Ø Øx x Ø Øy y Ø Øz z dxdydz = So the Euler-Lagrange equation becomes d i= Ø Øx i x i = The boundary condition u = for x c Ø is an essential boundary condition. Removing the constraint on the boundary value leads to the natural boundary condition(s) (in 2D) Ø x n + y n 2 ds = for all implies x n + y n 2 =. Eric de Sturler 2 5-6 /27/
We can also use Gauss theorem to derive the weak form of the Poisson equation. u = f for x c The weak form is given by v u d = fv d for all v (of some space) Now apply Gauss to $ (v u) d = Ø (v u) $ n ds w $ v Øx + v Øx 2 d = Ø Øx v Øx + Ø Øx 2 v Øx 2 d = Øv Øx Øx + Øv Øx 2 Øx 2 d + v Ø2 u Øx 2 + v Ø2 u Øx2 d = Ø (v u) $ n ds 2 Finally, this gives v $ u d = Ø (v u) $ n ds vßu d and since v is a scalar function v $ u d = Ø v Øn ds vßu d Eric de Sturler 2 Poisson equation: u = f for x c The weak form (after partial applying Gauss theorem) is then given by vßu d = v $ u d + Ø v Øn ds = fv d Now taking Dirichlet boundary conditions, u given and v = on the boundary, or taking Neumann or mixed boundary conditions, leads to the usual essential or natural boundary conditions. Essential boundary conditions: u = g for x c Ø ; so v = for x c Ø and the boundary integral vanishes. Natural boundary conditions: Øn + u = for x c Ø 2 ; so Ø 2 v u $ n ds = Ø 2 v Øn ds = Ø 2 uv ds Ø 2 v ds for x c Ø 2 Eric de Sturler 2 7-8 /27/
Stokes theorem: S ( % u) $ n ds = u $ d, where n is the normal to the surface S, ds is the unit surface element, is the tangent to the boundary curve (counterclockwise), and d is the unit line element (on the boundary curve). Green s theorem can be derived from either Gauss or Stokes theorem: u $ v d = Ø v( u $ n) d vßu d = Ø v Øn d vßu d is easily derived from Gauss theorem. Using Stokes theorem and taking x 3 = ( S is part of the (x, x 2 ) plane): S 2 Øx Øx 2 dx dx 2 = (u 2 n u n 2 )d Eric de Sturler 2 9-2 /27/