You are on page 1of 24

Finite Element Course

2 Calculus of Variations

Prof. Raul Durand


Finite Calculus of Variations
Elements

Calculus of Variations
Calculus of variations is a field of mathematical analysis that deals with maximizing or
minimizing functionals.
A functional can be seen as an operator that converts functions (e.g. y(x)) into real numbers.
In other words, we can say that a functional is a function of functions.
More accurately, a functional is an operator that maps functions from a linear vector space
into the real number field.
Usually functionals are given by an integral of a function F (x, y, y 0 ), in which the function
y that minimizes or maximizes the integral is needed. Function y is called extremal function
or stationary function and is useful in the study of steady-state problems.
Consider the following functional I(y):
Z b
I(y) = F (x, y, y 0 )dx, y = y(x), y0 = dy
dx
a

where F (x, y, y 0 ) is a given function. Thus, for each function y = y(x), I(y) is a real number.
A functional can also be defined in other dimensional domains, for example in two dimensions:
Z
I(u, v) = F (x, y, u, v, u0 , v 0 )dx, u = u(x), v = v(y), u0 = du
dx , v0 = dv
dy

Raul
Durand 1
Finite Calculus of Variations
Elements

The following expressions are examples of functionals:

Z b
A(y) = y(x) dx
a

Z bq
L(y) = 1 + (y 0 )2 dx
a

Z b 
I(u) = p(x) du
dx + q(x)u dx
a

Z  
I(u, v) = p(x, y) du dv
dx dx + u dx + v

Admissible functions
Functions that fit as argument for a functional are called admissible functions. They need to
have the minimal smoothness for which the integration over a problem domain makes sense.
For example, if the integrand of a functional has the term y 0 the it is reasonable to ask
that y(x) has integrable derivatives. In this case, it is sufficient the y 0 (x) be a piecewise
continuous function.

Raul
Durand 2
Finite First variation of a functional
Elements

First variation of a functional


The functional δI(y), with y = y(x), is called Gâteaux
variation of I at y when the following limit exists:

I(y + η) − I(y)


δI(y) = lim
→0 

y
In the expression above, η is a perturbation to the
function y where η = η(x) is another function and 
is a small number. This expression is similar to the y(x) +  η(x)
definition of directional derivatives:
y(x)
f (x + v) − f (x)
Dv f = lim
→0  η(x)
a b x

The Gâteaux variation, or first variation, of a functional Perturbation of function y(x)


I(y) can be found as the following ordinary derivative
evaluated at  = 0.
d
δI(y) = I(y + η)

d =0

where the operator δ is called the variational operator.


Raul
Durand 3
Finite First variation of a functional
Elements

Applying the first variation definition to the following simple cases, we have:

F (x, y, y 0 ) = x =⇒ δF = 0
F (x, y, y 0 ) = y =⇒ δF = η
F (x, y, y 0 ) = y 0 =⇒ δF = η 0

Rb
As an example, consider the functional I(y) = a yy 0 dx. The first variation of I(y) is
calculated as:
d
δI(y) = d I(y + η)

=0
Z b
= d
(y + η)(y 0 + η 0 ) dx

d =0
a
Z b
0
= d
d (yy + yη 0 + y 0 η + 2 ηη 0 ) dx

a =0
Z b
= (yη 0 + y 0 η + 2ηη 0 ) dx

a =0
Z b
= (yη 0 + y 0 η) dx
a

Raul
Durand 4
Finite First variation of a functional
Elements

To find the extremal function y of a functional F (x, y, y 0 ) it is required that:


δF = 0

The first variation operator can commute with integral and differential operators:
δ dF
dx =
d
dx (δF )
Z b Z b
δ F dx = (δF )dx
a a

The rules of variations are similar to the rules of differentiation. Thus for the functionals F1
and F2 we have:
δ(F1 ± F2 ) = δF1 ± δF2
δ(F1 F2 ) = δF1 F2 + F1 δF2
F1 δF1 F2 − F1 δF2
 
δ =
F2 F22
δ(F1 )n = n(F1 )n−1 δF1

The application of the multivariable chain rule leads to:


δF (x, y, y 0 ) = ∂F ∂F
∂y δy + ∂y 0 δy
0

δF (x, y, y 0 ) = ∂F ∂F 0
∂y η + ∂y 0 η

Raul
Durand 5
Finite Fundamental lemma of the Calculus of Variations
Elements

Fundamental lemma of the Calculus of Variations


If a continuous function f (x) on an open interval (a, b) satisfies
Z b
F (x)η(x)dx = 0
a

for any arbitrary continuous function η(x), for all x ∈ (a, b), then

F (x) = 0 in (a, b)

A simple proof of the lemma is given by assuming η(x) = F (x), since η(x) can be any
arbitrary function. Thus:
Z b
[F (x)]2 dx = 0
a
Since an integral of a positive function is positive, the equation above implies that F (x) = 0
in (a, b).
The fundamental lemma is frequently used in BVP to transform weak formulations into
strong formulations.

Raul
Durand 6
Finite Example of variational problem
Elements

Example of variational problem


Let’s find the function y(x) which is the shortest curve that connects two points (x1 , y1 ) and
(x2 , y2 ) in the Euclidean space.
There are infinite curves that connect two points. However we are interested in the one with
the shortest length (minimization problem).
The problem can be stated as a functional (the arc length of a curve) and two boundary
conditions:
Z x2 q
I(y) = 1 + (y 0 (x))2 dx for x ∈ (x1 , x2 )
x1
y(x1 ) = y1
y(x2 ) = y2

The boundary conditions ensures that the curve passes by points (x1 , y1 ) and (x2 , y2 ).
In order to find y(x) that minimizes I(y) we need to calculate δI and equate it to zero.

δI = 0

Raul
Durand 7
Finite Example of variational problem
Elements

Using the definition of first variation we have for δI:


Z x2 q
δI = d
1 + [(y + η)0 ]2 dx

d =0
x1
(y 0 η 0 )η 0
Z x2
+
= dx

q
x1 1 + [(y + η)0 ]2 =0

y0η0
Z x2
= p dx
x1 1 + (y 0 )2

Later on, using integration by parts and equating to zero:

!
y0η y0
Z x2
x2 d
δI = p − η dx = 0

p
0 2
1 + (y ) x1 x1 dx 1 + (y 0 )2

To satisfy the boundary conditions, function η(x) must be zero in x1 and x2 , thus the first
term of the right hand side in the equation above is equal to zero.

Raul
Durand 8
Finite Example of variational problem
Elements

Using the fundamental lemma in the integral expression leads to:


!
d y0
p =0
dx 1 + (y 0 )2

Taking the derivative we have:


y 00
hp i3 = 0
1 + (y 0 )2
thus
y 00 = 0

y 00 = 0 is the ordinary differential equation (EDO) whose solution represents the shortest
curve between (x1 , y1 ) and (x2 , y2 ).
The general solution of this EDO is given by
y = c1 x + c2
where c1 and c2 are constants to be determined according to the boundary conditions. In
this case we have:
y2 − y1
c1 =
x2 − x2
x2 y2 − x1 y1
c2 =
x2 − x2
Raul
Durand 9
Finite Euler-Lagrange equation
Elements

Euler-Lagrange equation
The Euler-Lagrange equation is a second-order differential equation whose solutions are
functions for which a given functional is stationary. In fact, the Euler-Lagrange equation
is used to speed up the minimization of functionals. In this sense, the solutions from the
Euler-Lagrange equations are called critical curves.
In the following, the derivation of the Euler-Lagrange equation is shown.
Given the functional Z x2
I(y) = L(x, y, y 0 ) dx
x1

I has a local minimum when δI = 0, thus we start developing the first variation of I with
an auxiliary function η(x), where η(x1 ) = η(x2 ) = 0:
Z x2
d
δI = L(x, y + η, (y + η)0 ) dx

d x1 =0
Z x2
d
= L(x, y + η, (y + η)0 ) dx

x1 d =0

later Z x2  
∂L ∂L 0
δI = ∂y η + ∂y 0 η dx
x1

Raul
Durand 10
Finite Euler-Lagrange equation
Elements

Applying integration by parts we have:


Z x2   x2
∂L d ∂L ∂L
δI = ∂y η + η dx ∂y 0 dx + η
∂y 0 x
x1 1

the last term vanishes because η = 0 at x1 and x2 by definition. Then we have:


Z x2  
∂L d ∂L
η ∂y − dx ∂y 0 dx = 0
x1

According to the fundamental lemma of calculus of variations, the term inside the brackets
is equal to zero, thus
∂L d ∂L
∂y − dx ∂y 0 = 0

This last equation is called the Euler-Lagrange equation and can be used to minimize integral
functionals where the integrand has the form F (x, y, y 0 ).

Raul
Durand 11
Finite Exercises
Elements

Exercises
1. Determine the first variation of the following functionals:

a. I(y) = y 2 y 0 + P (x)
p
b. I(y) = y 1 + (y 0 )2
q
1+(y 0 )2
c. I(y) = y

2. A point mass is released from point A = (x1 , y1 ) at zero time. It is constrained to move
under the influence of constant gravity g and without friction along a curve y = y(x) that
ends at point B = (x2 , y2 ), which is lower than A. Demonstrate that the traversal time
taken by a mass to go from point A to point B is given by the functional:
Z x2 s
1 + (y 0 )2
T (y) = dx
x1 2gy

3. Find the curve that provides the shortest time for a point mass travel from point A to
point B in the last exercise (brachistochrone curve).

Raul
Durand 12
Finite Weighted integrals
Elements

Weighted integrals
A variational formulation represent the construction of a functional that is equivalent to the
governing equations of a problem.
However, variational formulations are frequently related to the process where governing
equations are approximated by weighted-integral statements.
A weight function is frequently used to calculate integrals or averages of other functions.
Thus, the use of a weight function provides a weighted integral or a weighted average.

For instance, a weighted average for a function f (x) in


u
the domain (a, b) is calculated by:
Rb
f (x)w(x)dx
f¯¯|ba = a
Rb
w(x)dx U (x)
a
u(x)
Using this concept, the error at approximating the solu-
tion of a BVP can be measured by integrating the error R(x)
function R(x) over the domain. a x
b
Z b R(x) = u(x) − U (x)
E= w(x)R(x) dx Solution u(x), approximation U (x) and
a error R(x) functions in a BVP.

Raul
Durand 13
Finite Weighted integrals
Elements

As an example for the use of weigthed-integrals consider the following BVP:


d2 u
dx2
+u=0 for x ∈ (0, 1)
u(0) = 0
u(1) = 1

For reference, the analytical solution is given by:


sin (x)
u(x) = sin (1)

To calculate an approximated solution U (x) in the domain (0, 1) we use a linear combination
of basis functions (also called test or trial functions) chosen from a linearly independent set
Ni (x):
n
X
U (x) = ci Ni (x)
i=1

where ci are coefficients to be determined. The Ni (x) functions are chosen such the specified
boundary conditions of the problem can be satisfied by U (x).
For example, let’s use a cubic function U (x):

U (x) = c1 x3 + c2 x2 + c3 x + c4

Raul
Durand 14
Finite Weighted integrals
Elements

Since we have four unknown constants and two equations from the boundary conditions, we
need to provide two more equations. These extra equations come from the use of weighted
integrals on the residual function
d2 U (x)
R(x) = dx2
+ U (x)

and equating to zero, thus: Z 1


wi (x)R(x) dx = 0
0

In this case, we need two weight functions. Let’s choose

w1 (x) = 1 and w2 (x) = x

then
Z 1  
1 · c1 x3 + c2 x2 + c3 x + 6c1 x + 2c2 + c4 dx = 0
0
Z 1  
x · c1 x3 + c2 x2 + c3 x + 6c1 x + 2c2 + c4 dx = 0
0

Raul
Durand 15
Finite Weighted integrals
Elements

Finally we get the following system of four equations:

c4 = 0
c1 + c2 + c3 + c4 =1
13 7 1
4 c1 + 3 c1 + 2 c1 + c4 =0
11 5 1 1
5 c1 + 4 c1 + 3 c1 + 2 c4 =0

Solving the system we have:


−10 −12 771
c1 = 59 , c2 = 649 , c3 = 649 , c4 = 0

then, the approximate solution is


−10 3 −12 2 771
U (x) = 59 x + 649 x + 649 x

As can be seen, the use of weighted-residuals integrals to solve BVP provide a means for
obtaining a set of linear algebraic equations as unknown coefficients in the approximate
solution.

Raul
Durand 16
Finite Forms of boundary value problems
Elements

Forms of boundary value problems


Strong form
This form is essentially the BVP given by a differential equation and related boundary
conditions. It requires satisfaction of equilibrium, kinematics, and material law over all
points in the domain.
As an example, consider the mechanical BVP of the beam bending according to the Euler-
Bernoully theory. The strong form is given by the equation below where v is the deflection
and q is the distributed load.
d4 v
EI dx4
−q =0 for x ∈ (0, L)
v(0) = g1
d
dx v(0) = g2
d2
−EI dx 2 v(L) = h1
d3
−EI dx 3 v(L) = h2

The solution of the strong form is the analytical solution. Most strong forms of BVP in
physical problems do not have analytical solution. Thus, the solution is approximated using
weak forms and energy methods, for example.

Raul
Durand 17
Finite Forms of boundary value problems
Elements

Weighted residual form


This form is usually obtained by formulation the weighted-integral of the differential equation
over a given domain.
assuming a weigh function w(x) for the strong form, the following weighted residual form:
Z L 
d4 v
EI dx4
− q w(x) dx
0

An approximate solution U (x) can be proposed as a linear combination of trial functions


Ni (x):
n
X
U (x) = ci Ni (x)
1

Trial functions usually take the form of polynomials. The principal requirement for trial
functions is that they be admissible functions; that is, they and their derivatives in the
integrand need to be continuous over the domain and also satisfy the boundary conditions.
The solution of the weighted residual form using an approximate function U (x) is frequently
not exact since it only satisfies the differential equation in the integral or average sense.

Raul
Durand 18
Finite Forms of boundary value problems
Elements

Weak form
The weak form it is usually obtained by carrying out integration by parts on the weighted
residual form and applying the natural boundary conditions. In general, weak form means,
instead of solving a differential equation of the underlying BVP, an integral function is solved.
In statics, the weak form is also derived from the principle of virtual work while in dynamics
it is derived from the d’Alembert principle.
Using the beam example, integrating the weighted residual form by parts yields to the weak
form: Z L Z L h iL h iL
d2 w d2 v 3
d v dw d2 v
EI dx2 dx2
dx − wq dx + wEI dx2 − dx EI 2
dx 0
=0
0 0 0

The weak form is equivalent to the strong form. The strong form solution satisfies the
weak form and vice-versa. However, approximate solutions to the BVP can be obtained by
choosing particular sets of trial functions and weight functions. In this way, this solution
only satisfies the original BVP in an average sense.

Raul
Durand 19
Finite Forms of boundary value problems
Elements

Variational form
This form is derived based on physical principles. In statics, it expresses the principle of
minimum potential energy while in dynamics it is called Hamilton’s principle.
This form is only possible for conservative systems and it only satisfies the governing equa-
tions in the average sense.
The variational form is equivalent to the strong form. If a variational form exists for a given
problem, then all other forms can be derived from it.
The methods used to solve a BVP stated in the variational form are frequently called as
energy methods. For instance, in the case of the beam deflection problem, the variational
form is obtained by equating the potential energy of the external load and the internal elastic
energy. Z  L   2
1 d2 v
Π(v) = 2 EI dx2
− q v dx with δΠ = 0
0

where Π is the total potential energy functional.

Raul
Durand 20
Finite Exercises
Elements

Exercises
1. Find an approximate solution for the BVP using weighted integrals with an approximate
solution of the form U (x) = c1 x2 + c2 x + c3 and a weight function w(x) = 1.
d2 u
dx2
+u=1 for x ∈ (0, 1)
u(0) = 1
u(1) = 0

2. Find an approximate solution for the BVP using weighted integrals with an approximate
solution of the form U (x) = c1 x3 + c2 x2 + c3 x + c4 and weight functions w1 (x) = 1 and
w2 (x) = x.
 
d
dx x du
dx + u = 0 for x ∈ (0, 1)
u(0) = 1
 
x du
dx x=1
=0

3. Find the weak formulation of the BVP.


2
EA ddxu2 + q(x) = 0 for x ∈ (0, L)
u(0) = 0
d
EA dx u(L) = f
Raul
Durand 21
Finite Exercises
Elements

4. Find the weak formulation of the BVP.


 
d
dx x du
dx = f (x) for x ∈ (0, L)
u(0) = u0
 
x du
dx x=L
=Q

Raul
Durand 22
Finite Bibliography
Elements

Bibliography
1. J.N. Reddy, An Introduction to the Finite Element Method, Third edition, McGraw
Hill, 2005.
2. T.J.R. Hughes, The Finite Element Method, Dover, 2000.
3. K. J. Bathe, Finite Element Procedures, Pearson, 2006.

For since the fabric of the universe is most


perfect and the work of a most wise Creator,
nothing at all takes place in the universe in which
some rule of maximum or minimum does not appear.
Leonhard Euler

Raul
Durand 23

You might also like