0% found this document useful (0 votes)
8 views63 pages

3-SlidesPart3 23

The document discusses numerical modeling, focusing on models of temporal evolution in systems, specifically the elastic and heat equations. It outlines the mathematical formulations for these models, including boundary and initial conditions, and introduces discretization strategies for solving them. The methods of lines and transverse lines are presented as approaches to discretize the problems in both space and time.

Uploaded by

arthurclementt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views63 pages

3-SlidesPart3 23

The document discusses numerical modeling, focusing on models of temporal evolution in systems, specifically the elastic and heat equations. It outlines the mathematical formulations for these models, including boundary and initial conditions, and introduces discretization strategies for solving them. The methods of lines and transverse lines are presented as approaches to discretize the problems in both space and time.

Uploaded by

arthurclementt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 63

Numerical Modelling:

3 - Models of temporal evolution

Adriano Festa
DISMA - Politecnico di Torino
II semester 2023
MODELS OF TEMPORAL EVOLUTION

The models studied so far are stationary, namely they exhibit the following structure:

−∇ · (µ∇u) = f in Ω ,
boundary conditions on ∂Ω ,

with u = u(x) defined in Ω.


Let us now consider situations where the state of our system varies with time. The
corresponding models, termed evolutionary, exhibit the following structure:


 Dt u − ∇ · (µ∇u) = f in Ω , 0<t≤T ,


boundary conditions on ∂Ω , 0 < t ≤ T,



initial conditions in Ω , t=0,

where Dt u denotes a partial derivative of u with respect to time. Now, u = u(x, t) is


defined in Ω × [0, T ].

A Festa, Numerical Modelling - part 3, 2/63


I - The elastic model

Let u = u(x, t) be the (small) vertical displacement of a thin membrane at the point
x = (x, y) ∈ Ω at time t. Then
∂u ∂2u
(x, t) and (x, t)
∂t ∂t2
represent, respectively, the velocity and the acceleration of the membrane in the
vertical direction at the point x = (x, y) ∈ Ω at time t.
Next, let ρ = ρ(x) be the surface density of mass of the membrane, and let
f = f (x, t) be the surface density of external force applied at time t.
Then, Newton’s law is expressed as
∂2u
f +∇·τ =ρ in Ω , at each time t ;
∂t2
substituting the expression of τ given by Hooke’s law in this equation, we obtain
∂2u
ρ − ∇ · (µ∇u) = f in Ω , at each time t .
∂t2
Such an equation is known as the wave equation.

A Festa, Numerical Modelling - part 3, 3/63


The equation has to be supplemented by
one boundary condition at each point x ∈ ∂Ω (as for the steady case) at each
time t,
two conditions at the initial time t = 0, at each point x ∈ Ω, since the equation
contains the second derivative of u with respect to time.
The initial conditions define the position and the velocity of the membrane at the
initial time:
∂u
u(x, 0) = u0 (x) and (x, 0) = v0 (x) in Ω .
∂t

Thus, if we enforce, e.g., homogeneous Dirichlet boundary conditions, the


displacement u will be uniquely determined, for time instants t ∈ [0, T ] with T given,
by solving the initial- and boundary-value problem
 2
∂ u
ρ 2 − ∇ · (µ∇u) = f in Ω , 0<t≤T ,


 ∂t

 u=0 on ∂Ω , 0 < t ≤ T,
u = u0 , ∂u = v0


in Ω , t=0.

∂t

A Festa, Numerical Modelling - part 3, 4/63


II - The heat equation

Let u = u(x, t) be the temperature of a thin metallic plate at the point x ∈ Ω at time
t. Let ρ = ρ(x) be the surface density of mass of the body, and let c = c(x) denote
its specific heat, so that cρ represents its heat capacity per unit of surface.
The equation of thermal balance is
∂u
cρ = −∇ · Φ + ρ q ,
∂t
where Φ represents the heat flux and q = q(x, t) denotes an additional contribution of
heat per unit of mass from the exterior (e.g., through thermal radiation).
By applying Fourier’s law
Φ = −κ∇u ,
where κ = κ(x) > 0 is the coefficient of thermal conductivity of the body at the point
x, we obtain the heat equation
∂u
cρ − ∇ · (κ∇u) = ρ q in Ω , at each time t .
∂t

A Festa, Numerical Modelling - part 3, 5/63


The equation has to be supplemented by
one boundary condition at each point x ∈ ∂Ω (as for the steady case) at each
time t,
one condition at the initial time t = 0, at each point x ∈ Ω, namely the initial
temperature
u(x, 0) = u0 (x) , x ∈ Ω ,
since the equation contains the first derivative of u with respect to time.

Let us divide the equation by c, and let us set µ = κ/c and f = ρq/c.

Thus, if we enforce, e.g., homogeneous Dirichlet boundary conditions, the temperature


u will be uniquely determined, for time instants t ∈ [0, T ] with T given, by solving the
initial- and boundary-value problem
 ∂u

 ρ − ∇ · (µ∇u) = f in Ω , 0<t≤T ,
 ∂t

 u=0 on ∂Ω , 0 < t ≤ T ,



u = u0 in Ω , t=0.

A Festa, Numerical Modelling - part 3, 6/63


Discretization strategies

Since the state of the system depends upon space and time
u = u(x, t) ,
it is natural to discretize the problem in two successive steps, namely:
1 semi-discretize with respect to one variable,
2 then, discretize with respect to the other one.

Method of lines:
semi-discretization with respect to space (by finite differences, finite elements,
finite volumes, ...), obtaining in this way a sistem of ordinary differentiale
equations in time;
discretization with respect to time introducing a sequence of discrete time
instants.
Method of transverse lines:
semi-discretization with respect to time, obtaining in this way a steady problem
at each discrete time instant;
discretization with respect to space of each steady problem.

A Festa, Numerical Modelling - part 3, 7/63


The method of lines

Anticipating what we will see in the coming slides, the first step of the method of lines
produces an initial-value problem (also termed Cauchy problem) of the following type:

Thermal model: 
Bu0 + Au = f , 0<t≤T ,
u(0) = u0 .

Elastic model: 
Bu00 + Au = f , 0<t≤T ,
u(0) = u0 , u0 (0) = v0 .

where u = u(t) is a vector in RN for each time t, whereas B and A are non-singular
square matrices.
Each suffix 0 denotes one differentiation with respect to the variable t.

A Festa, Numerical Modelling - part 3, 8/63


Multiplying each equation by B −1 (in a formal way, never do this in practice!), we
obtain that

Bu0 + Au = f becomes u0 = −B −1 Au + B −1 f

and
Bu00 + Au = f becomes u00 = −B −1 Au + B −1 f .

Hence, setting
F (u, t) = −B −1 Au + B −1 f ,
we can express the previous Cauchy problems in canonical form:

Thermal model: 
u0 = F (u, t) , 0<t≤T ,
u(0) = u0 .

Elastic model: 
u00 = F (u, t) , 0<t≤T ,
u(0) = u0 , u0 (0) = v0 .

A Festa, Numerical Modelling - part 3, 9/63


The semi-discretization in space of the heat equation by FD
Let Ω be the square plate (0, L)2 and µ is constant. The heat equation becomes
∂u
ρ − µ∆u = f in Ω , 0 < t ≤ T .
∂t
Let us consider the equally-spaced grid Gh already introduced in the steady case. Let
u`m = u`m (t) ' u(x` , ym , t)
be the approximation of the temperature at the node
(x` , ym ) at time t; besides, let yN +1 = L

u`m,0 = u0 (x` , ym ) (xℓ , ym )


ym (xN +1 , ym )

be the initial temperature at the same node, let

f`m = f`m (t) = f (x` , ym , t)

be the right-hand side at time t, and finally let x0 = y0 = 0 xN +1 = L


xℓ

ρ`m = ρ(x` , ym )

be the density (constant with respect to time).

A Festa, Numerical Modelling - part 3, 10/63


At each internal node (x` , ym ), 1 ≤ `, m ≤ N , the discretization in space of the heat
equation produces the ordinary differential equation
µ
ρ`,m u0`m +

−u`,m−1 − u`−1,m + 4u`m − u`+1,m − u`,m+1 = f`m , 0<t≤T ,
h2
which is supplemented by the initial condition

u`m (0) = u`m,0 .

At the boundary nodes, we enforce, at each time instant 0 < t ≤ T , the conditions

u`m (t) = 0 if ` ∈ {0, N + 1} or m ∈ {0, N + 1} .

As in the steady case, we eliminate the boundary nodes and we collect the internal
unknowns, numbered in lexicographical order, in a vector

u = u(t) = uk (t) 1≤k≤N 2 .

In addition, we introduce the vectors


 
f = f (t) = fj (t) 1≤j≤N 2 and u0 = uk,0 1≤k≤N 2
.

A Festa, Numerical Modelling - part 3, 11/63


Let us introduce the diagonal matrix which collects the density values at the internal
nodes
B = diag (ρ1 , . . . , ρj , . . . , ρN 2 ) ;
note that if the density is constant and equal to ρ, we have B = ρI.
Let A denote the penta-diagonal matrix introduced in Chapter 2, whose entries in the
upper triangular part are


 4 if k = j ,

µ −1 if k = j + 1 with j 6= pN ,
ajk = 2
h 
 −1 if k = j + N ,

0 otherwise .

Then, the previous equations give rise to the system of ordinary differential equations

Bu0 + Au = f , 0<t≤T ,

whereas the initial condition is expressed as

u(0) = u0 .

A Festa, Numerical Modelling - part 3, 12/63


The semi-discretization in space of the heat equation by FE
In a plane polygonal domain, let us consider the initial- and boundary-value problem
 ∂u
ρ ∂t − ∇ · (µ∇u) = f in Ω , 0 < t ≤ T ,



u=0 on ∂Ω , 0 < t ≤ T ,



u = u0 in Ω , t=0.
Notation: if w(x, t) is a function depending upon space and time, for each time
instant t let us denote by w(t) the function, defined in Ω such that
(w(t))(x) = w(x, t).
The variational formulation of the problem is obtained by treating the temporal term
in the same way as the forcing term. Precisely, at each time instant 0 < t ≤ T , the
solution u(t) belongs to the space V of admissible temperatures, and satisfies the
equations
Z Z Z
∂u
ρ v dx + µ∇u · ∇v dx = f v dx for each v ∈ V .
Ω ∂t Ω Ω
Note that each integral is a function of the time t, through u or f ; on the other hand,
all test functions v are independent of time.

A Festa, Numerical Modelling - part 3, 13/63


As in the steady case, the discrete variational formulation is obtained from the
previous one by substituting V with a finite-dimensional subspace Vh (the space of all
discrete admissible temperatures).
Such formulation is therefore: for each t, with 0 < t ≤ T ,


uh (t) ∈ Vh and satisfies

Z Z Z
∂uh
 ρ
 vh dx + µ∇uh · ∇vh dx = f vh dx for each vh ∈ Vh .
Ω ∂t Ω Ω

The condition uh (t) ∈ Vh means that the discrete solution uh is represented as

N
X
uh (x, t) = uk (t)ϕk (x) , (1)
k=1

i.e., it is a linear combination of the basis functions in Vh , whose coefficients are


unknown functions of time. In this manner, one accomplishes a separation of
variables, between space and time variables.

A Festa, Numerical Modelling - part 3, 14/63


The partial derivatives of uh with respect to time give rise to ordinary derivatives of
its coefficients with respect to such variable. Indeed, one has
N N
∂uh X duk X
(x, t) = (t)ϕk (x) = u0k (t)ϕk (x) .
∂t k=1
dt k=1

In order to translate the discrete variational formulation into algebraic equations, let
us choose as test functions vh the basis functions ϕj ; we obtain, for 0 < t ≤ T ,
Z Z Z
∂uh
ρ ϕj dx + µ∇uh · ∇ϕj dx = f ϕj dx , 1≤j≤N . (2)
Ω ∂t Ω Ω

Let us observe that


Z N Z N
∂uh X X
ρ ϕj dx = u0k ρ ϕk ϕj dx = bjk u0k ,
Ω ∂t k=1 Ω k=1

where Z
bjk = ρ ϕk ϕj dx

are the entries of a matrix B, termed the mass matrix.

A Festa, Numerical Modelling - part 3, 15/63


Then, as in the steady case, one has
Z N
X Z N
X
µ∇uh · ∇ϕj dx = uk µ∇ϕk · ∇ϕj dx = ajk uk ,
Ω k=1 Ω k=1

where ajk are the entries of the already known stiffness matrix A. At last, we set
Z
fj (t) = f (x, t)ϕj (x) dx , 1≤j≤N .

Thus, we are led to introduce the vector functions

u(t) = (uk (t))1≤k≤N and f (t) = (fj (t))1≤j≤N .

The system of ordinary differential equations (2) is then expressed in the vectorial form

Bu0 + Au = f , 0<t≤T ,

already mentioned a few slides above.

A Festa, Numerical Modelling - part 3, 16/63


As far as the initial condition u(0) = u0 is concerned, eq. (1) for t = 0 yields

N
X
uh (x, 0) = uk (0)ϕk (x) ,
k=1

with uk (0) = uh (xk , 0). Then, it is natural to impose that uh (0) coincides with u0 at
the (internal) nodes of the grid, i.e., that

uh (xk , 0) = u0 (xk ) , 1≤k≤N .

Hence, the initial condition of our problem is translated into an initial condition for
each of the coefficients uk (t) which appear in eq. (1), namely

uk (0) = u0 (xk ) = u0k , 1≤k≤N ,

i.e., in vector notation,


u(0) = u0 = (u0k )1≤k≤N .

A Festa, Numerical Modelling - part 3, 17/63


THE MASS MATRIX

The mass matrix B is defined as


Z
B = (bjk ) ∈ RN ×N , with bjk = ρ ϕk ϕj dx .

As the stiffness matrix A, the mass matrix B is symmetric, positive definite and
sparse.

The pattern of the matrix (i.e., the positions of the entries which are a-priori different
from 0) is the same as for A, since we have
X Z
bjk = ρ ϕk ϕj dx .
T ∈T (j)∩T (k) T

The procedure for building this matrix is also identical to that for the stiffness matrix,
being based on the computation of the elemental mass matrices B (T ) on the
individual elements T of the triangulation, followed by their assemblage.

A Festa, Numerical Modelling - part 3, 18/63


The elemental mass matrix

Using the same notations of Chapter 2, let


Z
(T )
bα,β = ρ ϕβ ϕα dx , 1 ≤ α, β ≤ 3 ,
T

be the entries of the mass matrix B (T ) ∈ R3×3 of the element T ∈ T .

We may assume that the density ρ is a constant ρT in T , since otherwise we


approximate it by its mean value on T
Z
1
ρT = ρ dx ,
area(T ) T

or by its value ρT = ρ(xb ) in the barycenter of the triangle, or even by the arithmetic
mean ρT = 31 ρ(x1 ) + ρ(x2 ) + ρ(x3 ) of its values in the vertices of the triangle.


In any case, we set Z


(T )
bα,β = ρT ϕβ ϕα dx .
T

A Festa, Numerical Modelling - part 3, 19/63


By computing the integrals analytically, one finds

1 if α = β ,
(T ) 6
bα,β = ρT area(T )
1 if α 6= β ,
12

i.e.,  1 1 1 
6 12 12
B (T ) = ρT area(T )  1 1 1
 
 .
 12 6 12 
1 1 1
12 12 6

Hence, the elemental mass matrix depends upon the element only through its area and
the mean value of density.
The computation of such a matrix is therefore particularly simple.

A Festa, Numerical Modelling - part 3, 20/63


Mass lumping

In some cases, it is convenient to replace the mass matrix B by a diagonal matrix B,


e
which surrogates its effects. Such a new matrix is obtained by “concentrating the
mass” at the nodes, i.e., by replacing each diagonal entry of B by the sum of the
entries which sit on the correponding row.
This procedure takes the name of mass lumping, and the resulting matrix B̃ is termed
lumped mass matrix.

The enntries of the lumped mass matrix are therefore given by



N N
Z !
 X X
ϕk ϕj dx; , if j 0 = j ,

 bjk = ρ
b̃jj 0 = Ω
k=1 k=1
if j 0 =

0 6 j.

Mass lumping can be accomplished element-by-element, since it is easily seen that by


assembling local diagonal matrices one gets a global diagonal matrix.

A Festa, Numerical Modelling - part 3, 21/63


Assume that T is a triangle whose three vertices all carry an unknown (i.e., the three
local basis functions are restrictions to T of global basis functions in Vh ).
The previously defined matrix B (T ) is then replaced by the matrix

e (T ) = ρT area(T ) 1 I
B (3)
3
(where I ∈ R3×3 denotes the identity matrix).
(T )
Note that the diagonal entry b̃αα is given by
 
3 Z Z 3 Z
(T )
X X
b̃αα = ρT ϕβ ϕα dx = ρT  ϕβ  ϕα dx = ρT ϕα dx .
β=1 T T β=1 T

Recalling that the volume of a pyramid is given by 13 area(basis) × height, one


immediately has Z
1
ϕα dx = area(T ) ,
T 3
coherently with eq. (3).

A Festa, Numerical Modelling - part 3, 22/63


e (T ) from B (T ) consists of computing the integrals
An equivalent manner to get B
R
T ϕβ ϕα dx by numerical quadrature, using the trapezoidal rule in two dimensions.

Recalling the values of the basis functions at the vertices of the triangle, one has
(
Z 1
area(T ) , if α = β ,
ϕβ ϕα dx = 3
T 0 if α 6= β ,

which corresponds again to eq. (3).

A Festa, Numerical Modelling - part 3, 23/63


The mass matrix in dimension 1

If Ω = [0, L], we already met the mass matrix, when we considered the elastic string
problem with restoring term.
Indeed, if we now denote by ρ the restoring coefficient γ, we get
Z L
B = {bjk }1≤j,k≤N with bjk = ρϕk ϕj dx .
0

The symmetric positive-definite matrix B turns out to be tridiagonal. Precisely, in the


case of Dirichlet conditions applied to both endpoints, we have
 1
 3 (ρj−1/2 hj + ρj+1/2 hj+1 )


if k = j ,

 1ρ

h if k = j − 1 ,
6 j−1/2 j
bjk =
1


 ρ h
6 j+1/2 j+1
if k = j + 1 ,


0 elsewhere ,

with Z Z
1 1
ρj−1/2 ∼ ρ(x) dx , ρj+1/2 ∼ ρ(x) dx .
hj Ij hj+1 Ij+1

A Festa, Numerical Modelling - part 3, 24/63


In the particular case in which ρ is constant in [0, L] and the partition of the interval is
equally spaced with step-size h, the previous expression simplifies as
 2
if k = j ,
 3


1
bjk = ρh 6
if k = j ± 1 ,


0 elsewhere ,

i.e., one has 1 2 1



B = ρh tridiag 6 3 6
.

On the other hand, if we apply a Dirichlet condition in the left endpoint and a
Neumann condition in the right endpoint, the resulting mass matrix is

B = ρh tridiag 16 23 16 ; 61 13 .
 

A Festa, Numerical Modelling - part 3, 25/63


MODAL ANALYSIS

Let us consider the wave equation


∂2u
ρ − ∇ · (µ∇u) = f in Ω
∂t2
and let us look for the free periodic motions, i.e., let us choose f identically zero, and
let us look for u as a product of a periodic function depending only on the variable t
and a function depending only on the variable x, vanishing on the boundary.
Stated equivalently, let us perform a separation of variables between time and space,
by writing u either in complex form, as
u(x, t) = eiωt w(x) ,
where i denotes the imaginary unit, ω/2π represents a frequency of pulsation and w is
a complex-valued function, or in real form, as
u(x, t) = cos(ωt + α)w(x) ,
where α represents a phase and w is a real-valued function.

A Festa, Numerical Modelling - part 3, 26/63


In both cases, u is a periodic function with period 2π/ω; substituting its expression in
the wave equation and simplifying the common (exponential or cosinusoidal) factor
depending upon t, we get the equation

− ω 2 ρw − ∇ · (µ∇w) = 0 in Ω

satisfied by w.
The boundary condition u = 0 yields an analogous condition on w.

In conclusion, setting λ = ω 2 , the free periodic motions of a membrane fixed along its
rim are determined by the (non-trivial) solutions of the eigenvalue problem

−∇ · (µ∇w) = λρw in Ω ,
w = 0 on ∂Ω ,

which are termed the eigenfunctions of the elastic membrane.


The study of such a problem gives raise to the modal (or spectral) analysis of the
elastic membrane.

A Festa, Numerical Modelling - part 3, 27/63


Discretization by finite elements

Let Ω be a polygonal domain and let us consider the discretization of the previous
modal problem by linear finite elements.
At first, let us observe that the variational formulation of the problem is as follows:

w ∈ V, λ ∈ R and satisfy

Z Z
 µ∇w · ∇v dx = λ
 ρ w v dx for each v ∈ V .
Ω Ω

It is possible to prove that such a problem admits a sequence {(λn , wn )}n≥1 of


eigensolutions; the eigenvalues are strictly positive and form an increasing sequence
which tends to +∞ as n → +∞, whereas the eigenfunctions are mutually
ρ-orthogonal, i.e ., they satisfy
Z
ρ wn wm dx = 0 if n 6= m .

A Festa, Numerical Modelling - part 3, 28/63


The finite element discretization of this problem is as follows:

wh ∈ Vh , λh ∈ R and satisfy

Z Z
 µ∇wh · ∇vh dx = λh
 ρ wh vh dx for each vh ∈ Vh .
Ω Ω

The problem is translated into an algebraic form in the usual way, i.e., by representing
wh in the Lagrange basis as wh = N
P
k=1 wk ϕk and choosing vh = ϕj , j = 1, . . . , N ,
as test functions. One obtains
N
X Z N
X Z
wk µ∇ϕk · ∇ϕj dx = λh wk ρ ϕk ϕj dx , 1≤j≤N .
k=1 Ω k=1 Ω

Setting w = (wk )1≤k≤N , one arrives at the algebraic generalized eigenvalue problem

Aw = λh Bw ,

where A is the stiffness matrix, whereas B is the mass matrix.

A Festa, Numerical Modelling - part 3, 29/63


The Rayleigh quotient, introduced above, may be expressed as
Z
T µk∇wh k2 dx
w Aw
λh = T = ΩZ .
w Bw 2
ρwh dx

Assuming that all the diameters hT of the triangles which form the partition of Ω be
of the same order of magnitude h, it is possible to show that

λh,min ∼ λmin and λh,max ∼ C h−2 ,

where λmin denotes the minimal eigenvalue of the exact spectral problem, associated
with the minimal frequency of vibration of the membrane.
We will see later on that the second of such relations enforces a severe restriction on
the time step in the explicit advancing schemes for the thermal problem.

A Festa, Numerical Modelling - part 3, 30/63


Time-advancing schemes
Consider the initial-value probem (also known as Cauchy problem)

u0 = F (u, t) , 0<t≤T ,
(4)
u(0) = u0 ,

for a system of n first-order differential equations in n unknowns.


Here u : [0, T ] → Rn is the vector, depending upon time in a differentiable way, that
collects the unknowns, whereas F : Rn × [0, T ] → Rn is a globally continuous
function, which is Lipschitz-continuous in the variable u uniformly in t, i.e., there
exists a constant L > 0 such that
kF (u, t) − F (v, t)k ≤ L ku − vk , ∀u, v ∈ Rn , ∀t ∈ [0, T ] .
For instance, this happens if
F (u, t) = Au + b(t) ,
since
kF (u, t) − F (v, t)k = kA(u − v)k ≤ kAk ku − vk .
Under the assumptions made on F , problem (4) admits one and only one solution for
any choice of the initial data u0 ∈ Rn .

A Festa, Numerical Modelling - part 3, 31/63


For the numerical approximation of such a solution, the most popular strategy consists
in resorting to a time-advancing scheme.
This means that one chooses (in various manners) K > 0 time instants tk , with

0 = t0 < t1 < · · · < tk < tk+1 < · · · < tK = T ;

for each of them, one recursively defines an approximation

uk ' u(tk )

of the exact solution; precisely, at the time tk+1 , one defines uk+1 using the
knowledge of the approximations uj , j ≤ k already computed at one or more previous
time instants.

The conceptually simplest situation occurs when one advances with a constant time
step ∆t > 0 (in this case, one sets K = T /∆t, assuming this ratio to be integer); the
time instants are then defined by

tk = k∆t , for k = 0, 1, . . . , K .

A Festa, Numerical Modelling - part 3, 32/63


Some time-advancing schemes - I

Explicit Euler scheme (EE): (explicit - one step - I order)

uk+1 = uk + ∆tF (uk , tk ) , k≥0;

motivated by the forward incremental quotient formula

u(tk+1 ) − u(tk )
' u0 (tk ) = F (u(tk ), tk ) .
∆t

A Festa, Numerical Modelling - part 3, 33/63


Some time-advancing schemes - II

Implicit Euler scheme (IE): (implicit - one step - I order)

uk+1 = uk + ∆tF (uk+1 , tk+1 ) , k≥0;

motivated by the backward incremental quotient formula

u(tk+1 ) − u(tk )
' u0 (tk+1 ) = F (u(tk+1 ), tk+1 )
∆t

A Festa, Numerical Modelling - part 3, 34/63


Some time-advancing schemes - III

Mid-point scheme (MP): (explicit - two steps - II order)

uk+1 = uk−1 + 2∆tF (uk , tk ) , k≥1;

motivated by the centered incremental quotient formula

u(tk+1 ) − u(tk−1 )
' u0 (tk ) = F (u(tk ), tk )
2∆t

A Festa, Numerical Modelling - part 3, 35/63


Some time-advancing schemes - IV

Trapezoidal (or Crank-Nicolson) scheme (CN): (implicit - one step - II order)

h i
uk+1 = uk + ∆t 1
2
F (uk , tk ) + 21 F (uk+1 , tk+1 ) , k≥0.

motivated by a numerical quadrature formula applied to the relation


Z tk+1 Z tk+1
u(tk+1 ) − u(tk ) = u0 (t) dt = F (u(t), t) dt ,
tk tk

obtained by integrating the identity u0 (t)


= F (u(t), t) on the interval [tk , tk+1 ]. The
integral on the right-hand side can be approximated by the trapezoidal formula
Z tk+1
F (u(t), t) dt ' ∆t 12 F (u(tk ), tk ) + 21 F (u(tk+1 ), tk+1 ) .
 
tk

A Festa, Numerical Modelling - part 3, 36/63


Some time-advancing schemes - V

Runge-Kutta scheme RK3: (explicit - one-step - III order)

uk+1 = uk + ∆t
2
F1 + 31 F2 + 49 F3 ,

9
k≥0,

where the addends on the right-hand side are recursively defined by

F1 = F (uk , tk ) ,
F2 = F (uk + 21 ∆tF1 , tk + 12 ∆t) ,
F3 = F (uk + 34 ∆tF2 , tk + 34 ∆t) .

A Festa, Numerical Modelling - part 3, 37/63


Some time-advancing schemes - VI

Runge-Kutta scheme RK4: (explicit - one-step - IV order)

uk+1 = uk + ∆t
1
F1 + 31 F2 + 13 F3 + 16 F4 ,

6
k≥0,

where the addends on the right-hand side are recursively defined by

F1 = F (uk , tk ) ,
F2 = F (uk + 21 ∆tF1 , tk + 12 ∆t) ,
F3 = F (uk + 12 ∆tF2 , tk + 12 ∆t) ,
F4 = F (uk + ∆tF3 , tk + ∆t) .

A Festa, Numerical Modelling - part 3, 38/63


Some time-advancing schemes - VII

“Backward Difference Formula” scheme BDF2: (implicit - two-steps - II order)

3 k+1
2
u − 2uk + 21 uk−1 = ∆tF (uk+1 , tk+1 ) , k≥1,

“Backward Difference Formula” scheme BDF3: (implicit - three-steps - III order)

11 k+1
6
u − 3uk + 32 uk−1 − 13 uk−2 = ∆tF (uk+1 , tk+1 ) , k≥2.

A Festa, Numerical Modelling - part 3, 39/63


One-step schemes - Consistency

An explicit one-step scheme has the general form

uk+1 = uk + ∆tΦ(uk , tk , ∆t) , k≥0,


whereas an implicit one-step scheme has the general form

uk+1 = uk + ∆tΨ(uk , uk+1 , tk , ∆t) , k≥0.


The connection with the differential equation is given by the consistency condition:
Definition
A one-step scheme, defined by one of the previous formulas, is said to be consistent if
the condition

Φ(u, t, 0) = F (u, t) or Ψ(u, u, t, 0) = F (u, t)

is satisfied for any u ∈ Rn and t ∈ [0, T ].


All the previously presented one-step schemes are consistent.

A Festa, Numerical Modelling - part 3, 40/63


One-step schemes - Order and convergence
Definition
A consistent one-step scheme is said to be of order p > 0 if, considering the solution
u1 produced by the scheme at the first instant t1 = ∆t, one has

ku(t1 ) − u1 k = O(∆tp+1 ) for ∆t → 0 ,

for all solutions u that are (p + 1)-times differentiable at t = 0.

Theorem
If a one-step scheme is consistent and of order p, and if the exact solution u(t) is
(p + 1)-times differentiable in [0, T ], one has

dp+1 u
max ku(tk ) − uk k ≤ CL,T ∆tp max (t) ,
1≤k≤K t∈[0,T ] dtp+1

where CL,T denotes a constant only depending on L, T and the numerical scheme.
The theorem guarantees the convergence of the scheme, i.e., the fact that the discrete
solution generated by the numerical scheme converges towards the exact solution as
∆t → 0; it also predicts the behaviour of the error as the time step decreases.

A Festa, Numerical Modelling - part 3, 41/63


THE ASYMPTOTIC STABILITY

In applications, it is important that a time-advancing scheme generates discrete


solutions uk which stay bounded as tk → +∞, whenever the exact solutions of the
initial-value problem (4) stay bounded as t → +∞.
A quite relevant situation occurs when the differential system is
linear and autonomous, i.e., one has F (u, t) = F (u) = Au + b with A square
matrix of order n and b ∈ Rn independent of time, and
dissipative, i.e., A is diagonalizable with eigenvalues all having real part < 0.
In this case, whichever is the initial datum u0 , the solution u(t) of the problem

u0 = Au + b , t>0,
(5)
u(0) = u0 ,

converges, as t → +∞, towards the steady state u∞ ∈ Rn , solution of the linear


system
Au∞ + b = 0 ;
hence, in particular, it stays bounded as t → +∞.

A Festa, Numerical Modelling - part 3, 42/63


Indeed, applying the change of dependent variable v(t) = u(t) − u∞ and setting
v0 = u0 − u∞ , one immediately checks that v is the solution of the homogeneous
Cauchy problem 
v 0 = Av , t>0,
(6)
v(0) = v0 .

Let A = W ΛW −1 be the diagonalization of the matrix A, where


Λ = diag (λ1 , . . . , λn ) is the diagonal matrix collecting the eigenvalues and
W = (w1 , . . . , wn ) the matrix collecting the eigenvectors (placed column-wise).
Let us substitute such expression in (6) and let us multiply on the left by W −1 .
Setting z(t) = W −1 v(t) and z0 = W −1 v0 , problem (6) is equivalent to

z 0 = Λz , t>0,
z(0) = z0 ,

namely, to the n independent scalar problems in the components zp , 1 ≤ p ≤ n, of the


vector z 
zp0 = λp zp , t>0,
zp (0) = z0p .

A Festa, Numerical Modelling - part 3, 43/63


The solutions of the n independent scalar problems

zp0 = λp zp , t>0,
(7)
zp (0) = z0p ,

are given by
zp (t) = eλp t z0p
and since by assumption Re λp < 0, one has

|zp (t)| → 0 for t → +∞ and for each p .

As a consequence, for t → +∞ one has kz(t)k → 0, hence, also


ku(t) − u∞ k = kv(t)k = kW z(t)k → 0, which means, as anticipated, u(t) → u∞ .

Thus, we are led to consider the generic scalar problem introduced above, i.e.,

z 0 = λz , t>0,
(8)
z(0) = z0 ,

and to ask ourselves under which conditions a time-advancing scheme applied to such
a problem produces discrete solutions z k which stay bounded as k → ∞.

A Festa, Numerical Modelling - part 3, 44/63


The asymptotic stability of the Explicit Euler scheme (I)

The explicit Euler scheme applied to the equation z 0 = λz yields

z k+1 = z k + ∆tλz k = (1 + ∆tλ)z k , k≥0,

hence by recursion, and keeping into account the initial condition, one gets the explicit
expression
z k = (1 + ∆tλ)∧k z0 ,
where the symbol ∧k means raising the basis to the k-th power.
The condition |z k | → 0 as k → +∞ is then equivalent to the condition

|1 + ∆tλ| < 1 .

On the other hand, if instead one has |1 + ∆tλ| = 1, then the solution stays bounded
as k → +∞, although it does not tend to 0; indeed, one has |z k | = |z0 | for each
k ≥ 0. At last, if |1 + ∆tλ| > 1, then necessarily one has |z k | → +∞ as k → +∞.
In conclusion, setting α = ∆tλ ∈ C, boundedness of the discrete solutions is
equivalent to
|1 + α| ≤ 1 .

A Festa, Numerical Modelling - part 3, 45/63


The asymptotic stability of the Explicit Euler scheme (II)
The inequality |1 + α| ≤ 1 de-
fines, in the complex plane, a cir-
cle of center −1 and radius 1.
−2 −1 0
This region is termed the region
of asymptotic stability of the ex- REE

plicit Euler scheme, and denoted


by REE . Its internal part will be
denoted by int (REE ).

Thus, if we want all the components of z k = (zpk ) to decay to 0, we are forced to


choose ∆t in such a way that the condition
∆tλp ∈ int (REE ) for each p = 1, . . . , n , (9)
is satisfied; this is always possible, thanks to the assumption Reλp < 0 on the
eigenvalues of A.
The explicit Euler scheme is therefore conditionally asymptotically stable, i.e., it is
necessary to satisfy this condition on ∆t, termed the asymptotic stability condition,
in order to get the desired behaviour of the discrete solutions. It may occur, however,
that such a condition is overly restrictive in practice.

A Festa, Numerical Modelling - part 3, 46/63


The asymptotic stability of the Explicit Euler scheme (III)

In the important case where the matrix A is symmetric, and consequently all its
eigenvalues are real and negative, we have ∆tλp ∈ int (REE ) if and only if
−2 < ∆tλp < 0 ;
the second inequality is always fulfilled, whereas the first one is equivalent to
2
∆t < .
|λp |
Thus, the asymptotic stability condition (9) becomes
2
∆t < . (10)
maxp |λp |

If the matrix A has eigenvalues with orders of magnitude quite different from each
other (i.e., if it is ill-conditioned - in the language of systems of differential equations
one says that the system is stiff ), we are obliged to advance with a time-step dictated
by the eigenvalue of largest absolute value, even if the actual behaviour of the exact
solution would not require such a restriction.

A Festa, Numerical Modelling - part 3, 47/63


The asymptotic stability of the Implicit Euler scheme (I)

The implicit Euler scheme applied to the equation z 0 = λz yields


z k+1 = z k + ∆tλz k+1 , k≥0,
i.e.,
(1 − ∆tλ)z k+1 = z k , k≥0.
Thus, the scheme generates the sequence
 ∧k
1
zk = z0 , k≥0,
1 − ∆tλ
which converges to 0 as k → +∞ if and only if the quantity in parenthesis is smaller
than 1 in absolute value.
Setting α = ∆tλ, this is equivalent to the condition
1
<1,
|1 − α|
i.e.,
|1 − α| > 1 .

A Festa, Numerical Modelling - part 3, 48/63


The asymptotic stability of the Implicit Euler scheme (II)

REI

Therefore, the region of asymptotic


stability REI of the implicit Euler 0 1 2

scheme is defined as the set of all


complex numbers α such that |1 −
α| ≥ 1.

Since the real part of ∆tλp is strictly negative, we have


∆tλp ∈ int (REI ) for each p = 1, . . . , n and whichever ∆t > 0 is .
Thus, there are no restrictions on the choice of the time step. We conclude that the
implicit Euler scheme is unconditionally asynptotically stable.

A Festa, Numerical Modelling - part 3, 49/63


The asymptotic stability of the trapezoidal scheme (I)

The trapezoidal (or Crank-Nicolson) scheme applied to the equation z 0 = λz yields


 
1 k 1
z k+1 = z k + ∆tλ z + z k+1 , k≥0,
2 2
namely,
∆t ∆t
(1 − λ)z k+1 = (1 + λ)z k , k≥0,
2 2
whose exact solution is given by
!k
1 + ∆t λ
zk = 2
z0 , k≥0.
1 − ∆t
2
λ
Setting α = ∆tλ, such a solution tends to 0 as k → +∞ if and only if one has
α α
1+ < 1− .
2 2
Now, it is easily seen that if α is any complex number, the inequality
α α
|1 + | ≤ |1 − |
2 2
is equivalent to Re α ≤ 0.

A Festa, Numerical Modelling - part 3, 50/63


The asymptotic stability of the trapezoidal scheme (II)

Therefore, the region of asymp-


totic stability RCN of the trape-
RCN
zoidal scheme is give by the half-
plane on the left of the imaginary
axis; such a region coincides in-
deed with the region in which all
the eigenvalues of the matrix A
have to fall in order for the sys-
tem (6) to have all its solutions
bounded as t → +∞.
In this case, too, one has

∆tλp ∈ int (RCN ) for each p = 1, . . . , n and whichever ∆t > 0 is ;

hence, the trapezoidal scheme is unconditionally asymptotically stable.

A Festa, Numerical Modelling - part 3, 51/63


The asymptotic stability of other schemes

The Runge Kutta schemes presented above are all conditionally asymptotically
stable. Their regions of asymptotic stability are larger that the one for the
Explicit Euler scheme.
(See plots in the Notes of the Course).

The BDF schemes presented above have regions of asymptotic stability which
contain a corner in the half-plane Re α ≤ 0, with center at the origin and
symmetrically placed around the real negative semi-axis.
Therefore, such methods are particularly suited for the discretization of stiff
differential systems, as they turn out to be unconditionally asymptotically stable
if the matrix of the system has all real and negative eigenvales.

A Festa, Numerical Modelling - part 3, 52/63


An example of “stiff” system (I)
Consider the problem 
v 0 = Av , t>0,
v(0) = v0 ,
with  
1001/2 999/2  
2
A = −  and . v0 =
0
999/2 1001/2
The eigenvalues of the matrix are λ1 = −1 and λ2 = −1000, with corresponding
eigenvectors given by w1 = (1, 1)T and w2 = (1, −1)T . Thus,
    
v1 (t) 1 1 z1 (t)
= ,
v2 (t) 1 −1 z2 (t)
with z1 (t) = e−t and z2 (t) = e−1000t , i.e., we obtain
(
v1 (t) = e−t + e−1000t ,
v2 (t) = e−t − e−1000t .
We thus have a very small transient, of the order of 1/1000 seconds, followed by a
much slower evolution, in the time scale of seconds.

A Festa, Numerical Modelling - part 3, 53/63


An example of “stiff” system (II)

If we advance in time with the explicit Euler


scheme, we are forced to respect the asymp-
totic stability condition (10), namely 2

2 1
∆t < = ,
max(| − 1|, | − 1000|) 500

not only during the transient period, but v1

throughout the whole simulation, otherwise


the computation quickly yields an overflow.
Using instead the implicit Euler scheme, or v2
the more accurate trapezoidal scheme, al-
lows us to vary the time-advancing step, 0

choosing it in the order of 1/500 sec- t


3/1000
onds during the transient period, but subse-
quently letting it to increase as the solution
goes towards a steady state.

A Festa, Numerical Modelling - part 3, 54/63


Time discretization of the thermal model

Let us now discretize in time the problem



Bu0 + Au = f (t) , 0<t≤T ,
u(0) = u0 .

using one of the previously presented schemes, namely the Explicit Euler scheme, the
Implicit Euler scheme and the Trapezoidal (or Crank-Nicolson) scheme.
To this end, it is convenient to write the differential system in the equivalent (normal)
form
u0 = F (u, t) = −B −1 Au + B −1 f (t) ( = Au + b(t) ) .
Let us stress that such a transformation is only useful at the conceptual level, in order
to apply the abstract time-advancing schemes in our specific setting. At the
implemententation level, the multiplication by the inverse of B is almost invariably
not efficient, hence, to be avoided; it is surely preferable to leave such matrix on the
left-hand side of the equation, as shown in the sequel.

A Festa, Numerical Modelling - part 3, 55/63


The Esplicit Euler scheme yields

uk+1 = uk − ∆tB −1 Auk + ∆tB −1 f (tk ) , k≥0,

which we re-formulate as

Buk+1 = (B − ∆tA)uk + ∆tf (tk ) , k≥0.

In the latter form, the scheme is not explicit, since at each iteration it requires
the solution of a linear system with matrix B. However, if we approximate B
with the “lumped” mass matrix B̃, which is diagonal, then the cost of computing
uk+1 is essentially comparable to that of an explicit method.
In the sequel, we will see that the asymptotic stability condition for the Explicit
Euler scheme becomes, in this case,

∆t ≤ C h2

(with C proportional to µ = κ/c); this poses a restriction on the choice of the


time-step, which often is not acceptable in practice.
The scheme is first-order accurate in time.

A Festa, Numerical Modelling - part 3, 56/63


The Implicit Euler scheme yields

uk+1 = uk − ∆tB −1 Auk+1 + ∆tB −1 f (tk+1 ) , k≥0,

which we re-formulate as

(B + ∆tA)uk+1 = Buk + ∆tf (tk+1 ) , k≥0.

In this case, one has to solve a linear system at each iteration, with matrix
B + ∆tA symmetric and positive definite (since it is the sum of two matrices
with these properties).
The gain over Explicit Euler is that the scheme is unconditionally stable.
The scheme is again first-order accurate in time.

A Festa, Numerical Modelling - part 3, 57/63


The Trapezoidal (or Crank-Nicolson) scheme yields, for our problem, the update

(B + ∆t
2
A)uk+1 = (B − ∆t
2
A)uk + ∆t
2
( f (tk ) + f (tk+1 ) ) , k≥0.

The scheme is again unconditionally stable, but now second-order accurate in


time.
Hence, with a moderate increment in the cost of computing the right-hand side
as compared to the Implicit Euler scheme, one significantly gains in precision, as
the order of the scheme is increased by one.
If we keep the time-step ∆t constant and we use a direct method to solve the
linear system, then it is convenient to factorize the matrix
∆t
B+ 2
A

(for instance by computing its Choleski factorization) once and for all at the
beginning of the time loop: at each time instant, we will only have to perform a
forward-backward substitution.
On the contrary, if one uses an iterative method, such as Conjugate Gradient,
then the computed solution uk at the previous time instant will provide the initial
guess for the new iteration.

A Festa, Numerical Modelling - part 3, 58/63


The asymptotic stability condition for the Explicit Euler scheme

Recall that the asymptotic stability condition for the Explicit Euler scheme

∆t θh ∈ int (REE ) for any eigenvalue θh of the matrix A = −B −1 A.

Let us observe that θh is an eigenvalue of A = −B −1 A if and only if there exists a


non-zero vector w such that
Aw = θh w ,
i.e.,
B −1 Aw = −θh w ,
namely, if and only if θh = −λh , with λh eigenvalue of the matrix B −1 A.
In turns, this is true if and only if λh is a solution of the generalized eigenvalue problem

Aw = λh Bw .

We have seen that such a problem arises in the discretization of the modal analysis
problem for an elastic membrane.

A Festa, Numerical Modelling - part 3, 59/63


From this relation we derive

wT Aw = λh wT Bw ,

which provides th expression of λh as a Rayleigh quotient

wT Aw
λh = .
wT Bw
This shows that all the eigenvalues λh are real and strictly positive (since the matrices
A and B are both symmetric and positive definite), hence, all the eigenvalues θh of
the matrix A are real and negative.
Consequently, the asymptotic stability condition of the Explicit Euler scheme
2 2
∆t ≤ = .
max |θh | max λh

Since we have stated above that max λh ∼ ch−2 , the asymptotic stability condition
becomes
∆t ≤ C h2 ,
as anticipated.

A Festa, Numerical Modelling - part 3, 60/63


Time discretization of the elastic model: the Newmark scheme

In order to discretize in time the second-order system


u00 = F (u, t) = −B −1 Au + B −1 f (t) ,
it is customary to resort to the Newmark scheme.
It is written as
uk+1 −2uk +uk−1 = ∆t2 (βF (uk+1 , tk+1 )+(1−2β)F (uk , tk )+βF (uk−1 , tk−1 )) ,
where β ≥ 0 is a parameter to be chosen. Equivalently, this can be written as
B(uk+1 − 2uk + uk−1 ) + ∆t2 A(βuk+1 + (1 − 2β)uk + βuk−1 ) =
= ∆t2 (βf (tk+1 ) + (1 − 2β)f (tk ) + βf (tk−1 )) .
The scheme defines the time approximations starting from k = 1. Hece, it requires
two initial values, u0 and u1 . The first value is obviously chosen equal to u0 , whereas
the Taylor expansion of u(t) at the origin, u(t1 ) = u(0) + ∆tu0 (0) + O(∆t2 ),
suggests the choice u1 = u0 + ∆tv0 .

A Festa, Numerical Modelling - part 3, 61/63


Let us remark that if β = 0 and if the mass matrix B is replaced by the lumped mass
matrix B̃, then the previous scheme is explicit. In any other case, the scheme is
implicit, and at each time instant uk+1 is determined by solving a linear system with
matrix B + ∆t2 βA.
As far as accuracy is concerned, the scheme turns out to be second-order accurate for
each value of β.
On the other hand, as far as asymptotic stability is concerned, the scheme turns out
to be
1
unconditionally stable if β ≥ 4
.
1
only conditionally stable if β < 4
.
In the latter case, the asymptotic stability condition is
4
∆t2 λh,max < ,
1 − 4β

where λh,max denotes the maximum eigenvalue of the matrix B −1 A. We have


already noticed that the order of magnitude of this eigenvalue is O(h−2 ).

A Festa, Numerical Modelling - part 3, 62/63


As a consequence, the previous conditions enforces a restriction of the type

∆t ≤ C h

on the choice of the time step. Such a condition is by far less stringent that the
stability condition for a conditionally stable scheme applied to the heat equation,
which is of the type ∆t ≤ C h2 .
In most cases, such a condition turns out to be fully acceptable, since it is anyway
required by the need of guaranteeing enough time accuracy on the discretization.

A Festa, Numerical Modelling - part 3, 63/63

You might also like