3-SlidesPart3 23
3-SlidesPart3 23
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 ∂Ω ,
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.
u=0 on ∂Ω , 0 < t ≤ T,
u = u0 , ∂u = v0
in Ω , t=0.
∂t
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
Let us divide the equation by c, and let us set µ = κ/c and f = ρq/c.
u=0 on ∂Ω , 0 < t ≤ T ,
u = u0 in Ω , t=0.
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.
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.
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 .
ρ`m = ρ(x` , ym )
At the boundary nodes, we enforce, at each time instant 0 < t ≤ T , the conditions
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 .
Then, the previous equations give rise to the system of ordinary differential equations
Bu0 + Au = f , 0<t≤T ,
u(0) = u0 .
uh (t) ∈ Vh and satisfies
Z Z Z
∂uh
ρ
vh dx + µ∇uh · ∇vh dx = f vh dx for each vh ∈ Vh .
Ω ∂t Ω Ω
N
X
uh (x, t) = uk (t)ϕk (x) , (1)
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 Ω Ω
where Z
bjk = ρ ϕk ϕj dx
Ω
are the entries of a matrix B, termed the mass matrix.
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 .
Ω
The system of ordinary differential equations (2) is then expressed in the vectorial form
Bu0 + Au = f , 0<t≤T ,
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
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
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.
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.
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.
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 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= β ,
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
with Z Z
1 1
ρj−1/2 ∼ ρ(x) dx , ρj+1/2 ∼ ρ(x) dx .
hj Ij hj+1 Ij+1
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 .
− ω 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 ∂Ω ,
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 .
Ω Ω
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 ,
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
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.
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 .
u(tk+1 ) − u(tk )
' u0 (tk ) = F (u(tk ), tk ) .
∆t
u(tk+1 ) − u(tk )
' u0 (tk+1 ) = F (u(tk+1 ), tk+1 )
∆t
u(tk+1 ) − u(tk−1 )
' u0 (tk ) = F (u(tk ), tk )
2∆t
h i
uk+1 = uk + ∆t 1
2
F (uk , tk ) + 21 F (uk+1 , tk+1 ) , k≥0.
uk+1 = uk + ∆t
2
F1 + 31 F2 + 49 F3 ,
9
k≥0,
F1 = F (uk , tk ) ,
F2 = F (uk + 21 ∆tF1 , tk + 12 ∆t) ,
F3 = F (uk + 34 ∆tF2 , tk + 34 ∆t) .
uk+1 = uk + ∆t
1
F1 + 31 F2 + 13 F3 + 16 F4 ,
6
k≥0,
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) .
3 k+1
2
u − 2uk + 21 uk−1 = ∆tF (uk+1 , tk+1 ) , k≥1,
11 k+1
6
u − 3uk + 32 uk−1 − 13 uk−2 = ∆tF (uk+1 , tk+1 ) , k≥2.
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.
are given by
zp (t) = eλp t z0p
and since by assumption Re λp < 0, one has
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 → ∞.
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 .
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.
REI
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.
2 1
∆t < = ,
max(| − 1|, | − 1000|) 500
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.
which we re-formulate as
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
which we re-formulate as
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.
(B + ∆t
2
A)uk+1 = (B − ∆t
2
A)uk + ∆t
2
( f (tk ) + f (tk+1 ) ) , k≥0.
(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.
Recall that the asymptotic stability condition for the Explicit Euler scheme
Aw = λh Bw .
We have seen that such a problem arises in the discretization of the modal analysis
problem for an elastic membrane.
wT Aw = λh wT Bw ,
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.
∆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.