Numerical Methods for Differential Equations FMNN10/NUMN12

Numerical Methods for Differential Equations FMNN10/NUMN12
Exam 2014-04-29
Answers
Exam duration 14:00 – 19:00. A minimum of 16 points out of 32 are required
to pass. Your grade is determined by the sum of your exam and project
scores, in accordance with the rules on the course home page.
No computers, pocket calculators, cell phones, browsing tablets or any other
electronic devices, and no textbooks, lecture notes or written material, may
be used during the exam.
1. (5p) You are familiar with the BDF metods, e.g.
3
1
yn+1 − 2yn + yn−1 = hf (yn+1 )
2
2
for the initial value problem
y 0 = f (y);
y(0) = y0 .
0
The BDF methods are implicit and approximate yn+1
by a linear combination of y values. But one can also construct explicit methods based
0
on backward differences that approximate yn+1
. To the 2-step BDF
above there corresponds an explicit method
3
1
yn+1 − 2yn + yn−1 = hβ1 f (yn ) + hβ0 f (yn−1 ).
2
2
(a) Show that this method is zero-stable. (1p)
(b) Determine the values of the parameters β0 and β1 so that the
method is of second order. (3p)
(c) Is the resulting method A-stable? (Motivate your answer.) (1p)
Ans. The roots of the ρ polynomial are 1 and 1/3, so the method is
zero-stable. As the method is explicit it cannot be A-stable. It is 2nd
order for β1 = 2, β0 = −1.
2. (4p) Consider the 3-stage Runge-Kutta method with Butcher tableau
0
0
0
0
1/2 1/2 0
0
3/4 0 3/4 0
2/9 3/9 4/9
1
(a) Write down the formulas for using this method. (1p)
(b) Find its stability function R(hλ) and express it as a rational function, i.e., on the form P (hλ)/Q(hλ), where P and Q are polynomials. (3p)
Ans. The formulas are
hY10 = hf (yn )
hY20 = hf (yn + hY10 /2)
hY30 = hf (yn + 3Y20 /4)
with updating formula
yn+1 = yn +
1
2hY10 + 3hY20 + 4hY30
9
Applying the method to y 0 = λy gives
hY10 = hλ
hY20 = hλ(1 + hλ/2)
hY30 = hλ(1 + 3hλ/4 + 3(hλ)2 /8)
so
1
2hλ + 3hλ + 3(hλ)2 /2 + 4hλ + 3(hλ)2 + 3(hλ)3 /2
9
= 1 + hλ + (hλ)2 /2 + (hλ)3 /6.
R(hλ) = 1 +
3. (4p) Consider the stationary convection–diffusion equation
y 00 + αy 0 = g(x)
y(0) = 1,
y(1) = 1.
(a) Introduce a suitable grid and discretize with a standard second
order method. Give all details about the grid, such as the number
of grid points and their location, as well as mesh width ∆x, and
formulate the discretization. Include the boundary conditions in
the equation system. (2p)
(b) Construct the matrix associated with the discretization. Is it a
Toeplitz matrix? Is it symmetric, skew-symmetric, circulant, or
of some other structure? (2p)
2
Ans. With N interior points xj = j∆x and ∆x = 1/(N + 1), the
discretization is
1 − 2y1 + y2
−1 + y2
+α
= g(x1 )
2
∆x
2∆x
yj−1 − 2yj + yj+1
−yj−1 + yj+1
+α
= g(xj )
2
∆x
2∆x
−yN −1 + 1
yN −1 − 2yN + 1
+α
= g(xN ).
2
∆x
2∆x
The matrix is trididagonal Toeplitz (neither symmetric, skew-symmetric
nor circulant) and becomes


−2
1 + α∆x/2

−2
1 + α∆x/2
1 
 1 − α∆x/2

=


..
∆x2 

.
1 − α∆x/2 −2
4. (6p) Consider the eigenvalue problem associated with the stationary
convection–diffusion operator above, i.e.,
u00 + αu0 = λu
with boundary conditions u(0) = u(1) = 0 on [0, 1].
(a) Solve the analytical eigenvalue problem and find its eigenvalues
λk and corresponding eigenfunctions uk (x). (3p)
(b) Construct an approximating algebraic eigenvalue problem
Au = λ∆x u.
by using a second order discretization using symmetric difference
quotients to approximate the derivatives. Give the matrix A. (1p)
(c) Assuming that α > 0, what are the eigenvalues of A if one chooses
∆x so that
α∆x
= 1?
2
Is that result realistic? (2p)
Ans. The analytic eigenvalues are λk = −(kπ)2 − α2 /4 with eigenfunctions uk (x) = exp(−αx/2) sin kπx ≡ w(x)vk (x). The matrix is the
same as in the previous problem. For α∆x/2 = 1 the matrix becomes
upper triangular, so all eigenvalues are equal to
λk = −
3
2
,
∆x2
which is totally unrealistic, as it in no way resembles the analytic
eigenvalues.
5. (5p) Consider the following PDEs for t ≥ 0 and x ∈ [0, 1]:
(a) ut = d · uxx + ux + f (u)
(b) ut + a · ux = 0
(c) ut + a · ux = d · uxx
(d) utt = c2 · uxx
(e) ut + uux = uxx
For each equation, state whether the problem is elliptic, parabolic or
hyperbolic, and state where (i.e., on which boundary) boundary conditions are required in each case for the problem to be well-posed. All
parameters a, c and d are supposed to be positive numbers. In addition,
give the “name” of each equation (e.g. “convection–diffusion equation”
etc.).
Ans. Problem a) is the parabolic convection-diffusion-reaction equation, requiring boundary conditions at both ends; b) is the hyperbolic
advection equation, requiring (for a > 0) boundary conditions at x = 0;
c) is the parabolic convection-diffusion equation, requiring boundary
conditions at both ends; d) is the hyperbolic wave equation, requiring
boundary conditions at both ends; e) is the viscous Burgers equations,
parabolic and requiring boundary conditions at both ends.
6. (4p) In the stationary convection–diffusion problem u00 + αu0 = f
studied in the previous problems, the eigenfunctions are of the form
sin kπx
uk (x) = p
,
w(x)
k = 1, 2, . . .
Introduce the weighted inner product
Z 1
hu, viw =
u(x)v(x) w(x)dx.
0
(a) Show that the eigenfunctions uk (x) are orthogonal with respect
to the weighted inner product h·, ·iw . (2p)
(b) Compute the corresponding norm kuk kw of the eigenfunctions.
(2p)
4
Ans. We have
Z
huk , um iw =
0
1
v v
√k √m wdx =
w w
Z
1
vk vm dx = hvk , vm i = δkm /2,
0
where vk = sin kπx, and the orthogonality is well known (cp. Fourier
2
series). Further, δkm
√ is the Kronecker delta, implying that kuk kw =
1/2, or kuk kw = 1/ 2.
7. (4p) Consider the convection–diffusion equation
ut = uxx + αux
with homogeneous boundary conditions, and initial condition u(0, x) =
g(x).
(a) Introduce a suitable notation and write down a standard 2nd
order method-of-lines discretization in space combined with the
trapezoidal rule for time-stepping (“Crank–Nicolson’s method”).
Give the details about your grid and choice of ∆x. (2p)
(b) As the method is implicit, one will have to solve a linear system
of equations on each step. Construct this system. (2p)
Ans. See previous exam in December 2013.
Lycka till!
G.S.
5