Notes NMCE
Notes NMCE
Riccardo Sacco
September 3, 2016
2
i
Preface
This text contains the notes of the course “Numerical Methods in Civil Engi-
neering”, which I have been helding over the last ten years for the MSc in Civil
Engineering at Politecnico di Milano. The material is organized into 5 parts:
• Part II: The GFEM for Elliptic Problems in 1D and 2D (Chapts. 3 and 4)
Specifically:
All computations have been performed using Matlab on a standard laptop running
under Linux OS. Methodologies and algorithms have been implemented in 1D
and 2D codes by Marco Restelli and subsequently modified by Riccardo Sacco
and Aurelio Giancarlo Mauri. The codes can be downloaded at the official web
page of the Course:
⇒ https://beep.metid.polimi.it/
Acknowledgements
It is a great pleasure for me to acknowledge here the fundamental contribution
given by Marco Restelli and Luca Dedè for their computer lab class teaching and
for developing the numerical software and tutorial exercises which constitute the
supporting backbone of the theoretical part of the course. I also wish to gratefully
thank Carlo de Falco for his teaching assistance in computer lab classes during the
year 2010, to Chiara Lelli for her assistance during the years 2012/2013, where
for the first time the teaching language switched from Italian to English, and to
Francesca Malgaroli for teaching in the year 2014. Last, but certainly not least,
my thanks go also to Paola Causin, for fruitful discussions and ten years of com-
mon hard work in the development, analysis and implementation of finite element
methodologies in Continuum Mechanics, and to Prof. Maurizio Verri, for his fan-
tastically critical proof-reading of the first draft of these notes.
Contents
I Elliptic Problems 1
1 Weak Formulations 5
1.1 Elliptic operators . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Elliptic boundary value problems . . . . . . . . . . . . . . . . . . 6
1.3 Weak solution of a BVP: the 1D case . . . . . . . . . . . . . . . . 7
1.4 Weak solution of a BVP: the 2D case . . . . . . . . . . . . . . . . 13
1.4.1 Non-homogeneous Dirichlet problem in 2D . . . . . . . . 15
1.4.2 Non-homogeneous Neumann problem in 2D . . . . . . . 16
1.4.3 Mixed problem in 2D . . . . . . . . . . . . . . . . . . . . 17
1.5 Well-posedness analysis: the Lax-Milgram Lemma . . . . . . . . 18
2 The GFEM 21
2.1 The Galerkin method . . . . . . . . . . . . . . . . . . . . . . . . 21
2.2 The Galerkin Finite Element Method . . . . . . . . . . . . . . . . 26
2.2.1 Error analysis . . . . . . . . . . . . . . . . . . . . . . . . 27
2.3 Experimental convergence study of the GFEM . . . . . . . . . . . 30
2.3.1 BVP with smooth solution . . . . . . . . . . . . . . . . . 30
2.3.2 BVP with a non-smooth solution . . . . . . . . . . . . . . 31
v
vi CONTENTS
6 2D elasticity 97
6.1 Two-dimensional models in elasticity . . . . . . . . . . . . . . . 97
6.1.1 Plane stress . . . . . . . . . . . . . . . . . . . . . . . . . 98
6.1.2 Plane strain . . . . . . . . . . . . . . . . . . . . . . . . . 99
6.2 The GFE approximation in the 2D case . . . . . . . . . . . . . . 100
6.2.1 The Galerkin FE problem . . . . . . . . . . . . . . . . . 101
6.2.2 Local approximations and matrices . . . . . . . . . . . . 102
6.2.3 Convergence analysis . . . . . . . . . . . . . . . . . . . . 105
6.3 Numerical examples . . . . . . . . . . . . . . . . . . . . . . . . 107
CONTENTS vii
V Appendices 185
A Differential Calculus 189
A.1 Differential operators, useful formulas and properties . . . . . . . 189
A.1.1 First-order operators . . . . . . . . . . . . . . . . . . . . 189
viii CONTENTS
Elliptic Problems
1
3
This part illustrates the weak formulation of elliptic model problems and their
numerical approximation using the Galerkin Finite Element Method.
4
Chapter 1
Abstract
In this chapter, we introduce the concept of weak solution of an elliptic boundary
value problem and we illustrate the Lax-Milgram Lemma, a theoretical tool for
the analysis of the well-posedness of the associated weak formulation.
ξ T A(x)ξ ≥ α0 |ξ |2
5
6 CHAPTER 1. WEAK FORMULATIONS
Remark 1.1.2. Def. 1.1.1 is satisfied if A is a strictly positive function almost ev-
erywhere (a.e.) in Ω. In such a case we can take α0 = inf A(x). In the more
x∈Ω
general case where A is a real-valued d × d matrix function, then Def. 1.1.1 is sat-
isfied if A is positive definite a.e. in Ω. In this case, we can take α0 = inf λmin (x)
x∈Ω
where λmin (x) is the minimum eigenvalue of matrix A evaluated at the spatial
position x in the domain Ω.
Example 1.1.3 (The Laplace operator). The simplest, and most important, exam-
ple of linear elliptic operator is the Laplace operator (shortly, Laplacian), defined
as the second-order differential operator obtained by application of the divergence
operator to the vector field ∇u, for a given twice-differentiable function u, such
that
d
∂ 2u
4u := div ∇u = ∑ 2 .
i=1 ∂ xi
111
000
P 11
00
000
111
000
111
000
111
x 00
11
00
11
00
11
000
111
000
111 0 1/2 1 00
11
00
11
000
111 00
11
000
111 00
11
000
111 00
11
000
111
000
111
000
111
u(x) 00
11
00
11
00
11
The boundary ∂ Ω is the set made by the two end-points x = 0 and x = 1, while
the outward unit normal vector n is given by n(0) = −1 and n(1) = +1, so that
the previous identity becomes
0 0
Z1 0 0 Z 1
− v(1)u (1) − v(0)u (0) + u v dx = f v dx ∀v.
0 0
To get rid of the boundary term in the previous relation, we choose v such that
v(0) = v(1) = 0
exactly as u does in (1.3)2 .
1.3. WEAK SOLUTION OF A BVP: THE 1D CASE 9
Theorem 1.3.1. Let ϕ, ψ be two functions in L2 (0, 1), and set g := ϕ · ψ. Then,
g ∈ L1 (0, 1).
Then, we apply the Cauchy-Schwarz inequality (C.16) and prove the result.
Using Thm. 1.3.1 we immediately see that the above described formal proce-
dure can be synthetically written as:
find u ∈ V such that
Z 1 Z 1
0 0
u v dx = f v dx ∀v ∈ V (1.4)
0 0
where
1. relation (1.4) holds in an integral sense and not in a pointwise sense, as (1.3)1 ;
Figure 1.2: Minimization of the total potential energy. The black bullet is J(u),
while the black square is J(v) ≥ J(u) for all v ∈ V .
Proof. Let us prove that (1.4)-(1.5) implies (1.7). For each ε ∈ R and for any
arbitrary function v ∈ V we have
Z 1 Z 1
1 0 2
J(u + εv) = ((u + εv) ) dx − f (u + εv) dx
2
0 0
Z 1 Z 1 Z 1
1 0 2 0 0 2 1 0 2
= (u ) dx + ε u v dx + ε (v ) dx
0 2 0 0 2
Z 1 Z 1
− f u dx − ε f v dx
0 Z 1 0 1 Z 1
1
Z
0 0
= J(u) + ε u v dx − f v dx + ε 2
(v0 )2 dx.
0 0 0 2
1.3. WEAK SOLUTION OF A BVP: THE 1D CASE 11
represents the total elastic strain energy stored in the elastic body in correspon-
dance to a generic deformed configuration v = v(x), while
Z 1
− f v dx
0
represents the work done by the deformed system against the external body forces
The weak formulation (1.4)-(1.5), instead, is the counterpart of the principle
of virtual works. In particular, the term
Z 1
u0 v0 dx
0
represents the scalar product bewteen the stress σ (u) = u0 associated with the
actual body deformation and the strain ε(v) = v0 associated with the virtual dis-
placement v = v(x), while
Z 1
f v dx
0
represents the work done by the external forces in correspondance of a virtual
displacement v.
So far, we have shown that u is a weak solution of the BVP iff it is also a min-
imizer of the total potential energy (1.8). By construction, if u solves (1.3), then
it is also a solution of the weak problem (1.4). To close this chain of implications,
we need to show that a weak solution is also a strong solution of the BVP.
Two remarks are in order with (1.12). The first remark is that the function g :=
u00 · v belongs to L1 (0, 1) due to Thm. 1.3.1, so that each term in the integral is
well defined. The second remark is that, using the definition (C.18) of scalar
product in the Hilbert space L2 (0, 1), the integral equation (1.12) tells us that
the element −(u00 + f ) ∈ L2 (0, 1) is orthogonal to the whole H01 (0, 1). Since the
embedding of H01 (0, 1) in L2 (0, 1) is completely continuous, it follows that the
element −(u00 + f ) ∈ L2 (0, 1) is orthogonal to the whole L2 (0, 1) space. Therefore,
−(u00 + f ) coincides with the null function a.e. in (0, 1) which concludes the
proof.
Remark 1.3.6. The conclusion of Thm. (1.3.5) is that the additional regularity
assumption (1.11) is a necessary requirement on the solution of the weak prob-
lem (1.4)-(1.5) in order to prove that it is actually a solution of the original BVP
problem (1.3). Such extra regularity could, however, have been inferred from (1.3)1 ,
by identifying u00 with the element f ∈ L2 (0, 1) in the Lebesgue sense (i.e., almost
everywhere in (0, 1)). Therefore, we see a posteriori that the solution of the weak
problem (1.4)-(1.5) belongs to H 2 (0, 1) ∩ H01 (0, 1).
is not linear (does v1 + v2 belong to Vg , for v1 , v2 ∈ Vg ??). With this purpose, let
us pick up in H 1 (Ω), a function Rg such that γ0 Rg = g. We call Rg a lifting of g to
all Ω. Then, we assume that the solution of (1.19) can be written as
u = u0 + Rg (1.20)
with γ0 u0 = 0. Having done this, we multiply (1.19)1 by a test function v ∈ V =
H01 (Ω), integrate over all Ω and apply Green’s formula, to get
Z Z
∇u · ∇v dΩ = f v dΩ ∀v ∈ V.
Ω Ω
16 CHAPTER 1. WEAK FORMULATIONS
To derive the weak formulation of the BVP (1.22) we proceed as usual and
obtain:
find u ∈ V such that
Z Z Z
∇u · ∇v dΩ = f v dΩ + hv dΣ ∀v ∈ V (1.24)
Ω Ω Γ
where
V = H 1 (Ω) \ R = v ∈ H 1 (Ω) such that v is not a constant .
(1.25)
The space V is an Hilbert space endowed with the norm
kvkV := k∇vkL2 (Ω) v ∈ V. (1.26)
Remark 1.4.8 (Physical interpretation). The BVP (1.22) represents in Electrostat-
ics the Gauss law for a dielectric medium whose electric charge density (normal-
ized to the dielectric permittivity of the medium) is f , and whose outward flux of
the electric field across the boundary is equal to −h.
where
1
(Ω) = v ∈ H 1 (Ω) such that v|ΓD = 0 .
V = H0,ΓD
(1.29)
The space V is an Hilbert space endowed with the norm (C.36) in virtue of
Rem. C.7.8.
Remark 1.4.9 (Physical interpretation). The BVP (1.27) represents in Thermal
Physics the Fourier law for thermal diffusion in a medium under the action of
a distributed thermal source f (normalized to the thermal conductivity of the
medium), of a fixed temperature g on the boundary portion ΓD and of a given
thermal flux −h on the boundary portion ΓN , respectively.
• F(·) : V → R is a given linear form, i.e., a linear functional over the space
V such that
F(λ v + µw) = λ F(v) + µF(w).
1.5. WELL-POSEDNESS ANALYSIS: THE LAX-MILGRAM LEMMA 19
The following result provides a sufficient condition for problem (1.30) to ad-
mit a unique solution.
Theorem 1.5.1 (Lax-Milgram (LM) Lemma). Assume that there exist three posi-
tive constants M, β and Λ such that:
Then, problem (1.30) admits a unique solution u ∈ V and the following stability
estimate holds
Λ
kukV ≤ . (1.32)
β
Proof. The proof of the Lax-Milgram Lemma requires the use of advanced tools
of Functional Analysis and for this reason is omitted here. To prove (1.32), we
simply need to take v = u in (1.30). This yields, using (1.31c)
BVP V B F
Z Z
Dirichlet (hom.) H01 (Ω) ∇u · ∇v dΩ f v dΩ
Ω Ω
Z Z
Dirichlet (non-hom.) H01 (Ω) ∇u0 · ∇v dΩ f v dΩ − a(Rg , v)
Ω Ω
Z Z Z
Neumann (non-hom.) H 1 (Ω) \ R ∇u · ∇v dΩ f v dΩ + hv dΣ
Ω Ω Γ
Z Z Z
Mixed 1 (Ω)
H0,Γ ∇u0 · ∇v dΩ f v dΩ + hv dΣ − a(Rg , v)
D
Ω Ω ΓN
Remark 1.5.4 (Mechanical interpretation). The estimate (1.33) tells us that the
membrane deformation energy is proportional to the energy of the vertical load
(its weight, for instance) in agreement with Hooke’s law of Elasticity.
Chapter 2
Abstract
In this chapter, we construct the numerical approximation of an elliptic boundary
value problem in weak form by means of the Galerkin Finite Element Method.
In particular, we study the consistency, stability and convergence properties of
the associated discrete formulation, and we illustrate the numerical performance
of the method in the study of simple two-point boundary value problems with
smooth and non-smooth solutions.
2. seek the solution of the weak problem (1.30) within Vh , that is:
21
22 CHAPTER 2. THE GFEM
Definition 2.1.1 (Nomenclature). The equation (2.1) is called the Galerkin Prob-
lem associated with the weak problem (1.30), and uh is the Galerkin approxima-
tion of the solution u ∈ V of (1.30).
where the functions ϕi = ϕi (x) constitute a basis for Vh (cf. Sect. B.1). Of course,
we can write
Nh
uh (x) = ∑ u j ϕ j (x) (2.2)
j=1
Nh
∑ u j B(ϕ j , vh) = F(vh) ∀vh ∈ Vh . (2.3)
j=1
Thus, the Galerkin problem amounts to solving a linear algebraic system that can
be written in matrix form as
Bu = f (2.4)
where:
2.1. THE GALERKIN METHOD 23
fi = F(ϕi ) i = 1, . . . , Nh . (2.6)
lim ku − uh kV = 0. (2.7)
h→0
that is, B is positive definite (see Sect. B.3 for the definition).
24 CHAPTER 2. THE GFEM
eh := u − uh .
Theorem 2.1.5 (Stability). The Galerkin method is stable, i.e., eh satisfies the
estimate
B(eh , eh ) ≥ β keh kV2 ,
where β is the coercivity constant appearing in the Lax-Milgram Lemma 1.5.1.
Proof. Since Vh ⊂ V , the function eh ∈ V , and then we can apply the coercivity
assumption on B to get the result.
Theorem 2.1.6 (Consistency). The Galerkin method is consistent, i.e., the dis-
cretization error satisfies the relation
Thus, using the continuity of B and combining the previous two relations, we get
β ku − uh kV2 ≤ Mku − uh kV ku − vh kV ∀vh ∈ Vh ,
from which we get
M
ku − uh kV ≤ ku − vh kV ∀vh ∈ Vh .
β
Since the last inequality must hold for every choice of vh in Vh , it is true in particu-
lar for that realizing the infimum of ku − vh kV over the space Vh , that is (2.10).
Remark 2.1.9. Ceà’s Lemma has a remarkable conceptual interpretation
discretization error ≤ ampli f ication f actor × approximation error .
The amplification factor M/β is the effect of the continuous problem on its corre-
sponding approximation. This, a posteriori, supports the importance of having a
”small” M and a ”big” β in Lax-Milgram Lemma.
26 CHAPTER 2. THE GFEM
where Xhr is the piecewise polynomial space introduced in Sect. F.1. The number
of linearly independent basis functions spanning Vh , denoted by Nh (r), gives the
dimension of Vh and reads
The Galerkin method with Vh as in (2.12) is called Galerkin Finite Element Method
of order r (GFEM), or, shortly, the Finite Element Method (FEM).
Remark 2.2.1 (Sparsity pattern of A). An important consequence of the choice of
Vh is that the stiffness matrix B is sparse. This means that only a few of the Nh2
entries Bi j is actually non-vanishing. In the 1D case, it is easy to characterize the
sparsity pattern of B, i.e., the subset of node indices such that Bi j 6= 0. As a matter
of fact, looking at the structure of Lagrangian basis functions (see Sect. F.1.1), we
see that for each row i ∈ [1, Nh (r)], the column indices j(i) belonging to the pattern
of i are those such that j(i) ∈ [i − r, i + r]. For example, if r = 1, for each row i,
we have (a priori) at most three nonzero entries: Bi,i−1 , Bi,i and Bi,i+1 , so that B
2.2. THE GALERKIN FINITE ELEMENT METHOD 27
(a) r = 1 (b) r = 2
Figure 2.2: Sparsity patterns in the cases r = 1 and r = 2, with Mh = 10. The
graphs have been obtained using the Matlab commands: spy(B) and nnz(B),
respectively.
Remark 2.2.3. Thm. 2.2.2 contains two important informations. The first infor-
mation is that the finite element interpolant Πrh f converges to f (in the topology of
L2 ) with order r + 1 with respect to the discretization parameter h (cf. Def. D.4.2).
The second information is that the order of convergence of the derivative (Πrh f )0
to the derivative f 0 decreases by one with respect to the order of convergence of
Πrh f to the function f .
Theorem 2.2.4 (GFEM Convergence (1)). Let u and uh denote the solutions
of (1.30) and (2.1), respectively. Assume also that u ∈ H r+1 (Ω). Then, we have
M r
ku − uh kV ≤ C h kukH r+1 (Ω) . (2.16)
β
Proof. Let us consider (2.10). Instead of determining the ”optimal” vh , i.e., the
function vh in correspondance of which the approximation error attains its infi-
mum, we pick the ”special” function vh := Πrh u. By doing so, we obtain
M
ku − uh kV ≤ ku − Πrh ukV
β
from which, using (2.14) and (2.15) with f ≡ u, we get (2.16). The proof of (2.17)
requires the use of sophisticated functional arguments (duality analysis, Aubin-
Nitsche trick), and for this reason is omitted here.
Remark 2.2.5. The above proof reveals another remarkable conceptual interpreta-
tion of Ceà’s Lemma
Thus, the error analysis of the GFEM method is reduced to a simple interpolation
error analysis.
The error analysis of the GFEM has been carried out under the very restrictive
assumption that the exact solution u of (1.30) has an arbitrarily high regularity (as
a matter of fact, we have postulated that, for any given r, the function u belongs to
H r+1 !). This is clearly not true, in general, so that we have to modify Thm. 2.2.4
to account for the realistic case.
2.2. THE GALERKIN FINITE ELEMENT METHOD 29
Theorem 2.2.6 (GFEM Convergence (2)). Let u and uh denote the solutions
of (1.30) and (2.1), respectively. Assume that u ∈ H s (Ω), s ≥ 2 being the ”true”
regularity of the solution of the weak problem. Then, we have
M l
ku − uh kV ≤ C h kukH l+1 (Ω) , (2.18)
β
where
l := min {r, s − 1}
is called regularity threshold. Under the same assumptions, we also have
Remark 2.2.7 (h-and-r refinement strategies). Thm. 2.2.6 shows that there is no
convenience in using high-order polynomials (r-refinement) to increase approxi-
mation accuracy, when the regularity of the exact solution is small. Rather, it is
better to employ the maximum value of r that is allowed by the regularity thresh-
old, and then reduce the discretization parameter h (h-refinement). This general
phylosophical statement is summarized in Tab. 2.1.
⇒ https://beep.metid.polimi.it/
The exact solution is u(x) = sin(x), so that s = +∞ and Thm. 2.2.6 gives us the
optimal result l = r for every r. This prediction is confirmed by the plots in Fig. 2.3
which show that the orders of convergence in the L2 and H 1 norms are equal to
r + 1 and r, respectively. The mesh size is uniform and equal to h = 10/Mh ,
Mh = [10, 20, 40, 80, 160, 320]T .
Figure 2.3: BVP in 1D with smooth solution. Circles refer to the error in L2 ,
asterisks refer to the error in H 1 .
2.3. EXPERIMENTAL CONVERGENCE STUDY OF THE GFEM 31
which shows that f ∈ Ls (0, 2) ⇔ κ + 1 > 0, that is, iff λ > 2 − 1/s. Under this
condition, the solution u(x; λ ) of (2.21) belongs to the Sobolev space H s (0, 2) so
that Thm. 2.2.6 tells us that (in the worst scenario) the order of convergence of the
GFEM is equal to l = min {r, s − 1}. Setting s = 3, for example, we should have a
convergence order pH 1 in the H 1 -norm equal to 1 and 2 (optimal) if r is equal to
1 and 2, respectively, while pH 1 = s − 1 = 2 for every r ≥ 3 (sub-optimal). This
prediction is fully confirmed by Tab. 2.2 which shows the order of convergence
computed experimentally using (D.9) on a triangulation Th with uniform mesh
size equal to h = 2/Mh , Mh = [7, 23, 59, 131, 277, 551]T .
32 CHAPTER 2. THE GFEM
Mh pH 1 (r = 1) pH 1 (r = 2) pH 1 (r = 3) pH 1 (r = 4)
23 9.9434e-01 1.9833e+00 2.1384e+00 2.0032e+00
59 9.9938e-01 1.9947e+00 2.0559e+00 2.0010e+00
131 9.9990e-01 1.9978e+00 2.0247e+00 2.0004e+00
277 9.9998e-01 1.9990e+00 2.0116e+00 2.0002e+00
551 9.9999e-01 1.9995e+00 2.0057e+00 1.9998e+00
Table 2.2: Order of convergence of the GFE method as a function of r in the case
of a solution belonging to H 3 (0, 2).
Part II
33
35
This part illustrates the weak formulation and the numerical approximation using
the Galerkin Finite Element Method (GFEM) of reaction-diffusion and advection-
diffusion problems in the 1D case. Then, the application of the GFEM to elliptic
problems in the 2D case is addressed, and the principal issues that characterize the
implementation of the method in a computational algorithm are illustrated.
36
Chapter 3
Abstract
In this chapter, we apply the general machinery of weak formulation and Galerkin
Finite Element (GFE) approximation to two particular, and significant, classes
of elliptic boundary value problems, namely, a reaction-diffusion equation and
an advection-diffusion equation. To keep the presentation as simple as possible,
we consider the 1D case, with constant coefficients and homogeneous Dirichlet
boundary conditions. For both model problems, the standard GFE approximation
is first presented, and then an appropriate stabilized form of the method is pro-
posed to cure the occurrence of numerical instabilities in the computed solution
when the continuous problem is dominated by reaction or advection terms. Com-
putational examples (run with the 1D finite element code EF1D written by Marco
Restelli) are included to show how things can go wrong and how to fix problems.
The code has been developed by Marco Restelli and subsequently modified by
Riccardo Sacco and Aurelio Giancarlo Mauri, and is available at the link:
⇒ https://beep.metid.polimi.it/
37
38 CHAPTER 3. ELLIPTIC PROBLEMS: THEORY AND FES
Figure 3.1: Plot of the solution of the reaction-diffusion model problem as a func-
tion of α.
Fig. 3.1 shows that u tends to a constant, equal to 1/σ , as α → ∞. As a matter
of fact, assuming α 1 and expanding the exponential terms in (3.2), we get
1h i
u(x) ' 1 − eα(x−1) − e−αx .
σ
3.1. REACTION-DIFFUSION MODEL PROBLEM 39
Theorem 3.1.2. Problem (3.3) is uniquely solvable and u satifies the estimate
CP k f kL2 (0,1)
kukV ≤ . (3.4)
µ
Proof. Let us check that B and F satisfy the conditions required by the Lax-
Milgram Lemma.
40 CHAPTER 3. ELLIPTIC PROBLEMS: THEORY AND FES
• continuity of B:
Z 1 Z 1
0 0
|B(u, v)| ≤ µ |u | |v | dx + σ |u||v| dx
0 0
≤ µkukV kvkV + σ kukV kvkL2 (0,1)
≤ (µ + σCP2 )kukV kvkV ∀u, v ∈ V,
• coercivity of B:
B(u, u) ≥ µkukV2 ∀u ∈ V
because σ is > 0, from which β = µ;
• continuity of F:
Z 1
|F(v)| ≤ | f | |v| dx ≤ k f kL2 (0,1) kvkL2 (0,1)
0
≤ CP k f kL2 (0,1) kvkV ∀v ∈ V,
Since all the assumptions of the Lax-Milgram Lemma are verified, the solution u
of (3.3) exists and is unique in V , and satisfies (3.4).
because the exact solution u ∈ C∞ ([0, 1]) so that l = r, while CP = 1 for Ω = (0, 1).
Thus, we see that uh converges to u, in the H 1 -norm, as h → 0, and that accuracy
improves as the polynomial order is increased, because of the infinite regularity
of the exact solution.
We enter in more details with the GFE problem for the RD equation, and consider
the case r = 1 with a uniform partition of [0, 1] into Mh ≥ 2 elements of size
h = 1/Mh . Matrix B can be written as the sum of a diffusion matrix
µ
− j = i−1
h
2µ
j=i
Z 1
Bdij = µϕ 0j ϕi0 dx = h
0
−µ
j = i+1
h
0 otherwise
42 CHAPTER 3. ELLIPTIC PROBLEMS: THEORY AND FES
In conclusion, the explicit form of the linear algebraic system (2.4) in the case
r = 1, h = 1/Mh and f = 1 is
2µ 4σ h µ σh
+ − + 0/
h 6 h 6 u1 1
µ σh 2µ 4σ h ...
− +
+
u2 1
6 6
h h
= h .
.. .. µ σh
.. ..
. . − +
.
.
6
h
µ σh 2µ 4σ h uNh 1
0/ − + +
h 6 h 6
(3.6)
Theorem 3.1.4 (Monotonicity and maximum principle for the RD problem). Let
Lw := −µw00 + σ w = 1. Then, L is inverse-monotone (see (A.2)) so that the solu-
tion of (3.1) satisfies the condition
Moreover, L satisfies the comparison principle A.1.3 with φ (x) = 1/σ , so that the
solution of (3.1) satisfies the maximum principle (MP)
1
0 ≤ u(x) ≤ max φ (x) = ∀x ∈ [0, 1]. (3.8)
x∈[0,1] σ
3.1. REACTION-DIFFUSION MODEL PROBLEM 43
where
σ h2
Perd := (3.11)
6µ
is the non-dimensional Pèclet number associated with the reaction-diffusion prob-
lem.
Proof. It suffices to apply the discrete comparison principle with e = [1, 1, . . . , 1]T ∈
RNh and then apply Thm. 3.1.7.
If h does not satisfy (3.12), then spurious oscillations are likely to occur in the
computed solution uh preventing (3.9) from being verified. To see this, we study
BVP (3.1) in the case where µ = 10−4 , σ = 1 and f = 1, and start to take Mh = 10
uniform partitions of [0, 1], i.e., h = 1/10 = 0.1. Condition (3.12) would require
h < 2.45 · 10−2 , i.e., Mh ≥ 41, to guarantee a DMP for uh , therefore, we expect
numerical difficulties to occur. This is exactly what is shown in Fig. 3.2. Wild
oscillations arise in the neighbourhood of the boundary layers, at x = 0 and x = 1,
but some small over-and undershoots are present also in the remainder of the
computational domain.
3.1. REACTION-DIFFUSION MODEL PROBLEM 45
Figure 3.2: Plot of exact and approximate solutions (r = 1) in the case Mh = 10.
Things drastically change if we take Mh = 41. The result is shown in Fig. 3.3.
Oscillations have disappeared, and it can be checked that max uh (x) = 1 (re-
x∈[0,1]
call that σ = 1), so that the DMP is satisfied. However, a closer glance to uh
reveals that in the neighbourhood of the layers, the accuracy of the approximation
is not very good, because h is not sufficiently small to “capture” the steep gradient
of u. On the other hand, it is quite clear that the mesh size is excessively refined
outside the layers, where the exact solution is almost constant.
Definition 3.1.12 (Discrete maximum norm). For any grid function
ηh : {xi }N
i=1 → R,
h
where the quantities ηi are the nodal values of ηh . The norm (3.14) is the discrete
version of the maximum norm (F.7) and coincides with the maximum norm for a
vector (B.2) upon setting x := [η1 , η2 , . . . , ηNh ]T .
46 CHAPTER 3. ELLIPTIC PROBLEMS: THEORY AND FES
Figure 3.3: Plot of exact and approximate solutions (r = 1) in the case Mh = 41.
Figure 3.5: Plot of exact and approximate solutions (r = 1) in the case Mh = 10.
The lumping stabilization has been used.
The effect of the use of the trapezoidal numerical quadrature can be seen in
Fig. 3.5, which shows the computed solution uh over the same mesh as in Fig. 3.2.
No spurious oscillations are present, uh (x) satisfies the DMP and is always bounded
from above by the exact solution u(x), unlike the case of Fig. 3.3 (with Mh = 41).
Also, the maximum nodal error is equal to 0.0097595, which is far better than that
of Fig. 3.3.
Remark 3.1.13 (The linear system). The use of trapezoidal quadrature is called
reduced integration of the reaction matrix, because instead of computing exactly
the entries Brij , we are deliberately introducing a quadrature error, given by (F.11)2 .
The advantage of such reduced integration is that the modified reaction matrix,
denoted B e r , is diagonal and positive
σ h + h = σh j=i
Berij = Ih1 (σ ϕ j ϕi ) = 2 2
0 otherwise,
so that the explicit form of the linear algebraic system (2.4) in the (stabilized) case
is (r = 1, f = 1 and h = 1/Mh )
2µ µ
+σh − 0/
u1
1
h h
2µ
µ ... u 1
− +σh 2
h h = h .
.. .. µ
.
.
..
. . − .
.
h
µ 2µ uN 1
0/ − +σh h
h h
(3.17)
Theorem 3.1.14 (DMP principle (revisited)). Problem (3.15) admits a unique so-
lution that satisfies the DMP (3.9) for every value of the Pèclet number Pead .
Remark 3.1.15 (The lumping procedure). The diagonalization of the reaction ma-
trix is often called lumping because the entries Berii can be interpreted as obtained
by summing by row the matrix Br . This is equivalent to “lump” the weight of the
reaction term into each mesh node xi . Such approach can be extended to higher-
degree finite elements (r ≥ 2), but no theoretical proof of DMP can be easily
established.
Remark 3.1.16 (The error). The integration error (F.11)2 associated with the use
of the trapezoidal quadrature formula is O(h2 ). This allows to show (using a
generalized form of Ceà’s Lemma known as Strang’s Lemma) that for r = 1
ku − uh kV ≤ ChkukH 2 (Ω)
(3.18)
ku − uh kL2 (Ω) ≤ Ch2 kukH 2 (Ω)
1
u(x) ' (x − eα(x−1) ).
a
The solution behaves, asymptotically, as the sum of two contributions: a linear
function and an exponential term that becomes significant as x gets closer to 1.
The exponential term is called boundary layer term because it is responsible for
the variation of u from the value 1/a to the boundary condition u(1) = 0. As in the
reaction-diffusion case, it can be proved that the width δ of the boundary layer is
of the order of α −1 , therefore it gets smaller and smaller if diffusion is dominated
by advection in the model (3.19).
we have a · n < 0 (here, n = −1) and outflow boundary (the point x = 1), where
we have a · n > 0 (here, n = +1), having denoted by n the outward unit normal on
∂ Ω.
Matlab coding. The Matlab script for computing and plotting u is reported below.
close all
x=[0:0.0001:1];
b=1; mu=[1, 1e-1, 1e-2];
a=b./mu;
for k=1:numel(a),
u(k,:)=1/b*(x- (exp(a(k)*x)-1)/(exp(a(k))-1));
end
plot(x,u(1,:),’k-.’,x,u(2,:),’k--’,x,u(3,:),’k-’)
xlabel(’x’)
legend(’\alpha=1’,’\alpha=10’,’\alpha=100’)
(J(u))0 = f
in Ω = (0, 1)
J(u) = −µu0 + au
in Ω
(3.21)
u(0) = 0
u(1) = 0.
The above system is called the conservative form of the AD problem. In particular,
Eq. (3.21)1 represents the law of conservation of the advective-diffusive flux J(u)
defined in Eq. (3.21)2 . The two formulations (3.19) and (3.21) are completely
equivalent in the case where µ and a are constant coefficients.
Theorem 3.2.4. Problem (3.22) is uniquely solvable and u satifies the same esti-
mate (3.4) as for the RD problem.
Proof. Let us check that B satisfies the conditions required by the Lax-Milgram
Lemma, because F(·) is the same as in the case of the RD problem.
• continuity of B:
Z 1 Z 1
0 0
|B(u, v)| ≤ µ |u | |v | dx + a |u0 ||v| dx
0 0
≤ µkukV kvkV + akukV kvkL2 (0,1)
≤ (µ + aCP )kukV kvkV ∀u, v ∈ V,
• coercivity of B:
Z 1
B(u, u) = µkukV2 +a u0 u dx ∀u ∈ V.
0
We have
1
u0 u = (u2 )0
2
so that Z 1 Z 1
0 1
u u dx = (u2 )0 dx = 0
0 2 0
Since all the assumptions of the Lax-Milgram Lemma are verified, the solution u
of (3.22) exists and is unique in V , and satisfies (3.4).
The stiffness matrix B is positive definite in virtue of Thm. 2.1.2, so that the
discrete problem (2.1) admits a unique solution. Moreover, Ceà’s Lemma tells us
that, assuming u ∈ H r+1 (0, 1)
a
ku − uh kV ≤ C 1 + hr kukH r+1 (0,1) . (3.23)
µ
In conclusion, the explicit form of the linear algebraic system (2.4) in the case
r = 1, h = 1/Mh and f = 1 is
2µ µ a
− + 0/
u1 1
h h 2
2µ
−µ − a .. u2 1
.
h 2 h µ a
= h
.
.. ..
.. ..
. . − +
.
.
h 2
µ a 2µ
0/ − − uNh 1
h 2 h
(3.24)
We notice that in the case of the AD problem the stiffness matrix B is no longer
symmetric as in the case of the RD problem. As a matter of fact, the diffusion
matrix Bd is symmetric (and positive definite), while the advection matrix Ba is
not symmetric.
In the case f = 1, we immediately see that a barrier function for the AD prob-
lem is φ (x) = x/a, so that the application of the comparison principle A.1.3 allows
us to conclude the following result.
Theorem 3.2.6 (Maximum principle for the AD problem). The solution of (3.19)
satisfies the maximum principle (MP)
1
0 ≤ u(x) ≤ ∀x ∈ [0, 1]. (3.25)
a
Remark 3.2.7. The analysis of Thm. 3.2.6 is confirmed by Fig. 3.6 where a =
1. The conclusions of Rem. A.1.5 apply obviously also to the case of the AD
problem.
Let us now investigate under which conditions the finite element approximate
solution uh of (3.19) enjoys a DMP, by applying the discrete comparison princi-
ple 3.1.8. As in the RD case, we need to ascertain that Bi j ≤ 0. The entries Bi,i−1
are ≤ 0 because a > 0, while the coefficients Bi,i+1 are nonpositive iff
µ a
− + ≤ 0,
h 2
that is, if the following (more conservative) condition is satisfied
where
ah
Pead := (3.27)
2µ
is the non-dimensional Pèclet number associated with the advection-diffusion
problem.
Remark 3.2.8 (Definition of Pèclet number). If a < 0, the definition of the Pèclet
number becomes
|a|h
Pead := . (3.28)
2µ
Theorem 3.2.9 (DMP principle). Assume that (3.26) is satisfied. Then B = Bd +
Ba is an M-matrix and uh satisfies the DMP
1
0 ≤ uh (x) ≤ ∀x ∈ [0, 1]. (3.29)
a
Proof. It suffices to apply the discrete comparison principle with e = [1, 1, . . . , 1]T ∈
RNh and then apply Thm. 3.1.7.
Example 3.2.10 (Advection-dominated problem). The upper bound on the Pèclet
number (3.26) is equivalent to enforcing an upper limiting value for the mesh size
h, that is
2µ
h< := hmax (3.30)
a
The corresponding minimum number of (uniform) mesh elements is
1 a
Mh,min = round = round . (3.31)
hmax 2µ
If h does not satisfy (3.30), then spurious oscillations are likely to occur in the
computed solution uh preventing the DMP from being verified. To see this, we
study BVP (3.19) in the case where µ = 5 · 10−3 , a = 1 and f = 1, and start to
take Mh = 10 uniform partitions of [0, 1], i.e., h = 1/10 = 0.1. Condition (3.30)
would require h < 10−2 , i.e., Mh ≥ 100, to guarantee a DMP for uh , therefore, we
expect numerical difficulties to occur. This is exactly what is shown in Fig. 3.7.
Wild oscillations arise in the neighbourhood of the boundary layer, at x = 1, and
propagate throughout the whole computational domain, polluting completely the
correct behaviour of the exact solution.
Things drastically change if we take Mh = Mh,min = 100. The result is shown in
Fig. 3.8. Oscillations have disappeared, and it can be checked that max uh (x) =
x∈[0,1]
3.2. ADVECTION-DIFFUSION MODEL PROBLEM 57
Figure 3.7: Plot of exact and approximate solutions (r = 1) in the case µ = 5·10−3
and Mh = 10
0.99 in agreement with Thm. 3.2.9 which predicts uh (x) ≤ 1/a = 1 for all x ∈
[0, 1], so that the DMP is satisfied.
A closer glance to uh reveals that in the neighbourhood of the outflow bound-
ary layer, the accuracy of the approximation is not very good, because h is not
sufficiently small to “capture” the steep gradient of u. On the other hand, it is
quite clear that the mesh size is excessively refined outside the layers, where the
exact solution is practically linear. To clarify this issue in a quantitative manner,
we compute the discrete maximum norm of the error u − uh in the case of Fig. 3.3
obtaining ku − uh k∞,h = 0.13534, and it can be checked that the maximum nodal
error occurs in correspondance of the last internal node. A trade-off between nu-
merical stability and accuracy may be obtained using a non-uniform partition Th ,
where the mesh size is smaller close to the boundary layers and larger elsewhere.
The result of the application of this latter strategy is shown in Fig. 3.9, where the
number of intervals (Mh = 100) is the same used in Fig. 3.8, but with a different
distribution of the element size. In particular, h is equal to 0.1 in [0, 0.9] and equal
to 0.1/90 in [0.9, 1]. With this choice of the grid, the accuracy is highly improved,
58 CHAPTER 3. ELLIPTIC PROBLEMS: THEORY AND FES
Figure 3.8: Plot of exact and approximate solutions (r = 1) in the case µ = 5·10−3
and Mh = 100..
and the maximum nodal error is ku − uh k∞,h = 0.001513, i.e., almost 100 times
smaller than in the case of a uniform mesh.
Figure 3.9: Plot of exact and approximate solutions (r = 1) in the case µ = 5·10−3
and Mh = 100, where the finite element mesh is non-uniform.
to a stabilized form of the GFEM as in (3.15), where the modified bilinear form
Bh is defined as
Z 1
Bh (uh , vh ) = B(uh , vh ) + µΦ(Pead )u0h v0h dx ∀uh , vh ∈ Vh . (3.32)
0
| {z }
bh (uh ,vh )
The additional contribution bh represents the discrete weak form of the artificial
diffusion term
−µΦ(Pead )u00
so that the generalized GFEM (3.15), with Bh as in (3.32), can be regarded as the
standard GFE approximation of the modified advection-diffusion two-point BVP:
Φ(t) ≥ 0 if t ≥ 0; (3.34a)
lim Φ(t) = 0. (3.34b)
t→0+
denote the modified diffusion coefficient. Then, the Pèclet number of the modified
AD problem is
fad := ah =
Pe
ah
=
Pead
. (3.36)
2µh 2µ(1 + Φ(Pead )) 1 + Φ(Pead )
Proposition 3.2.12 (Choice of Φ). Let Pead be the Pèclet number associated with
the AD problem (3.19) on a given triangulation Th . Then, we have
Theorem 3.2.13 (Stability of the GFEM with artificial diffusion). If the stabiliza-
tion function Φ satisfies (3.37), then the solution uh computed by the GFEM with
artificial diffusion satisfies the DMP for every value of Pead .
where
t
B(t) :=
et−1
is the inverse of the Bernoulli function, such that B(−t) = t + B(t). Ex-
panding et in Mc Laurin series, we see that B(0) = 1. Moreover, we have
the following asymptotical behavior:
0 t >0 t t >0
lim B(t) = lim B(−t) =
t→∞ −t t <0 t→∞ 0 t < 0.
Theorem 3.2.14 (DMP principle (revisited)). Problem (3.15) with the UP and SG
stabilizations admits a unique solution that satisfies the DMP (3.9) for every value
of the Pèclet number Perd .
Proof. The stiffness matrix B e=B e d + Ba is positive definite, so that (3.15) is
uniquely solvable. From definitions (3.38) and (3.39), we see that both stabi-
lization functions satisfy Prop. 3.2.12, so that the UP and SG generalized GFE
formulations both satisfy the DMP due to Thm. 3.2.13.
62 CHAPTER 3. ELLIPTIC PROBLEMS: THEORY AND FES
Using the asymptotical properties of (3.39), we can also see that ΦSG (Pead ) '
ΦUP (Pead ) for large values of the Pèclet number, so that the two schemes produce
the same approximation. Things behave very differently if Pead is small. As a
matter of fact, we have
2t 1 t2
lim ΦSG (t) ' t − 1 + 2
= t − 1 + = = t 2,
t→0 4t 1+t 1+t
1 + 2t + −1
2
which shows that the amount of artificial diffusion introduced by the SG stabiliza-
tion is far smaller than that of the UP stabilization, for which we have
ΦUP (t) = t t → 0.
Therefore, in a moderately to weakly advection-dominated regime, we expect the
SG and UP stabilized GFEMs to produce substantially different approximations,
that computed by the SG method being characterized by a better accuracy than
that of the UP method. As a matter of fact we have the following result.
Theorem 3.2.15 (Convergence in the discrete maximum norm). Assume that µ, a
and f are given continuous functions on [0, 1], and let h be sufficiently small. Then,
the UP and SG stabilized GFEMs are both convergent in the discrete maximum
norm and we have
ku − uh k∞,h ≤ Ch Upwind stabilization, (3.40a)
1 eαxi − 1
uh (xi ) = u(xi ) = xi − α i = 1, . . . , Nh . (3.41)
a e −1
Remark 3.2.17. Relation (3.41) expresses the property of nodal exactness of the
SG GFEM, and tells us that the approximate solution uh computed by the SG
stabilized formulation coincides with the Π1h interpolant of the exact solution of
the AD BVP (3.19). Because of the above particularly exceptional accuracy of
the SG method, this latter is also known as exponential fitting method or optimal
artificial diffusion method.
3.2. ADVECTION-DIFFUSION MODEL PROBLEM 63
Theorem 3.2.18 (Convergence in the V -norm). Let u ∈ H r+1 (Ω) be the solution
r be the corresponding approximation computed by the
of (3.19) and uh ∈ Vh = Xh,0
generalized GFEM (3.15) with artificial diffusion. Then, for h sufficiently small,
we have
hr Φ(Pead )
ku − uh kV ≤ C kukH r+1 (Ω) + kukH r+1 (Ω) . (3.42)
µ(1 + Φ(Pead )) 1 + Φ(Pead )
Fig. 3.11 shows the numerical solutions computed on a very coarse grid by the
UP and SG methods. We see that both approximations satisfy the DMP, the UP
approximation being not very accurate in the layer region while the SG approx-
imation is nodally exact. The L2 error, the H 1 error and the error in the discrete
maximum norm are equal to 0.17371, 3.2014 and 0.047619 for the UP method,
while are equal to 0.16871, 3.2559 and 7.7716e-16 for the SG method (round-off
error).
Chapter 4
Abstract
In this chapter, we describe the principal issues that characterize the implemen-
tation in a computational algorithm of the GFEM. For ease of presentation, we
restrict the analysis to the case where the domain Ω is a 2D polygon, with Lips-
chitz boundary Γ = ∂ Ω and outward unit normal vector n. The model boundary
value problem considered in this chapter is:
(
Lu := div(−µ∇u) + a · ∇u + σ u = f in Ω
(4.1)
u=0 on Γ,
where µ, σ and f are continuous functions in Ω, a is a continuously differentiable
vector field over Ω and g is a continuous function over Γ. The BVP (4.1) is
a representative example of a diffusion-advection-reaction differential problem.
The advection field a is a given two-dimensional vector field with components
ax = ax (x, y), ay = ay (x, y), having denoted with x = (x, y)T the position vector in
Ω. The reaction coefficient σ is ≥ 0 over Ω while the diffusion coefficient µ is
such that 0 < µmin ≤ µ(x) ≤ µmax for all x ∈ Ω. Dirichlet boundary conditions
are assumed only for ease of presentation of the method. For more general types
of boundary conditions we refer to Chapt. 1 and to the documentation of the 2D
finite element code EF2D that has been used to show the performance of the 2D
GFEM on test cases for which the exact solution is available. The code, developed
by Marco Restelli, can be downloaded at the link:
⇒ https://beep.metid.polimi.it/
65
66 CHAPTER 4. 2D IMPLEMENTATION OF THE GFEM
1
σ (x) − diva(x) ≥ 0 ∀x ∈ Ω, (4.3)
2
it is immediate, using the Lax-Milgram Lemma, to check that (4.2) admits a
unique (weak) solution such that
Definition 4.2.1 (Aspect ratio). For each element K ∈ Th , we define the aspect
ratio as
hK
RK := . (4.5)
ρK
Definition 4.2.2 (Regular triangulation). A triangulation Th is said to be regular
if there exists a positive constant κ, independent of h, such that
RK ≤ κ ∀K ∈ Th . (4.6)
4.3. POLYNOMIAL SPACES IN 2D 67
Remark 4.2.3. The regularity condition practically means that every triangle of Th
cannot have an arbitrarily large aspect ratio, as it would be the case, for example,
shown in Fig. 4.1(b) where RK → ∞ as the rightmost vertex is moved along the
right-hand direction. Equivalently, condition (4.6) prevents the minimum angle of
Th from being too small. From now on, we assume that each member of Th is a
regular triangulation.
The monomial basis used in (4.7) is, in general, not the most preferable for
computations. An equivalent choice is represented by the set of Lagrangian (local)
basis functions ϕi = ϕi (x), with ϕi ∈ Pr (K) for i = 1, . . . , Nr (K), such that
ϕi (x j ) = δi j i, j = 1, . . . , Nr (K), (4.10)
where xi , i = 1, . . . , Nr (K) are the coordinates of the nodes over the element K.
The nodal positions of the dofs for Pr (K) in the cases r = 1, 2, 3 are illustrated in
Fig. 4.2. We see that in the case r = 3, dofs are also located in the interior of K
and not only along its boundary ∂ K.
where Nh (r) is the dimension of Vh and represents the number of linearly indepen-
dent basis functions spanning Vh . Such functions, denoted by ϕi , i = 1, . . . , Nh (r),
are the global basis functions whose restriction over each element K is one of
the Nr (K) local basis functions introduced in (4.10), while the real numbers vi ,
i = 1, . . . , Nh (r), are the nodal values of vh (see Fig. 4.3).
Remark 4.4.1 (Dimension of Vh ). The count of Nh (r) proceeds in the same manner
as in the 1D case. We first need to determine the number of dofs Nr,i (K) that are
internal to each element K. We have
r2 + 3r + 2
Nr (K) = 3 + 3(r − 1) + Nr,i (K)
= |{z}
2 | {z } | {z }
vertices edges internal
Under assumption (4.3) it is easy to use Lax-Milgram Lemma to check that (4.14)
admits a unique solution uh that satisfies the same a priori estimate (4.4) valid for
the solution u of (4.2). Moreover, assuming that u ∈ H s (Ω) ∩ H01 (Ω), s ≥ 2 being
a given quantity, the discretization error satisfies the estimate (2.18), which in the
present case takes the following form
where l := min {r, s − 1}. Under the same assumptions above, the following error
estimate in the L2 norm can also be proved
In both estimates (4.15) and (4.16), the quantity C is a positive constant indepen-
dent of h and depending on the mesh regularity constant κ.
Remark 4.5.1. Estimate (4.15) tells us that the numerical solution on the com-
puter machine of problem (4.14) may be negatively influenced by three possible
sources: 1) large variation of the diffusion coefficient; 2) large dominance of ad-
vection; 3) large dominance of reaction. In each of these three cases, the choice
of h that ensures a small error may be strongly penalized with respect to situa-
tions where problem coefficients vary more gently over Ω. In the case 1), we have
µmax /µmin 1, in the case 2) we have kakC0 (Ω) /µmin 1 and in the case 3) we
have kσ kC0 (Ω) /µmin 1. In all of such cases, suitable stabilization techniques
(generalizing those analyzed in Chapt. 3) have to be adopted.
4.6. THE LINEAR SYSTEM 71
Bu = f, (4.17)
Remark 4.6.1. The stiffness matrix B is positive definite, but not symmetric.
Using the property of addivity of an integral, we can write
Z
Bi j = ∑ µ∇ϕ j · ∇ϕi + (a · ∇ϕ j )ϕi + σ ϕ j ϕi dK i, j = 1, . . . , Nh (r)
K∈Th | K {z }
BK
ij
Z
Fi = ∑ f ϕi dK i = 1, . . . , Nh (r).
K∈Th | K {z }
fiK
(4.18)
Relations (4.18) tell us that the computation of the global stiffness matrix and
of the global load vector is reduced to a for-loop over each element K ∈ Th that
computes:
• a local stiffness matrix BK ∈ RNr (K)×Nr (K) ;
BK (ϕ j , ϕi ) = B(ϕ j |K , ϕi |K ), i, j = 1, . . . , Nh (r);
72 CHAPTER 4. 2D IMPLEMENTATION OF THE GFEM
Figure 4.4: Local and global numbering of nodes and elements (r = 1).
Matlab coding. A Matlab script for assembling B and f is reported below. The
list of the functions, variables and parameters is commented here:
4.7. THE ASSEMBLY PHASE 73
• get local coordinates dofs is the function that recovers the x and y
coordinates of the Nr (K) dofs over the element K; these coordinates are
contained in the two arrays X dofs K and Y dofs K;
• compute local stiffness matrix is the function that computes the lo-
cal stiffness matrix BK using a suitable 2D quadrature formula;
• compute local load vector is the function that computes the local load
vector fK using a suitable 2D quadrature formula;
• N nodes tot represents the total number of nodes (i.e., the interior nodes
Nh (r) plus the boundary nodes);
• the input parameters mu, a, sigma and f are function pointers to compute
problem coefficients.
B = sparse(N_nodes_tot);
f = sparse(N_nodes_tot,1);
for K=1:N_K
[X_dofs_K, Y_dofs_K] = get_local_coordinates_dofs(X,Y,K);
B_K = compute_local_stiffness_matrix(mu,a,sigma,X_dofs_K,Y_dofs_K);
f_K = compute_local_load_vector(f,X_dofs_K,Y_dofs_K);
for i_loc = 1:N_dofs_loc
row = T(i_loc,K);
for j_loc = 1:N_dofs_loc
col = T(j_loc,K);
B(row,col) = B(row,col) + B_K(i_loc,j_loc);
end
f(row) = f(row) + F_K(i_loc);
end
end
Remark 4.7.1 (The boundary conditions). To account for the homogeneous bound-
ary conditions u|Γ = 0, we need to eliminate all the rows and columns of B and all
the rows of f that correspond to nodes belonging to Γ.
Matlab coding. The Matlab commands for enforcing Dirichlet homogeneous
boundary conditions are reported below. The variable Dir nodes contains the
list of nodes of Th which belong to Γ.
>> B(Dir_nodes,Dir_nodes) = [];
>> f(Dir_nodes) = [];
⇒ https://beep.metid.polimi.it/
Figure 4.5: Numerical solution of the homogeneous Dirichlet problem for the
Laplace operator using r = 1.
Tables 4.1, 4.2 and 4.3 show the errors measured in the H 1 and L2 as a function
4.8. 2D EXPERIMENTAL CONVERGENCE STUDY OF THE GFEM 75
h ku − uh kV ku − uh kL2
0.5 9.78837e − 01 1.12889e − 01
0.025 5.90571e − 01 4.03202e − 02
0.0125 3.03473e − 01 1.03154e − 02
0.00625 1.54287e − 01 2.67608e − 03
0.00312 7.64671e − 02 6.52262e − 04
Table 4.1: Convergence analysis for the GFE method with r = 1 in the case of the
homogeneous Dirichlet problem for the Laplace operator.
h ku − uh kV ku − uh kL2
0.5 2.96266e − 01 1.63666e − 02
0.025 7.70054e − 02 2.29500e − 03
0.0125 1.70161e − 02 2.40015e − 04
0.00625 4.14263e − 03 2.86345e − 05
0.00312 1.01035e − 03 3.38010e − 06
Table 4.2: Convergence analysis for the GFE method with r = 2 in the case of the
homogeneous Dirichlet problem for the Laplace operator.
The approximation errors in the H 1 and L2 norms are also displayed in a log-
log plot as a function of h and of r in Fig. 4.6. The slopes of the various curves
provides the information about the order of convergence of the method.
76 CHAPTER 4. 2D IMPLEMENTATION OF THE GFEM
h ku − uh kV ku − uh kL2
0.5 2.28341e − 02 8.22032e − 04
0.025 3.74118e − 03 7.12394e − 05
0.0125 4.13323e − 04 3.70496e − 06
0.00625 5.27815e − 05 2.39387e − 07
0.00312 6.53857e − 06 1.44786e − 08
Table 4.3: Convergence analysis for the GFE method with r = 3 in the case of the
homogeneous Dirichlet problem for the Laplace operator.
Figure 4.6: Log-log plots of the errors in the case of the homogeneous Dirichlet
problem for the Laplace operator. Left: H 1 error. Right: L2 error.
where the function mapquad2rect computes the map that transforms the refer-
ence square [−1, 1]2 into the rectangle [α, β ] × [γ, δ ]:
(a) Pe2D
ad = 0.25 (b) Pe2D
ad = 25
79
81
This part addresses the study of the Navier-Lamè equations for linear elasticity
in the compressible and incompressible regimes. Theory is carried out in a gen-
eral three-dimensional setting while numerical approximation using the GFEM is
addressed in two spatial dimensions (plane stress/plane strain).
82
Chapter 5
Abstract
In this chapter we illustrate the Navier-Lamè equations of linear elasticity in the
general three dimensional case and in the compressible regime.
x10 − x1
r0 − r := u = x20 − x2 ,
x30 − x3
83
84 CHAPTER 5. 3D COMPRESSIBLE ELASTICITY
Figure 5.1: Elastic body: geometrical notation; undeformed and deformed con-
figurations; loads and constraints.
where the coordinates of the point P in the deformed state are denoted with a (·)0
superscript. The local measure of the deformation of the body is given by the
Green-Lagrange deformation tensor
1 ∂ ui ∂ uk ∂ ul ∂ ul
Uik := + + (5.1)
2 ∂ xk ∂ xi ∂ xi ∂ xk
where the Einstein convention of repeated indices has been used in the third term
at the right-hand side.
Definition 5.1.1 (The strain tensor). Assume that deformations are small, i.e.
∂ ul
∂ xi 1. (5.2)
having used (A.7) in the last equality. The last identity is consistent with the fact
that
Tr(∇u) = Tr(∇S u) + Tr(∇SS u) = Tr(∇S u) = Tr(ε),
because the trace of a skew-symmetric tensor is identically zero, by definition.
Remark 5.1.2 (Small deformations/small displacements). The assumption of small
deformations does not necessarily imply that also displacements are small. To see
this, consider the case of a long thin rod under large deflection conditions, in which
the motion of the end points of the rod may be non-negligible but the extensions
and compressions in the rod are small. In practice, however, the displacement
vector u for a three-dimensional body under small deformation is itself small.
This amounts to adding, from now on, to (5.2) the so-called small displacement
assumption
|ui | `, (5.5)
where ` is a characteristic length of the 3D body.
` − `0 d − d0
ε := , εt :=
`0 d0
86 CHAPTER 5. 3D COMPRESSIBLE ELASTICITY
denote the longitudinal and transveral deformation, respectively. Define also the
normal stress (in N/mm2 , or MPa)
F
σ :=
A0
where A0 is the areal cross-section of the body, and the transversal contraction
coefficient
εt
ν := − .
ε
Definition 5.1.3 (Reversibility). The relation σ − ε is reversible whenever, if the
applied force is released, the deformation is completely recovered, i.e., the body
returns to the original (undeformed) configuration. In mathematical terms, this
corresponds to assuming that the relation σ = σ (ε) is invertible.
Definition 5.1.4 (The linear relation: Hooke’s law). Within a certain deformation
range, i.e., if we have
0 ≤ |ε| ≤ εmax ,
then, the relation σ − ε is linear, i.e., we have
σ = Eε (5.6)
where E is the so-called Young modulus (in MPa). Relation (5.6) is universally
known as Hooke’s law (“Ut tensio, sic vis”). In the general 3D case, (5.6) be-
comes
σi j = Ci jkl εkl i, j, k, l = 1, 2, 3 (5.7)
or, in tensor notation
σ = C ε. (5.8)
The fourth-order tensor C is called the elastic matrix of the material and the
34 = 81 quantities Ci jkl are the elastic constants of the material. Relation (5.7) is
the so-called generalized Hooke’s law.
The constraint of the stress and deformation tensors to be symmetric
and the fact that the body energy functional is a symmetric and positive definite
quadratic form
∂ σi j ∂ σkl
= ,
∂ εkl ∂ εi j
5.1. ESSENTIALS OF SOLID MECHANICS 87
allow us to conclude that the elastic tensor C is symmetric, so that the 81 constants
reduce to (36-6)/2+6=21, and the matrix form of (5.7) reads
C1111 C1122 C1133 C1112 C1123 C1131
σ11 ε11
σ22 C2222 C2233 C2212 C2223 C2231 ε22
C3333 C3312 C3323 C3331
σ33
ε33 . (5.9)
σ12 = C1212 C1223 C1231 2ε12
Sym
C2323 C2331 2ε23
σ23
σ31 C3131 2ε31
| {z } | {z } | {z }
σ C ε
Remark 5.1.5 (Voigt notation). Eq. (5.9) adopts a matrix format to express the
generalized Hooke law and strongly simplifies the representation of the stress ten-
sor. This approach is widely used in both theoretical and numerical treatment of
solid mechanics problems and is well-known as Voigt notation.
Remark 5.1.8 (Limits for E and ν). The Young modulus E is a strictly positive
quantity. The Poisson modulus, in principle, satisfies
The limiting case ν = 0.5 is critical, as can be seen from definition (5.12) because
λ becomes infinite. In this situation, the elastic material is said to be incompress-
ible and B can deform under the condition that its volume remains constant. This
case will be studied in detail in Chapter 7.
Using (5.10) and (5.11), the stress-strain relation in matrix form yields
σ11 λ + 2µ λ λ 0 0 0 ε11
σ22
λ + 2µ λ 0 0 0 ε22
σ33
= λ + 2µ 0 0 0 ε33
(5.14)
σ12
Sym µ 0 0 2ε12
σ23 µ 0 2ε23
σ31 µ 2ε31
| {z } | {z } | {z }
σ C ε
σi j, j + fi = 0 in Ω (5.17a)
σi j = Ci jkl εkl = 2µεi j + λ εkk δi j in Ω (5.17b)
1
εi j = (ui, j + u j,i ) in Ω (5.17c)
2
ui = 0 on ΓD (5.17d)
σi j n j = g i on ΓN . (5.17e)
Remark 5.2.1. The mathematical model (5.16) is usually referred to as the Navier-
Lamè system for linear isotropic elasticity. It is clearly possible to eliminate the
strain and stress fields from the constitutive laws (5.17c)-(5.17b) in favor of the
sole displacement field u to obtain the following form of the Navier-Lamè system:
find ui : Ω → R3 such that:
The BVP (5.18) is called displacement formulation of elasticity because the only
remaining dependent variable is the displacement field u.
90 CHAPTER 5. 3D COMPRESSIBLE ELASTICITY
Remark 5.2.2 (Reaction forces). Integrating (5.16a) over the body volume yields
Z
(divσ + f) dΩ = 0.
Ω
Enforcing the Neumann boundary condition (5.16d), we obtain the following re-
lation that expresses the global balance of forces that act on the material body
where:
Using Green’s formula to treat the first term, enforcing the Neumann boundary
conditions on ΓN and the Dirichlet boundary conditions for v on ΓD , we obtain:
find u ∈ V such that
Z Z Z
σ (u) : ∇v dΩ = f · v dΩ + g · v dΓ ∀v ∈ V.
Ω Ω ΓN
− f · v dΩ − g · v dΓ ∀v ∈ V,
Ω ΓN
ε(v) = 0 ∀v ∈ R.
a+b×x = 0 ∀x ∈ ΓD
from which, necessarily, we must have a = b = 0. This proves that the only
admissible rigid body motion for the elasticity problem is v(x) = 0 for all x ∈ Ω,
which is (5.27).
The combined use of Korn’s inequality (5.25), of Prop. 5.4.2 and of the Cauchy-
Schwarz inequality allow us to prove the following result.
Proof. For every v ∈ V , we have (omitting the explicit dependence on v for nota-
tional clarity)
kεk2L2 (Ω) = ∑3i, j=1 kεi j k2L2 (Ω) = ∑3i=1 kεii k2L2 (Ω)
(5.29)
+ 2kε12 k2L2 (Ω) + 2kε13 k2L2 (Ω) + 2kε23 k2L2 (Ω) .
The sum of the first three terms on the right-hand side yields
3 3
∂ vi 2
2
kεii k 2 =
∑ L (Ω) ∑ ∂ xi L2(Ω).
(5.30)
i=1 i=1
As for the sum of the other three terms, we have, for the first contribution
1 ∂ v1 ∂ v2 2
Z
2kε12 k2L2 (Ω)=2 + dΩ
Ω 2 ∂ x2 ∂ x1
1 ∂ v1 2 ∂ v 2
2
∂ v
1
∂ v
2
≤ + + 2 ,
2
∂ x2 L2 (Ω) ∂ x1 L2 (Ω) ∂ x2 L2 (Ω) ∂ x1 L2 (Ω)
and similarly for the other two contributions. Noting that for every a, b ∈ R we
have 2ab ≤ a2 + b2 , the previous inequality yields
∂ v 2 ∂ v 2
1 2
2kε12 k2L2 (Ω) ≤ 2 + . (5.31)
∂ x2 L (Ω) ∂ x1 L2 (Ω)
Combining this latter inequality with Korn’s inequality (5.25), we obtain (5.28).
94 CHAPTER 5. 3D COMPRESSIBLE ELASTICITY
kC k∞ = 3λ + 2µ.
M = 3λ + 2µ. (5.33)
from which
Z
B(u, u) = 2µkukV2 + λ divu δ : ε(u) dΩ
ZΩ
= 2µkukV2 + λ (divu)2 dΩ ≥ 2µkukV2 ∀u ∈ V.
Ω
β = 2µ. (5.34)
5.4. EXISTENCE AND UNIQUENESS OF THE WEAK SOLUTION 95
Using Poincarè’s inequality, the Trace Theorem C.7.7 and Thm. 5.4.4, we
finally get
Theorem 5.4.5 (Well posedness of the elasticity problem). Problem (5.22) admits
a unique solution u ∈ V that satisfies the a priori estimate
B(u, u) = F(u)
and then use the coercivity of B, the continuity of F and relations (5.34) and (5.35).
96 CHAPTER 5. 3D COMPRESSIBLE ELASTICITY
Chapter 6
Abstract
In this chapter we consider the Navier-Lamè equations of linear elasticity in the
two-dimensional (2D) case (plane stress and plane strain conditions). We first ap-
ply the general machinery of weak formulation and then we construct the Galerkin
Finite Element approximation of the mechanical problem. Computational tests to
validate the numerical performance of the method are run in Matlab using the
code EF2D el H developed by Marco Restelli and modified by Riccardo Sacco an
Aurelio Giancarlo Mauri. The code is available at the link:
⇒ https://beep.metid.polimi.it/
97
98 CHAPTER 6. 2D ELASTICITY
form
σ = Cε (6.1)
where C ∈ R3×3 is the elastic matrix, σ is the 2D stress tensor (in vector form)
σxx
σ := σyy ,
τxy
and where, denoting by u = [u, v]T the 2D displacement field, the 2D strain tensor
(in vector form) is defined as
εxx ∂ u/∂ x
ε := εyy = ∂ v/∂ x . (6.2)
∂ u/∂ y + ∂ v/∂ x
γxy
• the thickness of the body is small compared to the dimensions of the body
in the other two directions (example: plates);
• the acting loading forces are applied in the symmetry plane of the thickness
and do not have other transversal components with respect to such a plane.
z
L L>>t
y
x
Assuming that the xy plane coincides with the mid-plane of the body thickness
and that the z-axis is perpendicular to the xy plane, the plane stress problem is
mathematically identified by the following conditions
σzz = 0, τzx = τzy = 0. (6.3)
The corresponding elastic matrix is
1 ν 0
E
C= ν 1 0 . (6.4)
1 − ν2
0 0 (1 − ν)/2
Remark 6.1.1. The strain component εzz is, in general, nonnull, and can be post-
computed as
ν
εzz = − (εxx + εyy ).
1−ν
L>>h
y
L
h x
z
Figure 6.2: Plane strain.
Remark 6.1.2. The stress component σzz is, in general, nonnull, and can be post-
computed as
σzz = ν(σxx + σyy ).
3 3
uh (x, y) = ∑ ui ϕiK (x, y), vh (x, y) = ∑ vi ϕiK (x, y),
i=1 i=1
where, for i = 1, 2, 3:
• ϕiK is the restriction over K of the corresponding global basis function de-
fined over Th (see Fig. 4.3);
is the so-called local matrix of the shape functions. Using the kinematic rela-
tion (5.3) we obtain the following expression for the discrete strain tensor over the
element K
ε K (x, y) = BK (x, y)dK
where
ε11 (x, y)
ε K (x, y) := ε22 (x, y)
γ12 (x, y)
and the local strain matrix is
∂ ϕ1K (x, y) ∂ ϕ2K (x, y) ∂ ϕ3K (x, y)
0 0 0
∂x ∂x ∂x
∂ ϕ1K (x, y) ∂ ϕ2K (x, y) K
∂ ϕ3 (x, y)
BK (x, y) := 0 0 0 .
∂y ∂y ∂y
∂ ϕ1K (x, y) ∂ ϕ1K (x, y) ∂ ϕ2K (x, y) ∂ ϕ2K (x, y) ∂ ϕ3K (x, y) K
∂ ϕ3 (x, y)
∂y ∂x ∂y ∂x ∂y ∂x
Remark 6.2.3 (CST). Clearly, since the shape functions ϕiK are linear in x and y,
it turns out that the local strain matrix BK (x, y) is constant, and consequently also
ε K (x, y) is a constant tensor. For this reason, the finite element corresponding to
the choice r = 1 is well-known as CST or Constant Strain Triangle.
Remark 6.2.4 (Higher-order FE spaces). Higher-order approximations of displace-
ment and strain can be obtained by taking r > 1 (see Fig. 4.2). All the formulas
written above continue to apply provided to replace 3 with Ndofs, where
1
Ndofs = (r + 1)(r + 2)
2
To construct the local stiffness matrix, we simply need to define the local bilinear
form associated with the global bilinear form B(uh , vh ). We have
Z Z
BK (uh , vh ) := C ε(uh ) : ε(vh ) dK = (C BK dK )T (BK vK ) dK
K Z K
= (dK )T (BK )T C BK dK vK ∀K ∈ Th ,
K
where C is the symmetric matrix (i.e., such that C T = C ) given by (6.4) in plane
stress conditions or by (6.6) in plane strain conditions. From the above relation,
we identify Z
KK := (BK )T C BK dK ∈ R6×6
K
as the local stiffness matrix associated with element K, so that we can write in a
synthetic notation
BK (uh , vh ) = (dK )T KK vK .
The vector vK ∈ R6 contains cyclically the dofs associated with the test function
vh , and is taken equal to ei = [0, 0, . . . , 1, 0, . . . , 0]T , i = 1, . . . , 6.
| {z }
in the i-th position
To construct the local load vector, we define the local linear form associated
with the global form F(vh ). We have
Z Z
F K (vh ) := f · vh dK + g · vh dσ
ZK ∂ K∩Γ
Z N
= f · NK vK dK + g · NK vK dσ
ZK ∂ZK∩ΓN
K K T
= (N v ) f dK + (NK vK )T g dσ
K Z ∂ K∩Γ
ZN
= K T
(v ) K T
(N ) f dK + K T
(N ) g dσ ∀K ∈ Th .
K ∂ K∩ΓN
as the local load vector associated with element K, so that we can write in a syn-
thetic manner
F K (vh ) = (vK )T FK = (FK )T vK .
6.2. THE GFE APPROXIMATION IN THE 2D CASE 105
The vectors f = f(x, y) = [ fx (x, y), fy (x, y)]T and g = g(x, y) = [gx (x, y), gy (x, y)]T
contain the functions describing the external volume and surface applied loads.
As discussed in Sect. 4.7, to evaluate FK a suitable quadrature formula is needed.
To compute the contribution associated with f in the case of linear finite elements,
a simple and appropriately accurate formula is the two-dimensional extension of
the trapezoidal rule (see Sect. F.2) given by
3
|K|
Z
η(x, y) dK ' ∑ η(xi , yi )
K i=1 3
Theorem 6.2.5 (Error estimate for the GFEM applied to Linear Elasticity). Let us
denote by u and uh ∈ Vh the solution of (5.22) and of the GFE approximation (6.8),
respectively. Assume also that u ∈ (H s (Ω))2 ∩ V , s ≥ 2 being a given quantity
representing the regularity of the exact solution. Then, the following a priori
error estimate hols
M 2D `
ku − uh kV ≤ CTh h kuk(H `+1 (Ω))2 (6.11)
β 2D
106 CHAPTER 6. 2D ELASTICITY
where ` := min {r, s − 1} is the usual regularity threshold, CTh is a positive con-
stant depending on κ but not on the discretization parameter h and M 2D , β 2D
are the continuity and coercivity constants of the bilinear form B(·, ·) in the plane
stress/plane strain regimes, given by
E
1+ν plane stress
M 2D =
E (6.12)
2(λ + µ) = plane strain
(1 + ν)(1 − 2ν)
E
β 2D = 2µ = plane stress and plane strain.
1+ν
Proof. The estimate (6.11) is the result of the straightforward application of Ceà’s
Lemma (cf. Chapters 2 and 4). To compute the values of the constants M 2D and
β 2D we follow the same steps as in Sect. 5.4 by setting
εxx (x, y)
ε(x, y) := εyy (x, y)
εxy (x, y)
and
a b 0
C (x, y) = b a 0 .
0 0 c
where in the case of plane stress conditions a = E/(1 − ν 2 ), b = νa and c = 2µ =
E/(1 + ν), while in the case of plane strain conditions a = λ + 2µ, b = λ and
c = 2µ.
Concerning continuity of B(·, ·) we immediately get
|B(u, v)| ≤ kC k∞ kε(u)k(L2 (Ω))2 kε(v)k(L2 (Ω))2 ≤ (a + b)kukV kvkV u, v ∈ V,
Using Prop. 6.2.6 we immediately obtain that B(·, ·) is a coercive bilinear form
with β given by the expression β 2D given in (6.12).
Remark 6.2.7 (The dependence on ν). The ratio M 2D /β 2D in the case of plane
stress regime is equal to 1. Therefore, we can conclude that the choice of the
mesh size in order to obtain a small error is determined only by the regularity of
the exact solution.
Instead, in the case of plane strain regime the ratio M 2D /β 2D is equal to
1/(1 − 2ν) which shows that M 2D /β 2D is a bounded quantity (of the order of
unity) as long as ν is sufficiently less than 0.5 (for example, ν = 0.33, as in the
case of steel). In such a situation, the choice of the mesh size in order to obtain
a small error is determined only by the regularity of the exact solution. This is
no longer true when ν becomes close to 0.5, i.e., as the elastic material becomes
incompressible. In such a situation, the ratio M 2D /β 2D → +∞ and the choice of
the mesh size in order to obtain a small error is furtherly penalized by the incom-
pressibility condition. The practical result of this analysis is that the computed
deformation is severely affected by the so-called volumetric locking, unless the
mesh size is extremely small. This introduces a strong limitation in the use of the
Navier-Lamè model equations (5.16) in the incompressible limit, and an alterna-
tive approach to overcome such a limitation will be the object of Chapt. 7.
Remark 6.2.8 (The 3D case). Applying Cea’s Lemma as done in the 2D case, one
can prove a 3D analogue of Thm. 6.2.5 in the case where {Th }h>0 is a family of
regular triangulations made of tetrahedral elements, provided to replace M 2D and
β 2D with the continuity and coercivity constants M and β determined in Sect. 5.4
and given by (5.33) and (5.34), reapectively. Therefore, since these latter constants
coincide with those of the 2D plane strain elastic problem, the same considerations
valid for this regime can also be applied to the 3D elastic problem.
Figure 6.4: Constant stress patch test: geometry, boundary conditions and applied
loads having set Kx = Ky = 1 in (6.14), (6.15) and (6.16).
Data are chosen in such a way that the exact solution of the 2D plane stress
elasticity problem is the displacement field
E νE νE E
σxx = 2
Kx + 2
Ky , σyy = 2
Kx + Ky , τxy = 0.
(1 − ν ) (1 − ν ) (1 − ν ) (1 − ν 2 )
(6.16)
6.3. NUMERICAL EXAMPLES 109
Matlab coding. The following Matlab commands can be used to compute the me-
chanical response of the elastic body and the H 1 and L2 norms of the discretization
error u − uh .
>> EF2D_el_H
Error norms:
||u-u_h||_{H^1} --> 3.70702e-15
||u-u_h||_{L^2} --> 2.90620e-16
||p-p_h||_{L^2}--> 5.93407e-01
The results clearly demonstrate that the solution is nodally exact (up to ma-
chine precision), as expected.
Matlab coding. The following Matlab commands can be used to evaluate the
maximum displacement after application of the external loads.
>> max(abs(U_ux))
ans =
>> max(abs(U_uy))
ans =
y3 xy2
u= , v=
10 10
while the corresponding stress field is
λ xy (λ + 2µ)xy 2µy2
σxx = , σyy = , τxy = .
5 5 5
The Lamè parameters λ and µ in the previous expressions can be computed as a
function of the elastic material constants using relations (5.12). Since u is a cubic
function of (x, y), we expect the GFEM (with r = 1) to introduce a discretization
error. Fig. 6.7 shows the deformed configuration of the beam computed by the
GFEM on a mesh of right-angled triangles of size h = 1/5.
Matlab coding. The following Matlab script allows to generate the computational
mesh of Fig. 6.7. The command pdemesh(p,e,t) allows to visualize the grid.
N=5;
[p,e,t]=poimesh(’squareg’,N,N);
p(1,:)=0.5*(p(1,:)+1);
p(2,:)=0.5*(p(2,:)+1);
pdemesh(p,e,t)
Tab. 6.1 reports the computed errors in the H 1 and L2 norms as a function of
h. Results clearly indicate a linear reduction of ku − uh kV (for each row, the next
error is halved with respect to that of the considered row), while ku − uh k(L2 (Ω))2
decreases quadratically vs. h (for each row, the next error is divided by a factor of
22 = 4 with respect to that of the considered row). These results agree with (6.11)
(in the case r = 1 and s = +∞) and with Thm. 2.2.6. Fig. 6.8 shows the log-log
plot of the error u − uh , measured in the H 1 and L2 norms, respectively.
h ku − uh kV ku − uh k(L2 (Ω))2
0.2 2.71368e-02 2.16674e-03
0.1 1.33554e-02 5.63020e-04
0.05 6.61045e-03 1.42246e-04
0.025 3.28992e-03 3.56057e-05
0.0125 1.64201e-03 8.89275e-06
Abstract
In this chapter, we apply the general machinery of weak formulation and Galerkin
Finite Element approximation to the case of the Navier-Lamè equations of lin-
ear elasticity in the incompressible regime. To deal with the incompressibility
condition (and avoid the volumetric locking phenomenon), we introduce the so-
called Hermann formulation of the elasticity problem, through the introduction of
an additional unknown, the pressure parameter, and we discuss the compatibil-
ity condition that needs be satisfied in order the resulting discrete scheme to be
stable. Several choices of stable and unstable pairs of finite element spaces (for
displacement and pressure, respectively) are considered and analyzed in the 2D
case. Computational tests to validate the numerical performance of the method
are run in Matlab using the code EF2D el H developed by Marco Restelli and
modified by Riccardo Sacco and Aurelio Giancarlo Mauri. The code is available
at the link:
⇒ https://beep.metid.polimi.it/
115
116 CHAPTER 7. INCOMPRESSIBLE ELASTICITY
div u = 0. (7.1)
In the case of a fluid, the above condition means that the fluid velocity u is
solenoidal.
∆V
Tr ε(u) = = 0, (7.2)
V
where ∆V /V represents the volumetric strain occurring in the three-dimensional
(3D) elastic body due to the applied stress.
From a mechanical point of view, it is useful to express condition (7.2) in
terms of the representative parameters of the material. Using definitions (5.12),
we first introduce the shear modulus
E
G := ≡µ
2(1 + ν)
K 2 λ
ρ := = + (7.3)
G 3 µ
7.2. THE INCOMPRESSIBLE REGIME IN TWO SPATIAL DIMENSIONS117
Summing and subtracting the quantity Eνεxx /(1 − ν 2 ) in the expression for σxx
we get
E Eν Eν Eν
σxx = 2
− 2
εxx + 2
divu = 2µεxx + divu.
1−ν 1−ν 1−ν 1 − ν2
Thus, in summary we can write the generalized Hooke law in the two-dimensional
plane stress condition as
2D
σ = 2µε + λPlaneStress divu δ , (7.7)
where
2D Eν Eν
λPlaneStress := 2
= . (7.8)
1−ν (1 + ν)(1 − ν)
In plane strain conditions we have:
E(1 − ν) Eν
σxx = εxx + εyy
(1 + ν)(1 − 2ν) (1 + ν)(1 − 2ν)
Eν E(1 − ν)
σyy = εxx + εyy (7.9)
(1 + ν)(1 − 2ν) (1 + ν)(1 − 2ν)
E
τxy = γxy .
2(1 + ν)
where
2D Eν
λPlaneStrain := . (7.11)
(1 + ν)(1 − 2ν)
7.3. VOLUMETRIC LOCKING: EXAMPLES 119
Thus, consistently with the different forms assumed by the elastic matrix C in
plane stress and plane strain conditions, also the generalized Hooke’s law assumes
different forms in the two regimes. These forms characterized by two different
expressions of the second Lamè parameter λ . In particular, we see that under the
assumption ν > 0, volumetric locking may occur only in plane strain conditions. If
ν is allowed to vary in the admissible range −1 < ν < 1/2 we see that volumetric
locking may occur also in plane stress conditions because
2D
lim λPlaneStress = +∞.
ν→−1+
Unless otherwise specified, from now on we always assume that ν ∈ [0, +1/2] and
we denote the second Lamè parameter as λ , the distinction between plane stress
and plane strain conditions being understood.
The solution of the elastic problem (5.16) is a function of the elastic Lamè
parameters λ and µ, so that we can write
u = u(λ , µ).
120 CHAPTER 7. INCOMPRESSIBLE ELASTICITY
To the purpose of analysis, let us assume that µ = 1 and perform a study as a func-
tion of the sole remaining parameter λ ∈ [0, +∞]. A computation of the solution
of the elastic problem yields the results reported in Tab. 7.1, which indicate that as
the material becomes incompressible, the deformation tends to a limit (non null)
value of almost 18%.
λ maximum deformation
10 0.21662
104 0.17676
107 0.17716
λ maximum deformation h
10 0.212 1/32
107 0.0003 1/64
The numerically computed values of the deformation indicate that the approx-
imate deformation accurately represents the exact one only when λ is very small.
The percentage error is in such a case
|0.21662 − 0.212|
εrel = × 100 % ' 2 %.
0.21662
Things are very different, however, when the material approaches the incompress-
ible regime (λ = 107 ). As a matter of fact, despite the mesh size is halved with
respect to the case λ = 10, the maximum deformation is practically null, and
εrel ' 100 %. The fact that the material does not exhibit an appreciable deforma-
tion is a manifestation of the so-called volumetric locking.
The reasons for such an unphysical performance of the numerical formulation
were anticipated in Rem. 6.2.7. As a matter of fact, in the case where λ = 107 ,
7.3. VOLUMETRIC LOCKING: EXAMPLES 121
we have (1 + λ /(2µ)) = O(107 ) in the a-priori error estimate (6.11). This implies
that to have a small error, we need to take h much smaller than 1/64, at least of the
order of hmin = 10−7 , if we make the (non precise) assumption that kuk(H 2 (Ω))2 =
O(1). Should h be chosen signficantly larger than hmin (as in the present example),
it is no surprise that the corresponding error is very large and volumetric locking
occurs.
Example 7.3.1 (Kinematic interpretation of locking). From the results of the previ-
ous example, one is tempted to draw the conclusion that the only discrete solution
in the space Vh (with r = 1) that is also compatible with the incompressibility
constaint (7.1), is
uh (x, y) = 0 ∀(x, y) ∈ Ω. (7.12)
To check the correctness of this claim, let us consider the geometrical representa-
tion of Fig. 7.3.1 which shows a (very coarse) triangulation of the domain Ω, and
assume λ = +∞ (exact incompressibility).
Since the body has to deform at constant volume, the area of all mesh trian-
gles must remain the same. Referring in particular to triangle 1, the constraint of
constant area prevents node A from moving along the y direction, but allows only
for an horizontal motion. At the same time, node A belongs also to triangle 2, so
that, in order to maintain the area constant, no horizontal motion is permitted to
node A, but only vertical. This, however, is prohibited by the previous analysis,
so that the conclusion is that the only admissible motion for node A is uA = 0.
This argument applies also to node B and to all the remaining other nodes, from
which it follows that the only piecewise linear continuous deformed configuration
compatible with (7.1) is the null function of (7.12).
122 CHAPTER 7. INCOMPRESSIBLE ELASTICITY
3λ
p= ℘. (7.18)
2µ + 3λ
The new variable p is referred to as the pressure parameter, because (7.18) shows
that
lim p = ℘, (7.19)
λ →+∞
that, is, in the incompressible limit the pressure parameter coincides with the hy-
drostatic pressure.
Remark 7.4.2. For brevity, we shall refer to the pressure parameter p as the pres-
sure. As noted above, there should not be confusion between pressure and hydro-
static pressure, these two quantities being related through (7.18).
Replacing (7.17) into the Navier-Lamè model (5.16), we obtain, for λ > 0, the
following novel formulation of the linear elasticity problem:
find the displacement u : Ω → R3 and the pressure p : Ω → R such that:
Remark 7.4.4 (A unified model). Except for the special case λ = 0 (corresponding
to a material that does not exhibit trasverse contraction in its mechanical response
and that can be treated by using the standard Navier-Lamè model), system (7.20)
is well defined for every λ ∈ (0, +∞]. For this reason, its use is by no means
restricted to the (nearly) incompressible regime, but can be adopted also for the
study of compressible materials. In this sense, system (7.20) can be regarded as a
unified formulation of linear elasticity.
to obtain
Z Z
v · σ (u, p)n dΓ − σ (u, p) : ε(v) dΩ ∀v ∈ V.
Γ Ω
The boundary integral can be treated as done in Sect. 5.3. The volume integral
becomes
Z Z
σ (u, p) : ε(v) dΩ = (2µε(u) − pδ ) : ε(v) dΩ
ΩZ ΩZ
The fact that v ∈ V implies that the function div v belongs to L2 (Ω). Thus, using
Thm. 1.3.1, we have that a sufficient condition for the function p div v to belong
to L1 (Ω) is that p belongs to L2 (Ω). Concluding, the appropriate function space
where to seek the pressure is
Q := L2 (Ω), (7.21)
7.6. ABSTRACT FORM OF THE HERRMANN SYSTEM 125
and the weak formulation of the Herrmann model for elasticity reads:
find u ∈ V and p ∈ Q such that, for all v ∈ V and for all q ∈ Q we have:
Z Z Z Z
2µε(u) : ε(v) dΩ − p div v dΩ = f · v dΩ + g · v dΓ
Ω Ω Ω ΓN
1
Z Z
−
q div u dΩ − p q dΩ = 0.
Ω λ Ω
(7.22)
1
Z
d(p, q) = − p q dΩ,
λ Ω
Theorem 7.6.1 (Elimination of the pressure). If λ < +∞, the abstract prob-
lem (7.23) is equivalent to the abstract problem (5.22).
Proof. If λ < +∞, the second equation of (7.23) gives
Z
(p + λ div u) q dΩ = 0 ∀q ∈ Q,
Ω
which tells us that the element p + λ div u of the space Q = L2 (Ω) is orthogonal
to every element q of Q with respect to the usual scalar product in L2 (Ω). Thus,
p + λ div u is the null element of Q, that is
p = −λ div u a.e. in Ω.
Replacing the above relation into the first equation of (7.23) gives immediately
back the abstract problem (5.22).
Remark 7.6.2 (The role of the pressure in the incompressible case). From the
proof of Thm. 7.6.1, we immediately see that in the exactly incompressible case
(λ = +∞), the elimination of the pressure from (7.23)2 is no longer possible,
so that the pressure has to be determined by solving the full two-by-two coupled
system (7.23). Therefore, while in the compressible regime the pressure is an aux-
iliary variable (not strictly necessary for the solution of the elasticity problem), in
the incompressible limit the pressure is necessary for the solution of the problem.
To overcome this fundamental difficulty of the exactly incompressible regime, a
popular approach in Computational Mechanics consists of introducing a (small)
additional compressibility to the mechanical behavior of the solid, in order to end
up with a modified problem of the form (7.23) to which Thm. 7.6.1 can be applied.
This approach is known as the B-bar method.
Remark 7.7.1. From (7.24a) and the (mechanical) fact that no information is given
on the normal stress (and thus, on p) on the boundary, it immediately follows that
if p∗ is a solution, also p∗ +C is a solution, C being an arbitrary constant.
Because of (7.24c), the function space where to seek the displacement is
V = (H01 (Ω))3 .
Because of Rem. 7.7.1, an appropriate choice for the function space where to seek
the pressure is
Z
2 2
Q = L0 (Ω) := q ∈ L (Ω) | q(x) dΩ = 0 .
Ω
Adding the further requirement on the pressure to have zero mean over Ω allows to
fix in a unique manner the arbitrary constant C introduced in Rem. 7.7.1. This ap-
proach closely resembles what already done in the case of the non-homogeneous
Neumann problem (see Rem. 1.4.7).
The weak problem associated with (7.24) is:
find u ∈ V and p ∈ Q such that, for all v ∈ V and for all q ∈ Q we have:
Z Z Z
2µε(u) : ε(v) dΩ − p div v dΩ = f · v dΩ
ΩZ Ω Ω
(7.25)
− q div u dΩ
= 0.
Ω
The inf-sup condition is also known as LBB condition, from the names of the
various mathematicians that, over the last 40 years, have given fundamental con-
tributions to its development and analysis: Olga Ladinszeskaya, Franco Brezzi
and Ivo Babuska.
Remark 7.7.4 (Weak coercivity). The inf-sup condition can be regarded as a prop-
erty of weak coercivity of the bilinear form b(·, ·). The constant γ plays here the
role of β in the Lax-Milgram Lemma 1.5.1.
Theorem 7.7.5 (Existence, uniqueness and a priori estimate). Let f be a given
function in (L2 (Ω))3 , and assume that the compatibility condition (7.26) is sat-
isfied. Then, the weak problem (7.25) admits a unique solution pair (u, p) ∈
(V × Q), such that
CP
kukV ≤ kfk(L2 (Ω))3 (7.28a)
2µ
2CP
kpkQ ≤ kfk(L2 (Ω))3 . (7.28b)
γ
Proof. To prove the uniqueness of the solution pair (u, p), we proceed by as-
suming that there exist two distinct pairs that satisfy (7.25), namely, (u1 , p1 ) and
(u2 , p2 ), and then try to show that, necessarily, one must have u1 = u2 and p1 = p2 .
Subtracting the two weak formulations in correspondance of the two distinct so-
lution pairs we obtain
Z Z
2µε(u1 − u2 ) : ε(v) dΩ − (p1 − p2 ) div v dΩ = 0 ∀v ∈ V
ΩZ Ω
−
q div (u1 − u2 ) dΩ = 0 ∀q ∈ Q.
Ω
(7.29)
Now, take v = u1 − u2 and q = −(p1 − p2 ) and sum (7.29)1 and (7.29)2 , to get
Z
2µε(u1 − u2 ) : ε(u1 − u2 ) dΩ = 0,
Ω
that is
ku1 − u2 kV2 = 0 ⇒ u1 = u2 .
This proves that the displacement is unique.
To prove now that the pressure is unique, set P := p1 − p2 . Then, from (7.29)1 ,
we get (recall that u1 = u2 !)
Z
P div v dΩ = 0 ∀v ∈ V.
Ω
7.7. WELL-POSEDNESS ANALYSIS OF THE TWO-FIELD MODEL 129
kPkQ = 0 ⇒ p1 = p2 .
Using the Cauchy-Schwarz inequality and the Poincarè inequality to treat the
right-hand side, and the definition of equivalent norm in V to treat the left-hand
side, we immediately get (7.28a).
Let us now come to the a-priori bound for the pressure. From (7.25)1 , we find
Z Z Z
p div v dΩ = 2µε(u) : ε(v) dΩ − f · v dΩ ∀v ∈ V,
Ω Ω Ω
Thus, using (7.26) with q = p, we have, for, at least, one particular v∗ ∈ V such
that v∗ 6= 0
Z
∗
γkv kV kpkQ ≤ p div v∗ dΩ ≤ 2CP kfk(L2 (Ω))3 kv∗ kV ,
Ω
where
1
Z Z
2
Φv (q) := − q dΩ − q divv dΩ v ∈ V. (7.32)
2λ Ω Ω
∂ Φv (q) Φv (q + δ η) − Φv (q)
= lim =0 ∀η ∈ Q
∂q δ →0 δ
yields Z
1
− q + div v η dΩ = 0 ∀η ∈ Q,
Ω λ
from which we conclude that the element
1
z := q + div v ∈ Q
λ
7.8. ENERGY FORMULATION OF INCOMPRESSIBLE ELASTICITY 131
is orthogonal (with respect to the inner product in L2 (Ω)) to all elements of Q, i.e.
∂ 2 Φv (q) 1
Z
2
=− η 2 dΩ < 0 ∀η ∈ Q.
∂q λ Ω
where
1
Z Z
Πλ (v, q) = µε(v) : ε(v) dΩ − q2 dΩ
Ω 2λ Ω
Z Z Z (7.34)
− qdiv v dΩ − f · v dΩ − g · v dΓ
Ω Ω ΓN
that of (5.23). The main disadvantage related to the solution of the saddle-point
formulation is the introduction of an auxiliary unknown (the pressure parame-
ter) which makes the method more computationally expensive, and, above all, the
need of satisfying the inf-sup condition (7.26) also on the discrete level (this issue
will be thouroughly addressed in Sect. 7.9). The main advantage provided by the
use of the saddle-point formulation compared to the minimum energy principle
(or the B-bar method) is represented by the fact that in the incompressible limit,
Πλ (v, q) does not break down, unlike J(v), rather it tends to the limiting value
Z Z Z Z
Π+∞ (v, q) = µε(v) : ε(v) dΩ − qdiv v dΩ − f · v dΩ − g · v dΓ.
Ω Ω Ω ΓN
In this sense, the saddle-point formulation is robust with respect to the compress-
ibility parameter λ over the whole range λ ∈ (0, +∞].
Vh ⊂ V, Qh ⊂ Q.
Mh
where {u1 , u2 , . . . , uNh , v1 , v2 , . . . , vNh }T and p j j=1 are the sets of dofs for uh
and ph , respectively. Replacing the expressions (7.36) into (7.35) and taking vh =
[φi , 0]T and vh = [0, φi ]T , respectively, for i = 1, . . . , Nh , in (7.35)1 , and qh = ψi ,
i = 1, . . . , Mh in (7.35)2 , yields the following linear algebraic system
K U=F (7.37)
where
A BT
" # " # " #
u F
K = , U= , F= . (7.38)
B 0 p 0
The matrices A and B have the following block-form structure
Auu Auv
" #
Bqu Bqv
A= , B=
Avu Avv
where Auu , Auv , Avu and Avv are square matrices each of size Nh , while Bqu and
Bqv are rectangular matrices each of size Mh × Nh . The entries of each sub-block
matrix in A are given by
Z
Auu
ij = 2µε([φ j , 0]T ) : ε([φi , 0]T ) dΩ i, j = 1, . . . , Nh
ZΩ
Auv
ij = 2µε([0, φ j ]T ) : ε([φi , 0]T ) dΩ i, j = 1, . . . , Nh
ZΩ
Avu
ij = 2µε([φ j , 0]T ) : ε([0, φi ]T ) dΩ i, j = 1, . . . , Nh
ZΩ
Avv
ij = 2µε([0, φ j ]T ) : ε([0, φi ]T ) dΩ i, j = 1, . . . , Nh
Ω
134 CHAPTER 7. INCOMPRESSIBLE ELASTICITY
= fx φi dΩ + gx φi dΓ i = 1, . . . , Nh
ZΩ ΓN Z
= fy φi dΩ + gy φi dΓ i = 1, . . . , Nh .
Ω ΓN
Matrix A is symmetric and positive definite, and has 2Nh rows and 2Nh columns,
while matrix B is rectangular and has Mh rows and 2Nh columns. The right-hand
side F is a vector with 2Nh rows. The construction of these matrices and vector
proceeds in the same fashion as described in Sect. 6.2.1.
Remark 7.10.3 (Equal order interpolation). Since Thm. 7.10.2 tells us that sat-
isfying the discrete inf-sup condition is equivalent to stating that matrix B has
full rank, the discrete inf-sup condition is often referred to as the rank condition.
From (7.41), it turns out that the rank condition introduces the constraint for the
approximation space of the displacement field of being richer than that of the
pressure field. A consequence of (7.41) is that the use of equal-order polynomial
spaces for both Vh and Qh is in general not allowed except suitable stabilization
techniques are adopted.
136 CHAPTER 7. INCOMPRESSIBLE ELASTICITY
Having introduced the discrete version of the inf-sup condition, we can pro-
ceed as in Thm. 7.7.5, to prove the following result.
Theorem 7.10.4 (Unique solvability of the discrete Herrmann formulation). As-
sume that Vh and Qh satisfy the discrete inf-sup condition (7.39). Then, prob-
lem (7.35) admits a unique solution pair (uh , ph ) ∈ (Vh × Qh ), such that
CP
kuh kV ≤ kfk(L2 (Ω))3 (7.42a)
2µ
2CP
kph kQ ≤ kfk(L2 (Ω))3 . (7.42b)
γ∗
We can also prove the following result, that represents the extension of Ceà’s
Lemma to the two-field formulation.
Theorem 7.10.5 (Ceà’s Lemma for the Herrmann formulation). Assume that Vh
and Qh satisfy the discrete inf-sup condition (7.39). Then, there exists a positive
constant C independent of h such that
ku − uh kV + kp − ph kQ ≤ C inf ku − vh kV + inf kp − qh kQ (7.43)
vh ∈Vh qh ∈Qh
where (u, p) and (uh , ph ) are the solution pairs of problems (7.25) and (7.35),
respectively.
The previous result tells us that the discretization error (left-hand side) is
bounded by the approximation error (right-hand side). Let:
Uh := inf kv − vh kV ∀v ∈ V
vh ∈Vh
(7.44)
Ph := inf kq − qh kQ ∀q ∈ Q.
qh ∈Qh
Theorem 7.10.6 (Convergence). Assume that Vh and Qh satisfy the discrete inf-
sup condition (7.39) and that the property of “good approximation” holds, i.e.
lim Uh = 0
h→0
(7.45)
lim Ph = 0.
h→0
Then, the approximate pair (uh , ph ) converges to the exact solution (u, p) of (7.25),
i.e.
lim (ku − uh kV + kp − ph kQ ) = 0. (7.46)
h→0
7.11. THE DISCRETE INF-SUP CONDITION 137
Moreover, if
lim Uh = O(h p )
h→0
(7.47)
lim Ph = O(h p )
h→0
for a certain p ≥ 1, then
ku − uh kV + kp − ph kQ ≤ Ch p (7.48)
Remark 7.10.7 (The order of convergence). In Thm. 7.10.6 we have assumed both
approximation errors Uh and Ph to be infinitesimals of the same order p with re-
spect to the discretization parameter h. This property implies the optimality of
the error estimate for the FE approximation of the Herrmann formulation. Let us
assume now that the finite element spaces for displacement and pressure are such
that:
lim Uh = O(h pu )
h→0
(7.49)
lim Ph = O(h p p )
h→0
for certain pu and p p such that pu , p p ≥ 1 with pu 6= p p . According to Thm. 7.10.2
and to Rem. 7.10.3, it turns out that p p < pu , so that, using (7.49) into the gener-
alized Ceà’s Lemma (7.43) we get the following error estimate
ku − uh kV + kp − ph kQ ≤ Ch p p . (7.50)
Comparing (7.50) with (7.48) we conclude that if the finite element space for the
pressure is too poor with respect to that for the displacement, the convergence of
the method is sub-optimal and the accuracy of the computation of the displace-
ment may be (negatively) affected by the accuracy of the computation of the pres-
sure. This undesired phenomenon is the effect of the coupling between the two
variables through the incompressibility condition.
Should a function p∗h exist, then this would immediately imply that if ph is a
solution of (7.35), then also ph + p∗h is a solution. In other words, there would be
no way for filtering out (from the correct solution) the presence of a parasitic (i.e.,
unphysical) solution component that adds to the right one. This is the reason for
calling p∗h a “spurious pressure mode”.
Theorem 7.11.2. Let Vh and Qh are such that the discrete inf-sup condition (7.39)
is satisfied. Then, p∗h = 0, i.e., no spurious mode can arise in the solution of (7.35).
Proof. We proceed by contradiction, and assume that a function p∗h , with p∗h 6= 0,
exists such that (7.51) holds. Then, we have
Z
0= p∗h div vh dΩ ≥ γ ∗ kp∗h kQ kvh kV with vh 6= 0
Ω
Remark 7.11.3. The previous result tells us that satisfying the discrete inf-sup con-
dition is an automatic guarantee of avoiding the occurrence of spurious pressure
modes in the numerical solution of incompressible elasticity problems.
• discontinuous pressures on Th ;
• continuous pressures on Th .
7.12. FINITE ELEMENTS FOR INCOMPRESSIBLE ELASTICITY 139
and
Qh = qh ∈ L2 (Ω) | qh |K ∈ P0 (K) ∀K ∈ Th .
The dofs for Vh and Qh over each element K ∈ Th are shown in Fig. 7.3.
Figure 7.3: Dofs for the P1 − P0 FE pair over K. Left: dofs for the displacement.
Right: dof for the pressure.
The P1 − P0 FE pair does not satisfy the discrete inf-sup condition and is
typically affected by severe locking phenomena. To see this, let us consider the
incompressibility constraint
Z
qh div uh dΩ = 0 ∀qh ∈ Qh .
Ω
140 CHAPTER 7. INCOMPRESSIBLE ELASTICITY
Since uh is linear over K, the above equation yields the strong condition
div uh = 0 ∀K ∈ Th .
Going back to Ex. 7.3.1 (cf. Fig. 7.3.1), it is immediate to see that this latter
condition implies that each triangle has to deform maintaining a constant area, so
that uh = 0 in Ω and the structure goes in complete locking.
A variant of the P1 − P0 element that passes the discrete inf-sup condition
(thus avoiding the locking problem) is the so-called (cross − grid − P1 ) − P0 FE
pair, whose dofs are depicted in Fig. 7.4.
Figure 7.4: Dofs for the (cross − grid − P1 ) − P0 FE pair over K. Left: dofs for
the displacement. Right: dof for the pressure.
The approximation space for the displacement consists of functions that are
linear over the sub-elements K1 , K2 and K3 , and are continuous across interelement
edges. In this case, the incompressibility constraint becomes
3
∑ div uh|Ki |Ki| = 0 ∀K ∈ Th ,
i=1
which does not admit as unique solution the displacement field uh = 0, so that
the solid body is free to deform, maintaining the area of K constant as required.
The (cross − grid − P1 ) − P0 FE pair satisfies the discrete inf-sup condition and
the following optimal error estimate can be proved to hold
and
Qh = qh ∈ L2 (Ω) | qh |K ∈ P1 (K) ∀K ∈ Th .
The dofs for Vh and Qh over each element K ∈ Th are shown in Fig. 7.5.
The P2 − Pdisc
1 FE pair does not satisfy the discrete inf-sup condition. To over-
come this problem, it is enough to enrich the space of displacements by adding
an extra (vectorial) degree of freedom at the center of gravity of the element K, as
depicted in Fig. 7.6.
The basis function bK that is added to those of the space (P2 (K))2 is a cubic
polynomial called bubble function, because it vanishes along all the boundary ∂ K
of the element and is identically equal to zero outside K. The locality of bK can
be advantageously exploited in the computer implementation of the scheme, by
eliminating each interior dof corresponding to bK in favor of those located on the
boundary of K. Such a procedure is called static condensation.
142 CHAPTER 7. INCOMPRESSIBLE ELASTICITY
Bk+1 (K) := {v ∈ Pk+1 (K) | v = pk−2 bK , pk−2 ∈ Pk−2 (K)} k≥2 (7.52)
and
Qh = qh ∈ C0 (Ω) | qh |K ∈ Pk (K) ∀K ∈ Th .
The above choice for Vh and Qh goes under the name equal-order interpolation
and has, in principle, the considerable advantage of allowing the use of the same
shape functions for displacement and pressure in coding. Unfortunately, it leads
to elements that do not satisfy the discrete inf-sup condition.
7.12. FINITE ELEMENTS FOR INCOMPRESSIBLE ELASTICITY 143
and
Qh = qh ∈ C0 (Ω) | qh |K ∈ Pr (K) ∀K ∈ Th
1 ≤ r ≤ k − 1.
The lowest order element of the family, corresponding to k = 2 and r = 1, is well-
known as the Taylor-Hood element, and its dofs are depicted in Fig. 7.7.
Notice that in the case of the Taylor-Hood element the dofs for the pressure
are located in correspondance of the vertices of K, so that they are single-valued
over the whole triangulation, while in the case of the P2 − Pdisc
1 FE pair of Fig. 7.5
the dofs for the pressure are not single-valued at each vertex of Th (see Fig. 7.8).
The Pk −Pcont
r FE pair satisfies the discrete inf-sup condition and the following
optimal error estimate can be proved (r = k − 1)
and
Qh = qh ∈ C0 (Ω) | qh |K ∈ P1 (K) ∀K ∈ Th
the space B3 being that defined in (7.52) in the case k = 2. The (P1 ⊕ B3 ) − Pcont
1
FE pair is also well-known as Mini-element, and has been proposed by Arnold,
Brezzi and Fortin in 1984. Its dofs are depicted in Fig. 7.9. The name Mini is
due to the fact that the (P1 ⊕ B3 ) − Pcont
1 FE pair is the most economical and LBB
stable element with continuous pressures. The following optimal error estimate
can be proved to hold for the Mini element
Figure 7.9: Dofs for the Mini element over K. Left: dofs for the displacement.
Right: dof for the pressure.
a number of:
• NE = 2N 2 elements;
• Nv = (N + 1)2 vertices;
• Nv D = 2(N + 1) − 1 = 2N + 1 vertices on ΓD ;
• Nv N = 2(N − 1) + 1 = 2N − 1 vertices on ΓN ;
• Ne D = 2N edges on ΓD ;
• Ne N = 2N edges on ΓN ;
• Ne = Ne i + Ne D + Ne N = 3N 2 + 2N edges.
In the example of Fig. 7.11, we have Nelem = 32, Nv = 25, Nv D = 9, Nv N = 7
and Nv i = 9, while Ne = 48, Ne D = Ne N = 4 and Ne i = 2N(N − 1) = 40.
and
dim Qh = NE = 2N 2 .
Thus, Mh = 2Nh and inequality (7.41) becomes in this special case an equality.
The computed deformed structure and pressure field are shown in Figs. 7.12(a)
and 7.12(b).
Results clearly indicate:
• no deformation of the structure (locking);
Figure 7.12: Computed solution with the P1 − P0 FE pair that does no satisfy the
discrete inf-sup condition.
>> EF2D_elinc
reading data
assembling stiffness matrix and load vector
Neumann boundary conditions
Dirichlet boundary conditions
solving the linear system
plot of solution
>> figure; pdesurf(griglia_conn.p,griglia_conn.t,U_p’)
>> xlabel(’x’)
>> ylabel(’y’)
>> title(’Pressure’)
>> max(abs(U_ux))
ans =
>> max(abs(U_uy))
ans =
Thus, Mh < 2Nh . The computed deformed structure and pressure field are shown
in Figs. 7.13(a) and 7.13(b). Results clearly indicate the absence of any locking
or spurious oscillations in the pressure distribution.
Figure 7.13: Computed solution with the P2 − P0 FE pair that satisfies the discrete
inf-sup condition.
Matlab coding. The following Matlab commands extract from the computed so-
lution of system (7.37) the maximum horizontal and vertical displacement com-
ponents.
>> EF2D_elinc
reading data
assembling stiffness matrix and load vector
Neumann boundary conditions
Dirichlet boundary conditions
solving the linear system
plot of solution
>> figure; pdesurf(griglia_conn.p,griglia_conn.t,U_p’)
>> max(abs(U_ux))
ans =
0.2708
>> max(abs(U_uy))
ans =
0.2642
7.13. LOCKING AND PRESSURE SPURIOUS MODES 149
dim Qh = Mh = Nv = (N + 1)2
Matlab coding. The following Matlab commands extract from the computed so-
lution of system (7.37) the maximum horizontal and vertical displacement com-
ponents. Notice the message warning us about the fact that the linear algebraic
system (7.37) is singular.
>> EF2D_elinc
reading data
assembling stiffness matrix and load vector
Neumann boundary conditions
Dirichlet boundary conditions
solving the linear system
Warning: Matrix is close to singular or badly scaled.
150 CHAPTER 7. INCOMPRESSIBLE ELASTICITY
ans =
0.2246
>> max(abs(U_uy))
ans =
0.2055
from which it follows that condition (7.41) is satisfied for every N ≥ 1. The com-
puted deformed structure and pressure field are shown in Figs. 7.15(a) and 7.15(b).
Results clearly indicate the absence of locking and spurious oscillations, in accor-
dance with the fact that the Mini-element satisfies the discrete inf-sup condition.
Figure 7.15: Computed solution with the Mini-element that satisfies the discrete
inf-sup condition.
7.14. CONVERGENCE ANALYSIS 151
Matlab coding. The following Matlab commands extract from the computed so-
lution of system (7.37) the maximum horizontal and vertical displacement com-
ponents. Notice how these latter are very close to those computed by the unstable
pair P1 − Pcont
1 , confirming the fact that not satisfying the discrete inf-sup condi-
tion does not prevent, in general, the displacement variable to be approximated
correctly. It is the pressure, however, that results completely inaccurate.
>> EF2D_elinc
reading data
assembling stiffness matrix and load vector
Neumann boundary conditions
Dirichlet boundary conditions
solving the linear system
plot of solution
>> figure; pdesurf(griglia_conn.p,griglia_conn.t,U_p)
>> xlabel(’x’)
>> ylabel(’y’)
>> title(’Pressure’)
>> max(abs(U_ux))
ans =
0.2241
>> max(abs(U_uy))
ans =
0.2173
Fig. 7.16, while the remaining lateral side is subject to a normal stress condition
T
hN = 0, −(sin(y))2 .
agreement with the theoretical conclusions of Sect. 7.12.2. Namely, we see that
the error in H 1 decreases as hk for the Mini element (k = 1), the P2 − Pcont
1 element
cont
(k = 2, r = 1) and the P3 − P2 element (k = 3, r = 2). For the same FE pairs,
the error in L2 decreases as hk+1 in agreement with Thm. 2.2.4.
also seen very clearly that the structure deforms in a counterclockwise sense, in
accordance with the applied volume forces and boundary tractions, and that the
area of the elastic body remains constant, in accordance with the incompressibility
7.14. CONVERGENCE ANALYSIS 155
constraint.
156 CHAPTER 7. INCOMPRESSIBLE ELASTICITY
Part IV
157
159
This part contains several examination problems with complete solution, includ-
ing theoretical questions, numerical tests and Matlab coding implementation.
160
Chapter 8
Abstract
In this chapter, we deal with the detailed solution of several examination prob-
lems, including theoretical and numerical questions, as well as their coding using
the Matlab software environment. During each exam, time left for solving the
three exercises is typically 3 hours and a half, and for each exercise a value in
“points” is assigned to allow the student a preliminary self-evaluation before exam
completion.
161
162 CHAPTER 8. SOLVED PROBLEMS
(a) plot the configuration of the deformed structure superposed to the original
undeformed configuration, and comment the obtained result based on the
symmetry of the problem;
(b) compute the resultant of ground reacting forces and check that global force
equilibrium is satisfied;
(c) compute the maximum horizontal and vertical displacements;
(d) plot the qualitative behavior of the computed pressure and give a mechanical
comment to the obtained result;
(e) repeat all the points (a), (b), (c) and (d) using the P1 -P1 FE pair, comparing the
obtained results with those of the Mini element. Which variable between u
and p turns out to be correctly approximated in the two cases? Why?
8.1. EXAMINATION OF JULY 09, 2012 163
−µ u00 + σ u = f
(
in Ω = (0, 1)
(P)
u(0) = u0 , u(1) = u1 ,
where µ and σ are constants > 0, u0 and u1 are constants, and f is a given function
in L2 (0, 1).
(a) Let R denote the lifting of boundary data. Write the weak formulation (W) of
problem (P), specifying the space V and the corresponding norm k · kV .
(b) Use the Lax-Milgram Lemma to verify that (W) admits a unique solution and
determine the a-priori estimate for kukH 1 .
(c) Assuming that the solution of (P) belongs to H s , with s ≥ 2 given, write the
error estimate for the GFEM of degree r ≥ 1 applied to the numerical ap-
proximation of (P) and discuss the estimate as a function of the relation
between r and s and of the ratio σ /µ.
(a) Set µ = 10−1 . Solve (P) with the GFEM using the code EF1D with r = 1, 2 and
3 on a family of uniform grids with N = [10, 20, 40, 80, 160] elements. Set
h := 1/N, report in a table the errors in the H 1 and L2 norms as functions of
h, and determine experimentally the order of convergence p for each con-
sidered degree r. Comment the obtained results based on the conclusions
drawn at point (c) of Exercise 2.
(b) Set now µ = 10−4 , N = 10 and r = 1. Compute the solution uh with these data
and report a plot of it superposing to that of the exact solution u. Compute
the error in the L2 norm and the absolute value of the maximum nodal error,
emax , and check if uh satisfies the DMP justifying the answer based on the
value of the local Pèclet number.
164 CHAPTER 8. SOLVED PROBLEMS
(c) Repeat point (b) using the same values of µ, N and r but using the lumping
method, and compare the obtained results.
(d) Determine the minimum number of intervals Nmin that are needed to make uh
satisfy the DMP, repeat point (b) with µ = 10−4 , N = Nmin and r = 1 (no
lumping) and compare the obtained results.
function g = Ex1_g(x,y)
% Dirichlet bcs
g = zeros(2,size(x,2));
return
function h = Ex1_h(x,y,marker)
% Neumann bcs
switch(marker)
case(1)
h(1,:) = y;
h(2,:) = 0*x;
case(2)
h(1,:) = 0*x;
h(2,:) = -1;
8.1. EXAMINATION OF JULY 09, 2012 165
case(3)
h(1,:) = -y;
h(2,:) = 0*x;
case(4)
h(1,:) = 0*x;
h(2,:) = 0*x;
case(5)
h(1,:) = 0*x;
h(2,:) = 0*x;
case(6)
h(1,:) = 0*x;
h(2,:) = 0*x;
otherwise
error(’Error in Neumann bcs!!’)
end
return
(a) The finite element mesh used to solve numerically the problem is generated
using the pdetool toolbox available in the Matlab software environment
and is shown in Fig. 8.2.
Matlab coding. Running the script EF2d elinc yields the following output.
The other Matlab commands allow to access the various dimensions of data
structure and problem unknowns.
>> EF2D_elinc
reading data
assembling stiffness matrix and load vector
Neumann boundary conditions
Dirichlet boundary conditions
solving the linear system
plot of solution
>> size(griglia_conn.p)
ans =
2 1107
>> size(griglia_conn.t)
ans =
4 2000
ans =
3107 1
ans =
3107 1
ans =
1107 1
The number of triangles is equal to 2000 and the number of vertices is 1107.
The total number of dofs for each component of the displacement uh is 3107
which equals the sum of 2000 (one internal dof per mesh triangle) plus the
number of vertices that do not belong to ΓD . The total number of dofs for
ph is equal to the number of vertices.
The deformed configuration computed by the numerical scheme using the
Mini element is shown in Fig. 8.3.
We can see that the structure deforms itself in a symmetric manner, ac-
cording to the symmetry of the geometry and of applied external loads. In
particular, the two lateral sides turn out to be subject to a compressive state
that produces a significant deformation. The incompressibility constraint is
responsible for the strong deflection of the internal vertical sides located at
x = −0.5 and x = 0.5, respectively. The horizontal side located at y = 1.5 is
8.1. EXAMINATION OF JULY 09, 2012 167
(b) Enforcing global equilibrium of horizontal and vertical applied forces with
the reaction forces R yields
Rx + 2 ∗ 2/2 − 2 ∗ 2/2 = 0 ⇒ Rx = 0
Ry + (−1) ∗ 1 = 0 ⇒ Ry = 1.
Matlab coding. The following Matlab commands allow to access the pro-
gram output variables containing the components of reaction forces.
>> R_tot
R_tot =
-0.0000
1.0000
(c)
Matlab coding. The following Matlab commands allow to compute the re-
quired quantities.
168 CHAPTER 8. SOLVED PROBLEMS
Uxmax =
0.3433
Ix =
118
>> griglia_conn.p(:,118)
ans =
-0.5888
1.0656
Uymax =
0.1164
Iy =
76
>> griglia_conn.p(:,76)
ans =
-0.6591
1.3636
The maximum horizontal and vertical displacements are 0.3433 and 0.1164,
respectively, and correspond to the deformed configuration of points P =
[−0.5888, 1.0656]T and Q = [−0.6591, 1.3636]T (in the original undeformed
structure).
(d)
Matlab coding. The following Matlab commands allow to plot the com-
puted pressure field in 3D.
that the points [−0.5, 1.5]T and [0.5, 1.5]T are subject to the highest com-
pressive state. Concerning with the part of the structure that is constrained
to ground, the point [−1, 0]T (symmetrically, [1, 0]T ) is subject to the highest
tensile stress, while the point [−0.5, 0]T (symmetrically, [0.5, 0]T ) is subject
to the highest compressive state, in agreement with the clockwise (counter-
clockwise) torque exerted by the horizontal linearly varying pressure force
distributed along the lateral side of the structure.
Matlab coding. The following Matlab commands allow to plot the maxi-
mum and minimum values of ph over the mesh and the corresponding nodal
coordinates in the structure.
>> [Pmax,Ip]=max(U_p)
Pmax =
19.8730
Ip =
5
170 CHAPTER 8. SOLVED PROBLEMS
>> griglia_conn.p(:,5)
ans =
-0.5000
1.5000
>> [Pmin,Ip]=min(U_p)
Pmin =
-12.0233
Ip =
>> griglia_conn.p(:,1)
ans =
-1
0
(e) Repeating the analysis previously done with the Mini element, but using the
P1 − P1 FE pair yields a similar result for the deformed structure configu-
ration, with maximum horizontal and vertical displacements of 0.3383 and
0.1152, respectively (to be compared with 0.3433 and 0.1164 in the case of
the Mini element). Computed reaction forces are again consistent with the
theoretical value R = [0, 1]T . However, as expected, the computed pressure
field is affected by numerical instabilities (oscillations) because the P1 − P1
FE pair does not satisfy the LBB compatibility condition. These oscillations
(wiggles) are clearly visible in Fig. 8.5, from which we can also see that the
maximum variation of the pressure is much higher than in the case of the
solution computed by the Mini element.
Matlab coding. The following Matlab commands allow to plot the maxi-
mum and minimum values of ph over the mesh and the corresponding nodal
coordinates in the structure.
>> [Pmax,Ip]=max(U_p)
Pmax =
40.2087
Ip =
8.1. EXAMINATION OF JULY 09, 2012 171
>> griglia_conn.p(:,6)
ans =
0.5000
1.5000
>> [Pmin,Ip]=min(U_p)
Pmin =
-26.1788
Ip =
>> griglia_conn.p(:,1)
ans =
-1
172 CHAPTER 8. SOLVED PROBLEMS
Defining
Z 1 Z 1
0 0
a(w, v) := µ w v dx + σ w v dx w, v ∈ V
0 0
Z 1
F(v) := f v dx − a(R, v) v ∈ V,
0
(b) In the solution of this point of the exercise, U and W are two generic functions
in V .
Z 1 Z 1
0 0
|a(U,W )| ≤ µ U W dx + σ UW dx
0 0
≤ µkUkV kW kV + σCP2 kUkV kW kV
Z 1 Z 1
a(U,U) = µ (U 0 )2 dx + σ U 2 dx = µkUkV2 + σ kUk2L2 (0,1) ≥ µkUkV2
0 0
Continuity of F(·):
Z 1
|F(W )| ≤ fW dx + |a(R,W )|
0
≤ k f kL2 (0,1) kW kL2 (0,1) + MkRkH 1 (0,1) kW kV
≤ CP k f kL2 (0,1) kW kV + MkRkH 1 (0,1) kW kV
Since the assumptions (1.31) of the Lax-Milgram Lemma are all satisfied,
we conclude that problem (W) admits a unique solution u0 ∈ V , such that
Λ
ku0 kV ≤ .
β
Thus, using triangular inequality and Poincarè‘s inequality, we get the fol-
174 CHAPTER 8. SOLVED PROBLEMS
In the case of the interval (0, 1), we have CP = 1, so that (8.2) yields
% nr. of elements
N = [10 20 40 80 160];
% degree of FEs
deg = 1;
% initialize errors
El2 = [];
Eh1 = [];
for ii=1:length(N)
% uniform mesh nodes
xnod = [0 : 1/(deg*N(ii)) : 1];
% mesh
griglia = struttura_griglia(xnod,deg);
% local basis functions
base = struttura_base(deg);
% system assembling phase
K = termine_diffusione(griglia,base,’coeff_mu’);
S = termine_reazione(griglia,base,’coeff_s’);
bv = termine_noto(griglia,base,’coeff_f’);
% boundary con ditions
dati_bordo = struct( ...
’bc’ , [1 1] , ... % type of condition
’gamma’ , [] , ... % parameter for Robin bc
’r’ , [] ... % boundary datum
);
A = K+S;
b = bv;
% Dirichlet bcs and matrix system partitioning
u_incognite = [2 : 1 : griglia.dim-1];
u_note = [1; griglia.dim];
A11 = A(u_incognite,u_incognite);
A12 = A(u_incognite,u_note );
A21 = A(u_note ,u_incognite);
A22 = A(u_note ,u_note );
b1 = b(u_incognite);
x2 = [u_ex(0); u_ex(1)]; % boundary values for u_h
% system solution
x1 = A11\(b1-A12*x2);
% inclusion of boundary values in the computed solution
x(u_incognite,1) = x1;
x(u_note ,1) = x2;
% post-processing/plot
[x_plot y_plot] = visualizza_soluzione(griglia,base,x,20);
plot(x_plot,u_ex(x_plot),’m’)
% errors
[eL2,eH1] = norme_errore(griglia,base,x,’u_ex’,’grad_u_ex’);
disp([’L2 Error : ’,num2str(eL2)]);
disp([’H1 Error : ’,num2str(eH1)]);
El2 = [El2, eL2];
Eh1 = [Eh1, eH1];
end
% asymptotic convergence orders
ph1 = log(Eh1(1:end-1)./Eh1(2:end))/log(2)
pl2 = log(El2(1:end-1)./El2(2:end))/log(2)
%%%%%%%%%%%%%%%%%%%%%%%
% Ex. 3: coefficients
%%%%%%%%%%%%%%%%%%%%%%%
function mu = coeff_mu(x)
% diffusion coefficient
global m
mu = m*ones(size(x));
return
%%%%%%%%%%%%%%%%%%%%%%%
function s = coeff_s(x)
% reaction coefficient
s = ones(size(x));
return
%%%%%%%%%%%%%%%%%%%%%%%
function f = coeff_f(x)
% source term
f = ones(size(x));
return
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Ex. 3: solution/gradient of solution
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function u = u_ex(x)
% exact solution
global m
a = sqrt(1/m);
C = (exp(a)-exp(-a))^(-1);
u = 1 + C*(exp(-a*x)-exp(a*x));
return
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function gradu = grad_u_ex(x)
% gradient of exact solution
global m
a = sqrt(1/m);
C = (exp(a)-exp(-a))^(-1);
gradu = -a*C*(exp(-a*x)+exp(a*x));
return
Running the Matlab codes shown before, we obtain the errors listed in
Tab. 8.1. Errors in the H 1 -norm are indicated by eh1 and errors in L2 -
norm are indicated by el2. Subscripts refer to the polynomial degree r that
is used. The orders of convergence, estimated using (D.9), are listed in
Tab. 8.2. All the obtained results are in complete agreement with the con-
clusions drawn at point (c) of Exercise 2. As a matter of fact, the present
case corresponds to a diffusion-dominated problem R = 1, so that, since
s = +∞, we expect a convergence of order hr in H 1 and hr+1 in L2 , respec-
tively.
(b)
Matlab coding. The following Matlab script solves Exercise 3(b).
%%%%%%%%%%%%%%
178 CHAPTER 8. SOLVED PROBLEMS
Table 8.1: H 1 -norm of the error (denoted by eh1) and L2 -norm of the error (de-
noted by el2) as functions of h = 1/N and r.
N p1 p2 p3 q1 q2 q3
20 0.9954 1.9937 2.9926 1.9943 2.9920 3.9911
40 0.9989 1.9984 2.9981 1.9986 2.9980 3.9978
80 0.9997 1.9996 2.9995 1.9996 2.9995 3.9994
160 0.9999 1.9999 2.9999 1.9999 2.9999 3.9998
% Ex. 3 (b)
%%%%%%%%%%%%%%
close all; clear all
global m
setfonts
m = 1e-4;
% nr. of elements
N = 10;
% degree of FEs
deg = 1;
% mesh size
h = 1/N;
% uniform mesh nodes
xnod = [0 : h: 1];
% mesh
griglia = struttura_griglia(xnod,deg);
% local basis functions
base = struttura_base(deg);
% system assembling phase
K = termine_diffusione(griglia,base,’coeff_mu’);
S = termine_reazione(griglia,base,’coeff_s’);
bv = termine_noto(griglia,base,’coeff_f’);
% boundary con ditions
dati_bordo = struct( ...
8.1. EXAMINATION OF JULY 09, 2012 179
Running the Matlab code shown before, we obtain the solution shown in
Fig. 8.6. The BVP is in this case strongly reaction-dominated, and the exact
solution tends to behave as the solution of the “reduced” problem, corre-
sponding to setting µ = 0, that is given by the function ured (x) = 1. How-
ever, the boundary condition in x = 1 forces the solution to be equal to zero,
so that a steep boundary layer arises. The function uh exhibits marked spu-
rious oscillations in the neighbourhood of x = 1, and does not satisfy the
DMP. This is due to the fact that the local Peclèt number is
σ h2
Pe = = 16.6667 1.
6µ
The L2 error is equal to 0.12698 while the maximum nodal error is 0.2415
and clearly occurs in correspondance of the node located immediately be-
fore x = 1.
180 CHAPTER 8. SOLVED PROBLEMS
(c)
Matlab coding. The following Matlab script solves Exercise 3(c).
%%%%%%%%%%%%%%
% Ex. 3 (c)
%%%%%%%%%%%%%%
close all; clear all
global m
setfonts
m = 1e-4;
% nr. of elements
N = 10;
% degree of FEs
deg = 1;
% mesh size
h = 1/N;
% uniform mesh nodes
xnod = [0 : h: 1];
% mesh
griglia = struttura_griglia(xnod,deg);
% local basis functions
base = struttura_base(deg);
% system assembling phase
K = termine_diffusione(griglia,base,’coeff_mu’);
S = termine_reazione_lumping(griglia,base,’coeff_s’);
bv = termine_noto(griglia,base,’coeff_f’);
% boundary con ditions
dati_bordo = struct( ...
’bc’ , [1 1] , ... % type of condition
’gamma’ , [] , ... % parameter for Robin bc
’r’ , [] ... % boundary datum
);
A = K+S;
8.1. EXAMINATION OF JULY 09, 2012 181
b = bv;
% Dirichlet bcs and matrix system partitioning
u_incognite = [2 : 1 : griglia.dim-1];
u_note = [1; griglia.dim];
A11 = A(u_incognite,u_incognite);
A12 = A(u_incognite,u_note );
A21 = A(u_note ,u_incognite);
A22 = A(u_note ,u_note );
b1 = b(u_incognite);
x2 = [u_ex(0); u_ex(1)]; % boundary values for u_h
% system solution
x1 = A11\(b1-A12*x2);
% inclusion of boundary values in the computed solution
x(u_incognite,1) = x1;
x(u_note ,1) = x2;
% post-processing/plot
XX = [0:0.001:1]’;
Uex = u_ex(XX);
plot(XX,Uex,’k-’,xnod’,x,’o--’);
legend(’exact solution’,’FE solution’)
xlabel(’x’)
% errors
[eL2,eH1] = norme_errore(griglia,base,x,’u_ex’,’grad_u_ex’);
emax = norm(u_ex(xnod)’-x,’inf’);
disp([’L2 Errore : ’,num2str(eL2)])
disp([’H1 Errore : ’,num2str(eH1)])
disp([’Err max : ’,num2str(emax)])
Running the Matlab code shown before, we obtain the solution shown in
Fig. 8.7. In this case, using the lumping stabilization procedure, the com-
puted solution uh is no longer affected by numerical instabilities, and satis-
fies the DMP. The L2 error is equal to 0.14244 while the maximum nodal
error is 0.0097595, considerably smaller than in the non stabilized case.
(d)
Matlab coding. The following Matlab script solves Exercise 3(d).
%%%%%%%%%%%%%%
% Ex. 3 (d)
%%%%%%%%%%%%%%
close all; clear all
global m
setfonts
m = 1e-4;
% compute the number of elements needed to ensure Peclet <1
Nmin = round((1/sqrt(6*m)))
% nr. of elements
N = Nmin;
% degree of FEs
deg = 1;
% mesh size
182 CHAPTER 8. SOLVED PROBLEMS
h = 1/N;
% uniform mesh nodes
xnod = [0 : h: 1];
% mesh
griglia = struttura_griglia(xnod,deg);
% local basis functions
base = struttura_base(deg);
% system assembling phase
K = termine_diffusione(griglia,base,’coeff_mu’);
S = termine_reazione(griglia,base,’coeff_s’);
bv = termine_noto(griglia,base,’coeff_f’);
% boundary con ditions
dati_bordo = struct( ...
’bc’ , [1 1] , ... % type of condition
’gamma’ , [] , ... % parameter for Robin bc
’r’ , [] ... % boundary datum
);
A = K+S;
b = bv;
% Dirichlet bcs and matrix system partitioning
u_incognite = [2 : 1 : griglia.dim-1];
u_note = [1; griglia.dim];
A11 = A(u_incognite,u_incognite);
A12 = A(u_incognite,u_note );
A21 = A(u_note ,u_incognite);
A22 = A(u_note ,u_note );
b1 = b(u_incognite);
x2 = [u_ex(0); u_ex(1)]; % boundary values for u_h
% system solution
x1 = A11\(b1-A12*x2);
% inclusion of boundary values in the computed solution
x(u_incognite,1) = x1;
x(u_note ,1) = x2;
% post-processing/plot
XX = [0:0.001:1]’;
8.1. EXAMINATION OF JULY 09, 2012 183
Uex = u_ex(XX);
plot(XX,Uex,’k-’,xnod’,x,’o--’);
legend(’exact solution’,’FE solution’)
xlabel(’x’)
% errors
[eL2,eH1] = norme_errore(griglia,base,x,’u_ex’,’grad_u_ex’);
emax = norm(u_ex(xnod)’-x,’inf’);
Pe_loc = h^2/(6*m);
disp([’L2 Errore : ’,num2str(eL2)])
disp([’H1 Errore : ’,num2str(eH1)])
disp([’Err max : ’,num2str(emax)])
disp([’Peclet : ’,num2str(Pe_loc)])
Running the Matlab code shown before, we obtain the solution shown in
Fig. 8.8. In this case, the mesh is more refined than in points (b) and (c) of
this exercise, since we have Nmin = 41. The corresponding Peclèt number
is 0.99147 (i.e., slightly less than 1), the L2 error is 0.024579 and the maxi-
mum nodal error is 0.085817. With this combination of the parameters, the
performance of the GFEM is better than that in the case (c) as far as the
L2 error is concerned (a factor of ten smaller), while the maximum nodal
error is a factor of ten larger. All in all, if computational cost is the major
constraint, the method with the use of lumping of reaction matrix is the best
compromise, otherwise an alternative choice might be to refine the mesh
only close to the boundary layer.
Appendices
185
187
This part contains six appendices. The first three appendices are devoted to a re-
view of essential aspects of Linear Algebra, Functional Analysis and Differential
Calculus, that are extensively used in the text. The remaining three appendices are
devoted to illustrating the basic concepts of Numerical Mathematics, Numerical
Linear Algebra and Approximation Theory.
188
Appendix A
Differential Calculus
In this appendix, we gather some basic notions of Differential Calculus and related
formulas that are extensively used throughout the text.
189
190 APPENDIX A. DIFFERENTIAL CALCULUS
d
∂ 2u
4u := div ∇u = ∑ 2
.
i=1 ∂ xi
A = A(x) : Ω → R,
div(A∇u) = A4u + ∇A · ∇u
where the symbol · denotes the scalar product between two vectors.
Theorem A.1.1 (Green’s formula). For sufficiently smooth given scalar and vec-
tor functions v and w, we have
Z Z Z
v div w dΩ = − ∇v · w dΩ + v w · n dΣ (A.1)
Ω Ω ∂Ω
where n dΣ denotes the oriented differential area element centered around the
point x over the d − 1-dimensional manifold ∂ Ω.
Identity (A.1) goes also under the name of integration by parts formula, and
plays a crucial role in the weak formulation of BVPs.
A.1. DIFFERENTIAL OPERATORS, USEFUL FORMULAS AND PROPERTIES191
0 ≤ u(x) ≤ Mφ ∀x ∈ Ω
and we say that u satisfies a maximum principle (MP).
Remark A.1.5 (Physical interpretation of the maximum principle). The maximum
principle has an important physical significance, because it mathematically ex-
presses the obvious fact that the dependent variable of the problem, say, a concen-
tration, a temperature or a mass density, cannot take negative values.
Example A.1.6. The reaction-diffusion and advection-diffusion operators consid-
ered in Chapt. 3 satisfy the maximum principle taking φ (x) = 1/σ and φ (x) = x/a,
respectively.
192 APPENDIX A. DIFFERENTIAL CALCULUS
A.2 Tensors
Let x = (x1 , x2 , x3 )T denote the position vector in R3 . A tensor τi j = τi j (x) is a
3 × 3 real-valued matrix function of the form
τ T1
τ11 τ12 τ13
T
τ τ21 τ22 τ 23
= τ
2
τ31 τ32 τ33 τ T3
where τ i = [τi1 , τi2 , τi3 ]T , i = 1, 2, 3. The trace of τ is the scalar quantity defined
as the sum of the diagonal entries of τ, i.e.
3
Trτ = ∑ τii .
i=1
τ + τT
τS :=
2
τ − τT
τSS := .
2
τ = τS + τSS . (A.3)
Linear Algebra
In this appendix, we gather some basic notions of Linear Algebra, that are exten-
sively used throughout the text.
The quantities vi ∈ Λ are called the coordinates of v with respect to the basis {ui }.
195
196 APPENDIX B. LINEAR ALGEBRA
dim(V ) = n.
If, instead, for every n there exists always a system of n linearly independent
vectors of V , then V has infinite dimension, that is
dim(V ) = +∞.
ei = [0, 0, . . . , 1, 0, . . . , 0]T ∈ Rn , i = 1, . . . , n
where the only non-zero component of ei occupies the i-th position in ei , that is,
(ei ) j = δi j , where (
1 if i = j
δi j =
0 if i 6= j
is the Kronecker symbol. On the contrary, V = C0 ([a, b]), the space of continuous
function over the interval [a, b], has infinite dimension. To see this, it suffices to
consider the Fourier series expansion of a periodic function over [0, 2π].
2. kλ vkV = |λ |kvkV ;
Example B.2.2 (Vector norms). Let V = Rn . For p ∈ [1, ∞), the Hölder (or p)
norm of a vector v ∈ V is defined as
!1/p
n
kvk p := ∑ |vi| p . (B.1)
i=1
Matlab coding. The Matlab source code for computing the norm of a vector is
reported below.
>> v = [-10, 2, 1]’;
>> norm(v,1)
ans =
13
>> norm(v,2)
ans =
10.2470
>> norm(v,’inf’)
ans =
10
198 APPENDIX B. LINEAR ALGEBRA
Example B.2.3 (Matrix norms). Let V = Rm×n be the space of real-valued matri-
ces having m rows and n columns. For p ∈ [1, ∞], we define the so-called induced
p-norm of a matrix A ∈ V (or natural p-norm of a matrix) as
kAxk p
kAk p := sup x ∈ Rn . (B.3)
x6=0 kxk p
Matlab coding. The Matlab source code for computing the norm of a matrix is
reported below. Notice that the computed value of the spectral radius of A agrees
with Prop. B.2.4.
>> A = rand(3)
A =
>> norm(A,1)
ans =
1.8475
>> norm(A,2)
ans =
1.8168
>> norm(A,’inf’)
ans =
2.0850
>> max(abs(eig(A)))
ans =
1.7527
B.3 Matrices
We start with an introduction to the basic nomenclature, definitions and properties
of a matrix.
Let A ∈ Rm×n denote a real-valued matrix with m rows and n columns. Each
entry of A is denoted by ai j , i = 1, . . . , m, j = 1, . . . , n. If m = n then A is a square
matrix, otherwise it is rectangular. Unless otherwise stated, we assume henceforth
m = n.
Definition B.3.1 (Regularity of a matrix). A is invertible (regular) iff ∃B ∈ Rn×n
such that
AB = BA = I
where I = (δi j ) is the identity matrix of order n. B is called the inverse of A and,
by definition, we set B = A−1 . If A is not invertible, then we say that A is singular.
Definition B.3.2 (Rank of a matrix). The rank of A is the maximum number of
linearly independent rows (or columns) of A, and is denoted rank(A). Matrix A is
said to have maximum (or full) rank if
• A is symmetric if ai j = a ji , i, j = 1, . . . , n, i.e., if A = AT ;
A =
8 1 6
3 5 7
4 9 2
A_i =
8
B.3. MATRICES 201
A_i =
8 1
3 5
A_i =
8 1 6
3 5 7
4 9 2
Remark B.3.5. It can be checked that if A is p.d., then aii > 0, i = 1, . . . , n. To see
this, it suffices to take x = ei , i = 1, . . . , n.
Remark B.3.6. If A is p.d., then it has positive eigenvalues, and thus, as a conse-
quence, det(A) = Πni=1 λi (A) > 0, so that A is non-singular.
Should the > operator hold in the above inequalities in place of ≥, then A is said
to be strictly diagonally dominant.
x ≥ (≤)0
Functional Analysis
In this appendix, we review the basic foundations of Functional Analysis that are
used thoroughly in the text. We introduce the basic concepts of function spaces,
associated topology and norms. We start from the notion of metric space, and
we give the definition of complete metric space and of normed space. Then, we
define the principal cathegory of metric complete normed spaces, the so-called
Banach spaces. We close this brief review by introducing a notable member of the
family of Banach spaces, the so-called Hilbert function spaces, and discuss the
most relevant examples that will be used in the weak formulation of the boundary
value problems considered in this text. Several examples are provided to support
the theoretical presentation and definitions.
203
204 APPENDIX C. FUNCTIONAL ANALYSIS
Definition C.1.2 (Ball of radius ρ). Given u ∈ V and ρ ∈ R+ , we define the ball
Bρ (u) as the subset of elements v ∈ V such that δ (u, v) ≤ ρ.
it can be checked that the three requirements in Def. C.1.1 are satisfied. Met-
rics (C.2) is called Lagrangian of order zero (cf. (C.12) in the case k = 0), and the
ball Bρ is represented in Fig. C.2.
C.1. METRIC SPACES 205
lim un = z (C.3)
n→∞
In such a case, we say that {un } converges to z (or that {un } is δ -convergent to z).
Remark C.1.6. If V = C0 ([a, b]), Def. C.1.5 is equivalent to the notion of uniform
convergence.
from which, using (C.4) for both terms at the right-hand side, we get (C.5).
Remark C.1.8. Relation (C.5) is the extension to metric spaces of the necessary
Cauchy condition for the existence of the limit for a sequence of numbers.
Example C.1.9. Let V = C0 ([0, 1]) and take un (x) = xe−nx , n ≥ 1. Let also z(x) = 0
for all x ∈ [0, 1]. Then, we have
so that un converges uniformly to zero in [0, 1]. Fig. C.3(a) shows a plot of un (x)
for n = 1, 2, 3, 5 and 10, while Fig. C.3(b) shows a logarithmic plot of δ (un , 0) as
n → ∞. This latter picture reveals that uniform convergence of un to the function
z(x) = 0 is very slow.
Matlab coding. The Matlab script for generating Fig. C.3(a) is reported below.
206 APPENDIX C. FUNCTIONAL ANALYSIS
x=[0:0.0001:1];
n=[1,2,3,5,10];
figure;
for i=1:numel(n), un=x.*exp(-n(i)*x); plot(x,un); hold on; end
xlabel(’x’);
legend(’n=1’,’n=2’,’n=3’,’n=5’,’n=10’);
Matlab coding. The Matlab script for generating Fig. C.3(b) is reported below.
x=[0:0.0001:1];
n=[1:100];
for i=1:numel(n), un=x.*exp(-n(i)*x); err(i)=norm(un-0,’inf’); end
figure;
semilogy(n,err);
xlabel(’n’);
The following example shows that Prop. C.1.7 (equivalently, relation (C.6)) is
not, in general, a sufficient condition for {un } to satisfy (C.4) (i.e. for {un } to be
δ -convergent).
Example C.2.3 (The number e.). Let Q denote the set of rational numbers, and
let un := (1 + 1/n)n for n ≥ 1. Basic Calculus analysis tells us that the numerical
sequence un converges, as n → ∞, to Nepero’s number e ' 2.718281828459, i.e.
lim |un − e| = 0.
n→∞
Thus, un converges to the finite limit e with respect to the euclidean metrics, but
the limit is not a rational number (i.e., it cannot be written in the form p/q, p and
q being natural numbers). does not belong to the vector space Q
To remedy a problem like that occurring in Ex. C.2.3, the space V must satisfy
the property of completeness.
Thus, in a complete metric space, Prop. C.1.7 is also sufficient for {un } to be
δ -convergent.
Example C.2.5 (R as the completion of Q). Taking V = R, instead of Q, in
Ex. C.2.3, we conclude that the numerical sequence un = (1 + 1/n)n , n ≥ 1, is
δ -convergent to e with respect to the euclidean metrics (C.1). This shows that
the real field is the completion of the set of rational numbers with respect to the
metrics (C.1).
Proposition C.2.6. The space V = C0 ([0, 1]) is complete with respect to the la-
grangian metrics (C.2).
Remark C.2.7. The space V = C0 ([a, b]) is not complete with respect to δ1 (·, ·).
In other words, there exist sequences of continuous functions un = {un (x)} for
which we have
Z b
lim δ1 (um , un ) = lim |um (x) − un (x)| dx = 0
m,n→∞ m,n→∞ a
This shows √ that the sequence un converges, in the metrics (C.8), to the function
z(x) = 1/ x, so that, by Def. C.2.1, {un } is a Cauchy sequence with respect to
the integral metrics. However, the limit function z does not belong to C0 ([0, 1], so
that C0 ([0, 1] is not complete with respect to the integral metrics.
C.2. COMPLETE METRIC SPACES 209
Matlab coding. The Matlab script for generating Fig. C.4 is reported below.
x=[0:0.0001:1];
figure;
n=3;
un=sqrt(n)*(x<=1/n)+1./sqrt(x).*(x>1/n);
plot(x,un);
xlabel(’x’);
L1 ([a, b]) is also called the space of Lebesgue integrable functions over the closed
interval [a, b].
L1 ([a, b]) does not contain only continuous functions.
√
Example C.2.10. Let v(x) = 1/ x. We have v ∈ / C0 ([0, 1]) because lim x−1/2 =
x→0+
+∞, but v ∈ L1 ([0, 1]). As a matter of fact
Z 1 1
x−1/2 dx = 2x1/2 0 = 2.
0
while
max |xn − 0| = 1 ∀n ≥ 1.
x∈[0,1]
210 APPENDIX C. FUNCTIONAL ANALYSIS
Definition C.3.1 (Normed vector space). A real vector space V on which a norm
k · kV is introduced according to Def. B.2.1, can be made a metric space by setting
Again, the above definition is a consistent extension of the way for measuring
the distance between two vectors in Rd .
Definition C.3.2 (Equivalence of norms). Let k · k and ||| · ||| be two norms on V .
We say that k · k and ||| · ||| are equivalent, if there exist two positive constants K1
and K2 , with K1 ≤ K2 , such that
Definition C.4.1 (Banach space). V is called a Banach space if for every sequence
{un } ∈ V we have
We notice that the above definition is nothing else the usual notion of com-
pleteness of a metric space in the special case where the distance δ (u, v) is taken
as the norm of u − v.
∂ |α| v
Dα v :=
∂ x1α1 . . . ∂ xdαd
Example C.4.3 (The space of p-summable functions). For p ∈ [1, ∞), let V =
L p (Ω) denote the set of measurable functions u : Ω → R of summable power p,
that is, such that Z
|u(x)| p dΩ < +∞.
Ω
Let Z 1/p
kukL p := |u(x)| p dΩ , (C.13)
Ω
212 APPENDIX C. FUNCTIONAL ANALYSIS
Figure C.5: The space C0 ([−1, 1]) is not complete with respect to the metrics of
L2 .
so that
lim kum − un k2L2 = 0.
m,n→∞
This shows that {un } is a Cauchy sequence with respect to the metrics associated
with (C.17). Let
0 −1 ≤ x < 0
H(x) :=
1 0<x≤1
denote the so-called Heaviside function. The function H has a jump discontinuity
at x = 0 and for this reason it is also known as step function. We can check that
for n → ∞, the sequence un converges to H(x) for almost all x ∈ [0, 1]. As a matter
of fact, we have
(nx − 1)3 x=1/n
Z 1/n
1
lim kun − H(x)k2L2 = lim (nx − 1)2 dx = lim = lim = 0.
3n n→∞ 3n
n→∞ n→∞ 0 n→∞ x=0
Assume now that there exists a function v ∈ C0 ([−1, 1]) such that lim kun −vkL2 =
n→∞
0. Then, applying the triangular inequality we get
kv − H(x)kL2 ≤ kv − un kL2 + kun − H(x)kL2
from which, passing to the limit
lim kv − H(x)kL2 ≤ lim kv − un kL2
n→∞ n→∞
+ lim kun − H(x)kL2 = 0 + 0 = 0
n→∞
C.6. SOBOLEV SPACES IN 1D 215
that implies v(x) = H(x) ∈/ C0 ([−1, 1]), in contradiction with the starting assump-
tion v ∈ C0 ([−1, 1]). We have thus proved that un is a convergent sequence in the
space C0 ([−1, 1]), convergence being measured with respect to the metrics of L2 ,
even if there is no continuous function z = z(x) such that
lim kun − zkL2 = 0.
n→∞
The limit function z is the discontinuous function H(x). This shows that the space
C0 ([−1, 1]) is not complete with respect to the metrics of L2 .
Matlab coding. The Matlab script for generating Figs. C.5(a) and C.5(b) is re-
ported below.
x=[-1:0.0001:1];
figure;
n=3;
un=0.*(x<=0) + n*x.*((x>0) & (x<=1/n)) + 1.*(x>1/n);
figure, plot(x,un);
xlabel(’x’);
ulimit=0.*(x<=0) + 1.*(x>0);
figure, plot(x,ulimit);
xlabel(’x’);
Remark C.6.4 (Equivalent norm in H01 ). Using (C.26) in (C.24) for each v ∈
H01 (Ω), we have
∂ v 2
kvk2H 1 (Ω) ≤ (1 +CP2 ) 2 .
∂ x L (Ω)
On the other hand, from definition (C.24), we trivially have
∂ v 2
kvk2H 1 (Ω) ≥ 2 ,
∂ x L (Ω)
so that we can conclude that
∂v 2 ∂ v 2
k kL2 (Ω) ≤ kvk2H 1 (Ω) ≤ (1 +CP2 ) 2 ∀v ∈ H01 (Ω). (C.27)
∂x ∂ x L (Ω)
Applying Def. C.3.2 to (C.27), we see that
∂ u
kukH 1 (Ω) = 2 u ∈ H01 (Ω) (C.28)
0 ∂ x L (Ω)
W = v ∈ C2 ([−1, 1]) such that v(−1) = v(1) = 0 = C2 ([−1, 1]) ∩C00 ([−1, 1]).
and
0 −1 ≤ x ≤ − 1n
πn 1
πnx
u00n (x) = − cos |x| <
2 2 n
1
0
≤ x ≤ 1.
n
A plot of un , u0n and u00n for n = 1, n = 6 and n = 20, is shown in Fig. C.6.
Proceeding as in Ex. C.5.2, we can check that
(c) u00n
This shows that {un } is a Cauchy sequence with respect to the metrics associated
with (C.28). We can also see that for n → ∞, the sequence un converges to z(x) :=
C.6. SOBOLEV SPACES IN 1D 219
The only limit function v is the continuous function z = 1 − |x|. This shows that
the space C2 ([−1, 1]) ∩C00 ([−1, 1]) is not complete with respect to the metrics of
H01 (−1, 1). The limit function z belongs to H01 (−1, 1) ≡ V because z ∈ L2 (−1, 1)
and the derivative z0 is the Heaviside-like step function
(
1 −1 ≤ x ≤ 0
z0 (x) =
−1 0 < x ≤ 1.
Taking a closer glance, we see that every member un of the sequence (which
belongs to W ) actually belongs to V . However, V contains functions that do not
belong to W , as is the case for the limit z. This fact is graphically documented in
Fig. C.7
Figure C.7: The process of completion of the space W = C2 ([−1, 1])∩C00 ([−1, 1]).
Arrows pointing from W to V = H01 (−1, 1) represent the limit for n → ∞.
Matlab coding. The Matlab script for generating Fig. C.6 is reported below.
x=[-1:0.0001:1];
n=[1,6,20];
220 APPENDIX C. FUNCTIONAL ANALYSIS
for i=1:numel(n)
un_0(i,:) = (1-1/n(i)+2/(n(i)*pi).*cos(pi*n(i)*x/2)).*(abs(x)<1/n(i))+...
(1-abs(x)).*((abs(x)>=1/n(i))&(abs(x)<=1));
un_1(:,i) = 1.*((x>=-1)&(x<=-1/n(i)))+(-sin(n(i)*pi*x/2)).*...
(abs(x)<1/n(i))+(-1).*(x>=1/n(i));
un_2(:,i) = 0.*((x>=-1)&(x<=-1/n(i)))+ 0.*((x>=1/n(i))&(x<=1)) ...
-pi/2*n(i)*cos(pi*n(i)*x/2).*(abs(x)<1/n(i));
end
figure, plot(x,un_0);axis(’square’)
xlabel(’x’);
legend(’n=1’,’n=6’,’n=20’);
figure, plot(x,un_1);axis(’square’)
xlabel(’x’);
legend(’n=1’,’n=6’,’n=20’);
figure, plot(x,un_2);axis(’square’)
xlabel(’x’);
legend(’n=1’,’n=6’,’n=20’);
Again, the space L2 (Ω) corresponds to the case m = 0, while in the case m = 1,
we have the space H 1 (Ω)
1 2 ∂v 2
H (Ω) = v ∈ L (Ω) such that ∈ L (Ω), i = 1, . . . , d . (C.32)
∂ xi
C.7. SOBOLEV SPACES IN RD , D ≥ 2 221
Remark C.7.1. In the applications, the quantity Ω |∇v|2 dΩ has usually the mean-
R
ing of an energy. For this reason, it is customary to say that a function v belonging
to H 1 (Ω) has finite energy.
The following example shows that functions in H 1 (Ω) are not necessarily con-
tinuous when d > 1, as anticipated in Rem. C.6.2.
Example C.7.2. Let
1
q
2 2
Ω = (x1 , x2 ) : ρ ≡ x1 + x2 ≤ ,
2
and u(x1 , x2 ) = (− log(ρ))β , β ∈ (0, 1/2). We have lim = +∞ despite the fact
ρ→0+
that u ∈ H 1 (Ω).
Figure C.8: A function with logarithmic singularity at the origin, which belongs
to H 1 (Ω) (in this case, β = 1/3).
Matlab coding. The Matlab script for generating Fig. C.8 is reported below.
beta = 1/3;
[X,Y] = meshgrid(0:0.001:1/2, 0:0.001:1/2);
rho=sqrt(X.^2+Y.^2);
Z=(-log(rho)).^(beta);
surf(X,Y,Z);
The following definitions extend to the functions of H 1 (Ω) the notion of value
of a function on the boundary of Ω that is valid in the case d = 1.
222 APPENDIX C. FUNCTIONAL ANALYSIS
H 1/2 (∂ Ω) = γ0 v, v ∈ H 1 (Ω) .
Definitions (C.37) and (C.38) tell us that functions belonging to H(div; Ω) have a
regularity that is intermediate between L2 and H 1 .
Definition C.7.10 (Trace space of vector functions). The space of traces of all
functions of H(div; Ω) is denoted H −1/2 (∂ Ω) and is defined as
H −1/2 (∂ Ω) = {γ0 v = (v · n)|∂ Ω , v ∈ H(div; Ω)} .
The space H −1/2 (∂ Ω) is an Hilbert space by endowing it with the norm
khkH −1/2 (∂ Ω) := inf kvkH(div;Ω) h ∈ H −1/2 (∂ Ω). (C.39)
v∈H(div;Ω)
v·n=h
224 APPENDIX C. FUNCTIONAL ANALYSIS
Appendix D
Essentials of Numerical
Mathematics
Abstract
In this appendix, we review the basic foundations of Numerical Mathematics that
are used thoroughly in the the text. In particular, several elements of Linear Al-
gebra and Numerical Analysis will be addressed, including solution methods for
linear systems and function approximation using polynomials.
where: d are the data, D is the set of admissible data (i.e., the data for which (P)
admits a solution), x is the solution, to be sought in a space V (see Def. B.1.1),
while F is the functional relation between d and x.
225
226 APPENDIX D. NUMERICAL MATHEMATICS
Z b
Example D.1.1. Compute I f := f (t) dt with f ∈ C0 ([a, b]):
a
d = { f , a, b} , x = If
Z b
F(x, d) = f (t) dt − x, V = R.
a
where:
d = { f ,t0 , T, y0 } , x = y(t)
f − y0 = 0
(
t ∈ (t0 ,t0 + T )
F(x, d) = , V = C1 (t0 ,t0 + T ).
y0 − y(t0 ) = 0 t = t0
Example D.1.5 (Unstable problem). Let a be a real parameter. Let n = n(a) denote
the number of real roots of the polynomial p(t) = t 4 − t 2 (2a − 1) + a(a − 1). It is
easy to see that:
0 a<0
n(a) = 2 0≤a<1
4 a ≥ 1.
where δ d is a perturbation of the data d such that (Pδ ) is still well posed, and δ x
is the corresponding perturbation of the solution.
Definition D.1.6 (Stability of (P)). We say that (P) is stable if
∃η0 = η0 (d), ∃K0 = K0 (d) such that
(D.1)
kδ dkD ≤ η0 ⇒ kδ xkV ≤ K0 kδ dkD ,
where k · kD and k · kV are appropriate norms for D and V , respectively (see
Def. B.2.1).
The above definition tells us that, provided a limiting threshold η0 is assumed
for the admissible perturbations, the corresponding perturbation δ x on the solution
can be controlled by η0 , modulo an amplification constant K0 . Notice that both
η0 and K0 depend, in general, on the reference data d. In this sense, the stability
emanating from Def. D.1.6 is “local”. To get a “global” estimate of the stability of
(P), it is clear that we need to “explore” the whole admissible set D. This leads
to the next definition.
Definition D.1.7 (Condition number of (P)). The relative condition number as-
sociated with problem (P) is
kδ xkV /kxkV
K(d) = sup (d + δ d) ∈ D. (D.2)
δ d6=0 kδ dkD /kdkD
228 APPENDIX D. NUMERICAL MATHEMATICS
kδ xkV
Kabs (d) = sup (d + δ d) ∈ D. (D.3)
δ d6=0 kδ dkD
where
K p (A) := kAk p kA−1 k p (D.4)
K p (A) ≥ 1
and that K p (I) = 1, I being the identity matrix of order n. By definition, K p (A) =
+∞ if A is singular. In the important case where A is symmetric and positive
definite, we have
where λmax (A) and λmin (A) are the extreme eigenvalues of A and ρ(A) is the
spectral radius of A (see (B.4)).
D.2. THE NUMERICAL MODEL 229
where dh and xh are the approximate data and solution, to be sought in suitable
subspaces Dh ⊆ D and Vh ⊆ V . The main difference between (P)h and its con-
tinuous counterpart (P) is that the former is constructed in such a way that xh is a
computable quantity, unlike x. For this reason, we refer to (P)h as the numerical
method. Our request is that
lim xh = x, (D.5)
h→0
that is, we want the numerical solution to converge to the solution of the contin-
uous problem, as the discretization parameter becomes arbitrarily small. In order
convergence to occur, we necessarily need that:
1. the approximate data to be convergent, i.e.
lim dh = d;
h→0
Rh (x, d) being the residual of problem (P)h , obtained by forcing into the
numerical problem the solution and data of the continuous problem.
Example D.2.1 (Numerical quadrature). For f ∈ C0 ([a, b]), let x = I f , xh = I f ,h '
I f and !
Nh
Fh (xh , dh ) = I f ,h − xh := ∑ h f (t k ) − xh
k=1
Figure D.2: The composite midpoint quadrature rule. The shaded scaloid is the
approximation of I f .
Let us check that (P)h is consistent. Assuming f ∈ C2 ([a, b]), it can be shown
that !
Nh Z b
Rh (x, d) = ∑ h f (t k ) −x− f (t) dt − x
k=1 a
!
Nh Z b
b − a 2 00
= ∑ h f (t k ) − f (t) dt = h f (ξ )
k=1 a 24
where ξ ∈ (a, b), so that (D.6) is satisfied. As for convergence, we notice that the
midpoint quadrature rule I f ,h coincides with the average Riemann sum, so that, by
definition of integral of a function between a and b we have
lim xh = I f = x ∀ f ∈ C0 ([a, b])
h→0
and thus xh converges to x.
The following general result is the milestone of Numerical Analysis.
Theorem D.2.2 (Equivalence theorem (Lax-Richtmyer)). The numerical method
(P)h is convergent iff it is consistent and stable. Consistency is expressed by (D.6),
while stability is expressed by (D.1) provided to replace d, x, D and V with dh , xh ,
Dh and Vh .
D.3. THE CHAIN OF ERRORS 231
computational process.
that is, the log-plot of the error is a straight line in the X-Y plane, whose slope
m gives us immediately the order of convergence of the method. In the case of
b−a
Ex. D.2.1, p = 2 and C = max | f 00 (t)|.
24 t∈[a,b]
• m is the mantissa;
• e is the exponent;
Typically, we have β = 2 and L ≤ e ≤ U, with L < 0 and U > 0. Using double pre-
cision for number representation (which means 8 bytes of memory, corresponding
to a machine word of 64 bits for storing f l(x)), we have usually t = 53, L = −1021
and U = 1024. From (D.10), it turns out that the range of numbers that can be rep-
resented in a computer machine is finite, and in particular it can be seen that
Matlab coding. The quantities xmin and xmax are stored in the Matlab variables
realmin and realmax.
>> realmin, realmax
ans =
2.2251e-308
ans =
1.7977e+308
Floating-point numbers are distributed in a discrete manner along the real axis.
In particular, the power of resolution of a computer machine is characterized by
the following quantity.
Definition D.5.1 (Machine epsilon). The machine epsilon εM = β 1−t is the small-
est floating point number such that
1 + εM > 1.
Matlab coding. The quantity εM is stored in the Matlab variable eps.
>> eps
ans =
2.2204e-16
D.5. FLOATING-POINT NUMBERS 235
xmax = β U (1 − β −t ) = β U (1 − εM β −1 ) = β U−1 (β − εM ).
where
1 1
u = β 1−t ≡ εM (D.12)
2 2
is the roundoff unit (or machine precision).
Using (D.11) into the definitions (D.8), we get an estimate of the rounding
error er introduced in Sect. D.3
|x − f l(x)| 1
Erel (x) = = |δ | ≤ u, Eabs (x) = |x − f l(x)| ≤ β e−t .
|x| 2
236 APPENDIX D. NUMERICAL MATHEMATICS
Appendix E
Abstract
In this appendix, we review the basic foundations of Numerical Linear Algebra
that are used thoroughly in the text. Solution methods for linear systems based on
the LU factorization technique will be illustrated.
det(Ai )
xi = i = 1, . . . , n. (E.2)
det(A)
Apparently, we are very satisfied with the approach to problem (E.1). Under a
reasonable condition (matrix invertibility), there is an explicit formula to compute
237
238 APPENDIX E. NUMERICAL LINEAR ALGEBRA
the solution x. A closer look at the situation shows that this is not completely
true. As a matter of fact, the application of formula (E.2) requires to evaluate (n +
1) determinants. Assuming to work with a machine capable of performing 1011
floating-point operations (flops) per second (100Gflops/sec), the cost of Cramer’s
rule is of about 5 minutes of CPU time if n = 15, 16 years if n = 20 and 10141
years if n = 100. More generally, the asymptotical cost as a function of matrix
size n increases as (n + 1)! (in mathematical terms, O((n + 1)!), see Fig. E.1).
Matlab coding. The following Matlab script can be used to compute the cost of
Cramer’s rule as a function of n.
SecYear=365*24*3600;
n=[5, 10, 15, 20, 50, 100];
Clock=100*1e9;
Cost=factorial((n+1))/Clock;
CostYear=Cost/SecYear;
loglog(n, CostYear,’ko-’)
xlabel(’n’); ylabel(’CPU Time [Years]’); title(’Cost of Cramer’’s Rule’)
methods compute the solution of (E.1) as the limit of a sequence, therefore re-
quiring (theoretically) an infinite number of steps. The first approach is discussed
in Sect. E.2 while for the second approach we refer the interested reader to a text
(course) of Numerical Analysis.
Since
det(A) = det(L) · det(U)
it immediately turns out that lii 6= 0 and uii 6= 0, i = 1, . . . , n, because A is nonsin-
gular.
The LU factorization can be used as a solution method for (E.1) as follows.
From (E.3) we have
(L ·U)x = b
so that solving (E.1) amounts to solving the two linear triangular systems:
Ly = b (E.4a)
Ux = y (E.4b)
Matlab coding. The Matlab coding of (E.4a) is reported below and takes the name
of forward substitution algorithm.
240 APPENDIX E. NUMERICAL LINEAR ALGEBRA
function y = forward_substitution(L,b)
n = length(b);
y = zeros(n,1);
y(1) = b(1)/L(1,1);
for i=2:n
y(i) = (b(i)-L(i,1:i-1)*y(1:i-1))/L(i,i);
end
Matlab coding. The Matlab coding of (E.4b) is reported below and takes the
name of backward substitution algorithm.
function x = backward_substitution(U,y)
n = length(y);
x = zeros(n,1);
x(n) = y(n)/U(n,n);
for i=n-1:-1:1
x(i) = (y(i)-U(i,i+1:n)*x(i+1:n))/U(i,i);
end
lii = 1 i = 1, . . . , n. (E.6)
Then, the remaining coefficients can be efficiently computed using the Gauss al-
gorithm, with a cost of O(2n3 /3). Summarizing, the total cost of the solution of
the linear system (E.1) using the method of LU factorization of matrix A is equal
to 2n3 /3 + 2n2 .
We can draw two relevant conclusions from this result. The first conclusion is
that the LU factorization is a computationally efficient alternative to Cramer’s rule.
The second conclusion is that, as n increases, the cost of forward and backward
system solving becomes less important than the cost of the factorization itself.
Matlab coding. The Matlab coding of the solution of the nonlinear system (E.5)
through Gauss algotithm is reported below.
function [L,U] = lufact(A,n)
for k=1:n-1
W(k+1:n)=A(k,k+1:n);
E.2. DIRECT METHODS FOR LINEAR SYSTEMS 241
for i=k+1:n
A(i,k)=A(i,k)/A(k,k);
for j=k+1:n
A(i,j)=A(i,j)-A(i,k)*W(j);
end
end
end
L=tril(A,-1)+eye(n);
U=triu(A);
Example E.2.1. Let us solve (E.1) using the LU factorization in the case where
A is the “magic” matrix of order n = 3 (a matrix constructed from the integers 1
to n2 with equal row, column, and diagonal sums), and b is chosen in such a way
that x = [1, 1, 1]T .
Matlab coding. The sequence of Matlab commands for the present example is
reported below.
>> A=magic(3)
A =
8 1 6
3 5 7
4 9 2
>> b=A*ones(3,1)
b =
15
15
15
>> [L,U]=lufact(A,3)
L =
1.0000 0 0
0.3750 1.0000 0
0.5000 1.8378 1.0000
U =
>> y=forward_substitution(L,b)
y =
15.0000
9.3750
242 APPENDIX E. NUMERICAL LINEAR ALGEBRA
-9.7297
>> x=backward_substitution(U,y)
x =
1
1
1
The following result gives a necessary and sufficient condition for the exis-
tence and uniqueness of the LU factorization.
The previous theorem is of little practical use. The following sufficient condi-
tions are more helpful.
It is easy to find cases for which the conditions of Thm. E.2.2 are not satisfied.
Example E.2.4. Let
1 2 3
A = 2 4 5 .
7 8 9
We have det(A1 ) = 1, det(A2 ) = 0 and det(A3 ) = det(A) = −6, so that A is non-
singular but fails to satisfy condition det(A2 ) 6= 0 that is required to admit the LU
factorization.
To accomodate the inconvenience manifested by the previous example, the LU
factorization is modified as follows. Instead of (E.3), we assume that there exist a
lower triangular matrix L, an upper triangular U and a permutation matrix P, such
that
P · A = L ·U. (E.7)
Relation (E.7) is referred to as the LU factorization of A with pivoting. The role of
matrix P is just to perform a suitable exchange of certain rows of A in such a way
E.2. DIRECT METHODS FOR LINEAR SYSTEMS 243
that is, the first and third rows have been exchanged. Now, we have det(A e1 ) = 7
and det(A e2 ) = 12 so that A
e satisfies the conditions required by Thm. E.2.2 and thus
admits a unique LU factorization (notice that det(A e3 ) = det(A)
e = det(P)det(A) =
+6, so that also A e is nonsingular as A was). According to (E.7), we have
(L ·U)x = P · b
so that solving (E.1) amounts to solving the two linear triangular systems:
Ly = P · b (E.8a)
Ux = y. (E.8b)
In other words, everything remains the same as in the case of LU factorization, ex-
cept the fact that the right-hand-side is subject to a reordering which corresponds
to the exchange of rows of A during factorization through the Gauss algorithm.
Matlab coding. The Matlab command for computing L, U and P is reported be-
low.
>> [L,U,P]=lu(A);
More synthetically, the solution of (E.1) using the LU factorization with piv-
oting can be obtained in Matlab with the following command.
>> x = A \ b;
Remark E.2.5 (Inverse of a matrix). The LU factorization with pivoting (E.7) and
the triangular systems (E.8a)- (E.8b) can be used as an efficient tool for computing
the inverse of a given matrix by solving the n systems
Axi = ei i = 1, . . . , n
where the i-th unknown vector xi represents the i-th column of A−1 .
244 APPENDIX E. NUMERICAL LINEAR ALGEBRA
Theorem E.3.1. Let δ A and δ b denote two perturbations of the problem data (A
and b, respectively), so that the perturbed system associated with (E.1)
(A + δ A)(x + δ x) = b + δ b (E.9)
The estimate (E.10) tells us that the relative error on the exact solution is
bounded by the sum of the relative errors on the data, modulo the effect of fi-
nite machine precision which is represented by the amplification constant
K(A)
.
k|δ Ak|
1 − K(A)
k|Ak|
Theorem E.3.2. Assume that k|δ Ak| ≤ γk|Ak| and kδ bk ≤ γkbk, for a positive
constant γ = O(u), and that γK(A) < 1. Then, we have
kδ xk 2γ
≤ K(A). (E.11)
kxk 1 − γK(A)
The estimate (E.11) tells us that the round-off error which inevitably affects
every operation on a machine computer (cf.Sect. D.5) is amplified by the condition
number of matrix A. To obtain a more quantitative information on the error, take
E.3. STABILITY ANALYSIS 245
kδ xk∞
' uK∞ (A) = 10m−16 . (E.12)
kxk∞
Roughly speaking, the above estimate tells us that the expected accuracy of b xh
with respect to the solution x of (E.1) is, at least, of 16 − m exact decimal digits.
Example E.3.3 (Hilbert matrix). In this example, we study the disastrous effects
of the combined occurrence of matrix ill-conditioning and machine round-off in
the solution of a linear system. We warn the reader to consider this case not as a
general paradigm, rather as a warning against “blind-faith” computations.
For n ≥ 1, let A ∈ Rn×n be the Hilbert matrix of order n, defined as
1
ai j = i, j = 1, . . . , n.
i+ j−1
Matlab coding. Matrix A is symmetric and positive definite for every n. To exam-
ine the stability with respect to perturbations in the solution of the linear system
Ax = b, we compute with the following Matlab script the condition number of A
as a function of n.
n=[1:20];
for i=1:numel(n), A=hilb(n(i)); K(i)=cond(A); end
semilogy(n, K)
xlabel(’n’)
Figure E.3: Log-plot of the condition number of the Hilbert matrix of order n as a
function of n.
Appendix F
Essentials of Numerical
Approximation
Abstract
In this appendix, we review the basic elements of approximation theory of a given
continuous function f : Ω = [a, b] → R using piecewise polynomials of degree
r ≥ 1.
F.1 Interpolation
Let us introduce a partition Th of Ω into a number Mh ≥ 1 of 1-simplex (intervals)
Ki = [xi , xi+1 ], i = 1, . . . , Mh , in such a way that x1 := a and xMh +1 := b. We denote
by hi := xi+1 − xi the length of each interval and set h := max hi . The partition
Th
Th takes the name of triangulation of the domain Ω. Each Ki is an element of
the triangulation, while the quantities xi , i = 1, . . . , Mh + 1 are the vertices of the
triangulation. The same terminology is adopted when Ω is a bounded set of Rd ,
d ≥ 2, and in such a case 2-simplices are triangular elements (d = 2) while 3-
simplices are tetrahedral elements (d = 3). We associate with Th the following
space of functions
Unless strictly necessary, we write Xhr instead of Xhr (Th ). The space Xhr is the set of
piecewise continuous polynomials over Ω, of degree ≤ r over each element Ki of
247
248 APPENDIX F. APPROXIMATION THEORY
where:
• ϕ j , j = 1, . . . , Nh : basis functions of Vh ;
• v j : degrees
of freedom of vh , that is, the coordinates of vh with respect to
the basis ϕ j .
A particularly interesting choice for the basis of Xhr are the so-called Lagrangian
basis functions, such that
ϕi (x j ) = δi j i, j = 1, . . . , Nh . (F.3)
Nh Nh
vh (xi ) = ∑ v j ϕ j (x) = ∑ v j δ ji = vi i = 1, . . . , Nh .
j=1 j=1
Example F.1.2 (Basis for r = 1 and r = 2). In the case r = 1, two basis functions
associated with the triangulation Th are plotted in Fig. F.2 (top), while Fig. F.2
(bottom) refers to the case r = 2.
Remark F.1.3 (Support of basis functions). For any basis function ϕi , we define
the support of ϕi as the subset of Ω on which the function is nonvanishing. We
notice that in the case r = 1 the support of a basis function associated with an
internal node xi is made by the union of Ki−1 and Ki . In the case r = 2, instead,
we have two kinds of basis functions, those associated with the midpoint of each
element (white square) and those associated with a vertex (black bullet). The first
kind of function (called “bubble” function) is localized within the element and
its support is given by Ki , the second kind of function has a support made by the
union of Ki−1 and Ki .
250 APPENDIX F. APPROXIMATION THEORY
Figure F.2: Basis functions. Top: r = 1, bottom: r = 2. In the first case, dim(Xhr ) =
5 while in the second case we have dim(Xhr ) = 9.
Nh
Πrh f (x) := ∑ f (x j )ϕ j (x) (F.4)
j=1
The Nh relations (F.5) are the interpolation conditions that allow to uniquely char-
acterize the operator Πrh f ∈ Xhr associated with the given function f .
Example F.1.4. Let f (x) = sin(x), [a, b] = [0, 10], r = 1 and Mh = 10.
Matlab coding. The following Matlab commands can be used to compute Πrh f
and to plot it together with the function f .
xn = 0:10; yn = sin(xn);
xi = 0:.25:10; yi = interp1(xn,yn,xi);
xx =0:0.0001:10; yy = sin(xx);
plot(xn,yn,’*’,xi,yi,xx,yy)
xlabel(’x’);
legend(’f(x_i)’,’\Pi_h^1 f(x)’,’f(x)’)
F.1. INTERPOLATION 251
Figure F.3: Piecewise linear continuous interpolation of the function f (x) = sin(x)
over [0, 10].
This result tells us that the interpolation operator can be used also for the ap-
proximation of the derivative of a function f , but that, in such a case, the order of
convergence is decreased by one with respect to the approximation of the function.
F.2 Quadrature
The interpolation polynomial can be profitably used for the approximate evalua-
tion of the integral I( f ) := ab f (x) dx, obtaining the following quadrature formula
R
Z b
Ihr ( f ) = Πrh f (x) dx ' I( f ). (F.10)
a
Definition F.2.2 (Quadrature error). If the error associated with a quadrature for-
mula can be written in the form
e ≤ Ch p k f (q) k∞ ,
then we say that:
• the error is infinitesimal of order p with respect to the discretization param-
eter h;
• the formula has a degree of exactness (or precision) equal to s := q − 1. As
a matter of fact, if f ∈ Pq−1 (i.e., if f is a polynomial of degree ≤ q − 1),
then f (q) (x) = 0 for all x ∈ [a, b] and e = 0. This means that the formula is
exact if applied to polynomials of degree up to q − 1.
Theorem F.2.3 (Quadrature error). Let f ∈ C2 ([a, b]). Then
b − a 2 (2)
|I( f ) − Ih0 ( f )| ≤ h k f k∞ ⇒ p = 2, s = 1
24
(F.11)
b − a 2 (2)
|I( f ) − Ih1 ( f )| ≤ h k f k∞ ⇒ p = 2, s = 1.
12
If f ∈ C4 ([a, b]), then
b − a 4 (4)
|I( f ) − Ih2 ( f )| ≤ h k f k∞ ⇒ p = 4, s = 3. (F.12)
90 · 25
Remark F.2.4 (Gaussian quadratures). More in general, a quadrature formula for
the approximate evaluation of I( f ) can be written as a weighted sum
Nh
Ih ( f ) = ∑ wi f (xi )
i=1
where xi and wi are called nodes and weights of the considered quadrature for-
mula. The optimal choice of such nodes and weights is a classical (and nontrivial)
problem. If the number of nodes over each element Ki is a fixed quantity, say
equal to n + 1, for n ≥ 0 (not too large), then it is possible to uniquely determine
the nodes x j ∈ Ki in such a way that s = 2n + 1, i.e., maximum degree of exactness.
The resulting formulae are called Gaussian quadrature rules. An important prop-
erty of Gaussian quadratures is that wi > 0, i = 1, . . . , N, which has the remarkable
consequence to yield numerically stable formulae. This property does not hold for
Newton-Cotes formulae of high order, for which some weights wi turn out to be
negative if n > 5.
254 APPENDIX F. APPROXIMATION THEORY
Example F.2.5. Two simple examples of Gaussian quadratures are those with: