You are on page 1of 18

# Master in Seismic Engineering— E.T.S.I. Industriales (U.P.M.

)
Discretization Methods in Engineering
Variational principles
and
the Rayleigh-Ritz method
Ignacio Romero
ignacio.romero@upm.es
September 18 2013
Outline 1
1. Motivation.
2. Minimization principles in Mechanics.
3. Finite dimensional minimization problems.
4. Inﬁnite dimensional minimization problems.
5. The Rayleigh-Ritz method.
6. The Rayleigh-Ritz Finite Element method.
Things to learn in this class:
The importance of convex minimization in mechanics.
Calculus of variations.
The basic idea of the Raleigh-Ritz method.
Motivation 2
Many, many problems in Mechanics are described by minimization
principles:
• Example 1: Consider an elastic string aligned with the x axis, of length L, with
stiﬀness EA, ﬁxed at the end x = 0 and with forces f : (0, L) → R. Then, in
the equilibrium position, the displacement u : [0, L] → R minimizes the potential
energy
Π =

L
0

1
2
EA(u

)
2
−f · u

dx
• Example 2: Consider a domain Ω ⊂ R
3
, with the temperature θ = 0 on its
boundary, with a heat supply r : Ω → R. Then, the equilibrium temperature
minimizes the thermal energy
Π
2
=

1
2
κ|∇θ|
2
−r · θ

dΩ
Motivation 3
• Example 3: (Constrained minimization) The state variables X ∈ R
N
that deﬁne
the equilibrium position of a thermodynamic system with energy E are those which
maximize the entropy S(E, X) subject to the restriction that the energy is equal
to E.
• Example 4: The path taken between two points by a ray of light is the path that
can be traversed in the least time (Fermat’s principle)
• Example 5: A bubble adopts a shape that minimizes its surface energy.
• Example 6: A structure under imposed loads and displacements deforms in such a
way that its total potential energy is a minimum.
Minimization problems 4
In general, these problems are nonlinear, diﬃcult to solve, and their solution
need not be unique.
In this course we only consider quadratic (convex) potentials which have unique
solutions.
When the unknown is a vector, the classical ﬁrst order optimality condition
DΠ = 0 provides a solution. One may check that D
2
Π ≥ 0, the second order
condition for minima.
When the unknown is a function, we need to use the calculus of variations.
Finite dimensional, quadratic minimization 5
Many ﬁnite dimensional equilibrium problems can be stated as:
Find X = arg min. Π(X), with Π(X) =
1
2
X
T
KX −X
T
F ,
where X, F ∈ R
N
, K is an N ×N symmetric, positive deﬁnite matrix.
Solution: Considering the ﬁrst order optimality condition DΠ = 0 we get
0 = DΠ(X) = KX −F ,
which is a system of linear equations, with K invertible.
Result: Solving an unconstrained, quadratic minimization problem is identical to
solving the system of linear equations
KX = F
Example 6
k
k
F
(u
1
, u
2
)
For a truss of this type
Π(u
1
, u
2
) = Π
int
(u
1
, u
2
) −Π
ext
(u
1
, u
2
)
Π
int
(u
1
, u
2
) =
2

i=1
k
2
ε
2
i
Π
int
(u
1
, u
2
) = F
1
· u
1
+ F
2
· u
2
• Determine Π(u
1
, u
2
)
• Calculate DΠ
• Check D
2
Π ≥ 0
Inﬁnite dimensional minimization problems 7
Deﬁnition: A functional is a mapping F from a space of functions to R.
Vague deﬁnition: A functional is a“function of functions”.
Examples:
1) F
1
[g] =

1
0
g(x) dx (the area of a function).
2) F
2
[v] =

1
2
ρ|v|
2
dV (the kinetic energy of a body Ω).
3) F
3
[u] =

L
o
1
2
EA|u

|
2
dx (the potential energy of a deformed string).
There are also minimization problems where the unknown is precisely the function that
minimizes a functional
Find g = arg min. F[g],
Solving inﬁnite dimensional minimization problems 8
We need to ﬁnd a ﬁrst order condition for inﬁnite dimensional problems:
• Let δg be a variation of the function g, which is just any function with zero value at
those points of Ω where g is known. Then, the ﬁrst order condition is:
δF[g] = 0 , with δF[g] :=
d
d

=0
F[g + δg]
• Justiﬁcation: if g is a minimizer of F then F[g + δg] must reach its minimum
when = 0.
The equation δF[g] = 0 leads to a diﬀerential equation, which we can try to solve,
which is called the Euler-Lagrange equation of the problem.
Example: the Euler-Lagrange equation of the spring 9
Consider the minimization of the potential energy of a stretched string
V (u) =

L
0

1
2
EA(u

)
2
−f · u

dx −g · u(L) ,
where u is the unknown displacement, and u(0) = 0.
Solution: The variation δu is any function that satisﬁes δu(0) = 0. Then, the
variation of the potential energy is
δV =

L
0
(EAu

· δu

−f · δu) dx −g · δu(L)
=

L
0
(−EAu

−f) · δudx + (EAu

(L) −g) · δu(L)
Example: the Euler-Lagrange equation of the spring (2) 10
Since δu is arbitrary, we choose δu = m· (EAu

− f), with m a non-negative function
with m(0) = m(1) = 0. Then,
0 =

L
0
m· (−EAu

−f)
2
dx ⇒−EAu

−f = 0
Hence, for any δu
0 = (EAu

(L) −g) · δu(L)
and thus the terms in parenthesis must vanish too.
The minimizer u must verify
−EAu

= f , EAu

(L) = g , u(0) = 0
The Rayleigh-Ritz method 11
If we are satisﬁed with an approximate solution for an inﬁnite dimensional problem we
can obtain one in a simple way. For example, for the string problem:
Let N
1
, N
2
, N
3
, . . . , N
r
be r linearly independent functions that satisfy N
i
(0) = 0. Let
the solution u be approximated by a function
u
h
(x) =
r

a=1
N
a
(x)d
a
where d
a
are unknowns. Let d = {d
1
, d
2
, . . . , d
r
}. Then the “best”coeﬃcients d
a
are
those that solve the minimization problem
d = arg min. F[
r

i=a
N
a
(x)d
a
]
This is now a ﬁnite dimensional problem (in the unknown d) whose solution can be
obtained from the ﬁrst order condition
D
d
F[u
h
] = 0
An example 12
For the string problem, one might chose
N
a
(x) = sin(a
π
2L
x)
0.2 0.4 0.6 0.8 1.0
1.0
0.5
0.5
1.0
Worked example 13
• For the string problem:
F[u
h
] =

L
0
EA
2
((u
h
)

)
2
dx −

L
0
f · u
h
dx
=

L
0
EA
2
r

a,b=1
(N

a
N

b
d
a
d
b
) dx −

L
0
f ·
r

a=1
N
a
d
a
dx
=
1
2
r

a,b=1

L
0
EA N

a
N

b
dx

d
a
d
b

r

a=1

L
0
f · N
a
dx d
a
=
1
2
d
T
Kd −d
T
F
if we identify the components of F and K as:
F
a
=

L
0
f · N
a
dx
K
ab
=

L
0
EA N

a
N

b
dx
The Finite Element method 14
• There are inﬁnite possible sets of “trial”functions N
a
.
• Reasonable choices: sines, splines, polynomials, NURBS.
• The Finite Element Method (FEM) is the particularization of the Rayleigh-Ritz
method when the trial space of functions is the set of piecewise polynomials.
0.2 0.4 0.6 0.8 1.0
0.2
0.4
0.6
0.8
1.0
Summary 15
• Minimization problems are ubiquitous in Mechanics.
• Finite dimensional convex problems are “easy”to solve, but inﬁnite dimensional ones
might be very diﬃcult.
• The idea of ﬁrst order optimality condition might be extended to inﬁnite dimensional
problems, but still we are left with a boundary value problem.
• If an approximate minimizer is acceptable, the Rayleigh-Ritz method provides a
simple methodology to obtain one.
• There are many possible choices for solution spaces. The choice of piecewise
polynomials results in the Finite Element Method (FEM).
K. D. Hjelmstad [2005]. Structural mechanics. Springer Science+Business Media,
second edition.
T. J. R. Hughes [1987]. The ﬁnite element method. Prentice-Hall Inc., Englewood
Cliﬀs, New Jersey.
C. Lanczos [1986]. The variational principles of mechanics. Dover.
Master in Seismic Engineering— E.T.S.I. Industriales (U.P.M.)
Discretization Methods in Engineering
Variational principles
and
the Rayleigh-Ritz method
Ignacio Romero
ignacio.romero@upm.es
September 18 2013