In this chapter we consider parabolic partial differential equations that are equipped with initial and boundary conditions, i. e.,
∂t∂u(x,t)+Au(x,t)+ψ(u(x,t))u(x,0)u(x,t)=bD(x,t)or∇u(x,t)⋅n(x)=f(x,t)=u0(x)=bN(x,t)in Ω×(0,T)in Ωon ∂Ω×[0,T),
where (Av)(x):=∇⋅(K(x)∇v(x))+c(x)⋅∇v(x) is a linear elliptic second order differential operator, the maps ψ:R→R and f:Ω×(0,T)→R might be non-linear. We assume that ψ is differentiable. u0 represents the initial condition at time t=0. Dirichlet or Neumann boundary conditions are given by bD or bN respectively. If we have Dirichlet boundary conditions, we need in addition that u0(x)=bD(x,0) on ∂Ω.
For solving parabolic equations numerically one often uses so called semi-discrete methods, i.e.,
method of lines (also known as vertical line method/method of lines, MOL) where one discretizes in space first
Rothe method (also known as horizontal line method/method of lines transpose/transverse, MOLT) where one discretizes first in time.
The term semi-discrete indicates that there must follow another discretization step to make the discretization scheme complete. The idea of the semi-discretization is to deduce a familiar problem type as an intermediate step. The method of lines in particular leads to a system of ordinary differential equations which can be solved using for example Runge-Kutta methods. Rothe’s method on the other hand results into a sequence of elliptic partial differential equations. Hence one needs to solve an elliptic PDE at each timestep.
There exist also schemes that discretise in space and time simultaneously, e.g. space-time FEM. However the purpose of this section is not to cover every existing time discretization method but to give a short abstract of the basic theory.
The sequence of discretization (first space, then time or first time, then space) does not matter and leads to the same results, as long as the spatial grids are (time-independent and) uniform and the time steps are fixed. For non-uniform grids or time-varying grids and adaptively chosen time-steps, the sequence of discretization does matter. In Kaskade, the sequence first time, then space is chosen such that adaptivity in space and time can be established. Up to a given accuracy, the time discretization yields variable time steps while the resulting elliptic problems can be solved by chosing individual spatial meshes to assure the accuracy required by the temporal discretization. We will introduce some particular semi-discrete schemes and show an implementation of two schemes applied to the heat equation in the example section in the moving source tutorial.
Method of lines
To discretize a parabolic equation like (1) in space first, we need to consider its variational formulation. For this purpose we proceed as follows:
multiply the first equation in (1) with an appropriate test function v(x) that depends only on space
integrate over the spatial domain Ω
apply integration by parts if possible.
Applying these steps to (1) will lead to the following variational formulation(dtdu(t),v)+a(u(t),v)+(ψ(t),v)=(f,v)+(∇u(t)⋅n,v)∂Ω¸∀t∈(0,T)∀v
with
a(v,w)=∫Ω(K∇v⋅∇w+c⋅∇vw)dxand(v,w)=∫Ωvwdxand(v,w)∂Ω=∫∂Ωvwds.
In the following we assume homogeneous Dirichlet or homogeneous Neumann conditions such that the boundary term in (2) vanishes.
Discretization in space
When using the method of lines we can discretize in space using Galerkin discretization with the basis functions ϕ1,…,ϕN which depend on space only. We can then formulate the semi-discrete problem of (2) in matrix form:
Note that the coefficient vector U is time dependent such that (3) actually defines a system of ordinary differential equations. There are many well known methods for solving ODEs numerically which can be used to make the semi-discrete problem (3) fully discrete.
Fully discrete methods based on the method of lines
JU: our tutorial (in general, i think the whole concept of using time stepping schemes in Kaskade) is based on Rothe’s method
In the example section you will find implementations of two time integration schemes, namely
Linear implicit Euler: time discretization based on the implicit Euler method and
LIMEX: interaction of the linear implicit Euler and extrapolation method.
The following two subchapters give further descriptions of the theory they are based on.
Rothe’s method
Another way of solving instationary problems like (1) is the Rothe method. Instead of discretizing first in space, the Rothe method discretizes first in time.
One-Step Θ-Scheme
A common approach is the so called One-Step Θ-Scheme for discretizing the temporal derivative. Given the solution un at time tn we can approximate the solution un+1 at time tn+1 by solving the equation
τun+1−un+ΘAun+1(x)+(1−Θ)Aun(x)+Θψ(un+1(x))+(1−Θ)ψ(un(x))un+1(x)=bD(x,tn+1)or∇un+1(x)⋅n(x)=Θfn+1(x)+(1−Θ)fn(x)=bN(x,tn+1)in Ωon ∂Ω
with initial conditions u0(x)=u(x,0) in Ω and stepsize τ=tn+1−tn. With this scheme one has to solve a boundary value problem in each timestep which can be discretized in space using Galerkin discretization to obtain a fully discrete scheme.
For Θ=0, one obtains the forward Euler scheme, for Θ=0.5 the Crank–Nicolson scheme (midpoint rule), and for Θ=1 the backward Euler scheme. Note that the explicit Euler is not stable for every stepsize τ and that implicit Euler and Crank-Nicolson can become quite expensive if we try to solve more complicated problems, e.g. non-linear ones.
In the literature one also finds that the One-Step Θ-Scheme is directly applied onto the variational formulation (2).
A simple example
The heat equation
Let us consider the heat equation on a bounded domain Ω⊂Rn with initial condition u0 and homogeneous Dirichlet boundary conditions
∂t∂u(x,t)−κΔu(x,t)u(0,x)u(t,x)=f(x,t)=u0(x)=0in Ω×(0,T)x∈Ω(t,x)∈(0,T)×∂Ω.
such that the data f,u0 is continuous and that the consistency condition u0(x)=0∀x∈∂Ω of the initial data on the boundary is satisfied.
Solution
The data f on the right-hand side can be physically interpreted as sinks and sources of heat along the domain Ω. An important observation is that if there are no sources of heat in the domain, i.e. f≤0 in (0,T)×Ω), the temperature u in (0,T)×Ω cannot exceed the highest temperature on the boundary. This can be proven mathematically and is known as the Maximum Principle. It is an important tool for proving uniqueness of the initial boundary value problem.
If we consider a very simple one-dimensional example, where Ω=(0,1) and we are in the homogeneous case f=0 with u0 continuous, piecewise differentiable and g=0, the unique solution is given by
u(t,x)=k=0∑∞ake−(kπ)2tsin(kπx)
with the Fourier coefficients ak=2∫01u0(ξ)sin(kπξ)dξ.
Numerical methods for the heat equation
We will now apply the time integration as described above, starting with the method of lines.
Method of lines
We first derive the semi-discrete variational formulation (see equation (2) ) of the heat equation. Applying the steps mentioned before leads to
(dtdu(t),v)+a(u(t),v)=(f(t),v)∀t∈(0,T)∀vwitha(v,w)=∫Ωκ∇v⋅∇wdxand(v,w)=∫Ωvwdx.
In analogy to the Galerkin method for elliptic problems we choose a finite dimensional space Sh and approximate the continuous solution u(t) by a uh(t)∈Sh for all t∈[0,T].
For this one dimensional example we choose the piecewise linear (P1) finite elements on Ω=[0,1] and an equidistant distribution of N+2 nodes xi=ih,i=0,…,N+1 with distance h=(N+1)−1 for some N∈N.
The basis functions
ϕi(x)=⎩⎨⎧(x−xi−1)/h,1−(x−xi−1)/h,0,x∈[xi−1,xi]x∈[xi,xi+1]else.i=1,…,N
are also known as hat functions. With this basis ϕ1,…ϕN of Sh and representating the approximate solution as uh(t)=∑k=1Nuk(t)ϕk we can write the semi-discrete problem in matrix form
BU˙+AUU(0)=Ft∈(0,T)=U0,
with
mass matrixB=((ϕj,ϕi))i,j=1N=6h⎝⎛41141⋱14114⎠⎞and stiffness matrixA=(a(ϕj,ϕi))i,j=1N=h1⎝⎛2−1−12−1⋱−12−1−12⎠⎞.
with
BAFUU0=((ϕi,ϕj))i,j=1N=(a(ϕi,ϕj))i,j=1N=((f(t),ϕi))i=1N=(μi(t))i=1N=(μi(0))i=1Nmass matrixstiffness matrixright-hand sideunknown component vectorinitial component vector
In practice the matrix B/h becomes the identity matrix by the so called “lumping”: Basically one simply sums up the row values and writes the sum to the diagonal. This is alike using the trapezoid rule as quadrature rule for the calculation of the values of B. Hereby one saves the calculation of M−1, and astonishingly, this simplification leads to the same approximation quality. This is reasonable as the mass matrix B leads to a correlation of the time derivatives in different points — a phenomenon which occurs due to the discretization and does not even exist in the continuous problem. In this sense, lumping can be regarded as a rectification of the discrepancy between the discrete and continuous problem.
The matrix A/h2 has the eigenvalues λi≈(i2π)2 for small h. That means a finer space dicretization leads to a bigger range of eigenvalues. An explicit time discritization would now require a very small step-size restriction. Hence one has to use implicit methods for such problems.
Rothe’s method: One-step Θ-scheme
The one-step Θ-scheme for the heat equation looks as follows
τun+1−un−ΘκΔun+1−(1−Θ)κΔun=Θfn+1+(1−Θ)fn.
References
To be included into text and then shifted to “references” section
Deuflhard, Weiser: adaptive solutions for PDEs
John: Partial differential euqations
Kornhuber,Schuette: lecture notes Numerics III
P. Knabner, L.Angermann: Numerik partieller Differentialgleichungen