Numerical Methods for PDEs and Applications
Camile Fraga Delfino Kunz
06 February 2019
Review Exercises - Part 2
Content:
• Finite difference schemes;
• Linear multistep methods;
• Local truncation errors;
• Consistency, stability, convergence;
• Stiff problems.
1) Derive the finite difference formula, using the method of undetermined co-
efficients, to approximate u0 (x) using the values of u at the following points.
Calculate the accuracy at each case, that is, the Local Truncation Error (LTE):
a) u(x + h) and u(x − h);
b) u(x) and u(x + h);
c) u(x) and u(x − h).
2) Using the same procedure as before, find finite difference formulas for u00 (x)
using the following values and calculate its LTE:
a) u(x − h), u(x) and u(x + h);
b) u(x), u(x + h) and u(x + 2h).
3) Use the method of undetermined coefficients to set up the 5 × 5 Vandermond
system that would determine a fourth-order accurate finite difference approxi-
mation to u00 (x) based on 5 equally spaced points,
u00 (x) = c−2 u(x − 2h) + c−1 u(x − h) + c0 u(x) + c1 u(x + h) + c2 u(x + 2h) + O(h4 )
4) Consider the problem u00 (x) = f (x), 0 < x < 1 with Dirichlet boundary
conditions u(0) = α and u(1) = β.
a) Write the linear system AU = F that should be solved for finding the grid
values U1 , . . . , Um using the centered approximation for the second derivative,
that is,
Ui−1 − 2Ui + Ui+1
u00 (xi ) ≈ , i = 1, . . . , m
h2
where h = xi − xi−1 is the discretization size of the grid.
b) And if instead we had the boundary condition u0 (0) = α and u(1) = β, how
would the linear system look like?
1
5) Calculate the accuracy order and the absolute stability region for each fol-
lowing numerical method for Initial Value Problems:
U n+1 − U n
a) Forward Euler: = f (U n );
k
U n+1 − U n
b) Backward Euler: = f (U n+1 );
k
U n+1 − U n 1
c) Trapezoidal: = [f (U n ) + f (U n+1 )].
k 2
6) A Linear Multistep Method (LMM), with r steps, can be written like:
Xr r
X
αj U n+j = k βj f (U j+n , tn+j )
j=0 j=1
and it has characteristic polynomials
Xr r
X
ρ(ζ) = αj ζ j and σ(ζ) = βj ζ j .
j=0 j=0
a) Derive a general formula for the LTE.
b) Show how to get the consistency conditions
ρ(1) = 0 and ρ0 (1) = σ(1)
c) What means to say that a LMM is zero-stable?
d) What is the condition(s) for a LMM be convergent?
e) Can a LMM be zero-stable, and for some fixed value of time step k doesn’t
show convergence to the exact solution? Give an example.
f ) Why we also need the concept of absolute stability?
7) Write a pseudo-code to solve the IVP:
(
u0 = sin u , t ∈ (0, 1]
u(0) = a
for some constant a, using the trapezoidal rule.
Write with details the Newton’s method step.
8) A two-stage explicit Runge-Kutta method is given by:
1
U ∗ = U n + kf (U n )
2
U n+1 = U n + kf (U ∗ )
a) Show that this method is second order accurate.
b) Determine the real part of the stability region. (Tip: apply the method to
the test problem u0 = λu).
2
9) Consider the diffusion problem:
∂2u
∂u
= D
∂t ∂u2
u(x, 0) = η(x) , x ∈ [0, 1]
u(0, t) = g0 (t) , t>0
u(1, t) = g1 (t) , t>0
a) Using the Method of Lines (MOL), write the problems as a ODE system
U 0 (t) = AU (t) + g(t).
b) Suppose now that you want to solve this ODE system using Forward Euler’s
method. Considering that the eigenvalues of the matrix A are
2
λp = (cos pπh − 1) , p = 1, . . . , m
h2
Dk 1
show that the stability condition is ≤ .
h2 2
10) Consider the system:
0
u1 = −K1 u1 u2 + K2 u3
u02 = −K1 u1 u2 + K2 u3
0
u3 = K1 u1 u2 − K2 u3
with K1 = 200 and K2 = 1; u1 (0) = 3, u2 (0) = 4 and u3 (0) = 2.
a) Calculate the Jacobian matrix and it’s eigenvalues, and find a upper bound
for the eigenvalues.
b) If you are using a forward Euler method, what is the stability condition
for this problem?
c) And for the backward Euler method?
References
1 Leveque, R. J. Finite Difference Methods for Ordinary and Partial Differ-
ential Equations. SIAM, 2007.