Professional Documents
Culture Documents
NUMERICAL INVESTIGATIONS
STEINAR EVJE
The purpose is to modify the numerical scheme given in ”Case1A” and used to explore the
linear transport equation ut + ux = 0 such that it can compute numerical solutions of related
problems. Before you do the matlab exercise, take a look at the exercises below which deal
with the stability condition and are relevant for the matlab exercise.
(A) Compute numerical solution of the problem ut + xux = 0 (exercise 1.5c without
source term from ”2-Intro-PDE-TW”) with initial data u(x, t = 0) = cos(90x) on a
domain [−0.25, +0.25]. Compute solution at time T = 0.25 and include comparison
of numerical and analytical solution at final time.
a) First formulate a stable upwind based scheme for this advection equation. Note
the shift in sign of the velocity at x = 0. Implement this scheme by modifying
the matlab script for the simpler problem ut + ux = 0.
b) Start with a grid of 100 cells. How many time steps must be chosen to respect
the stability criterion for this problem(*)?
What can you say about the accuracy of the numerical scheme based on the
upwind approach?
c) How many grid cells must be used in order to capture well the exact (analytical)
solution?
(*) Note that the velocity is x in ut + xux = 0 and varies within the domain
[−0.25, 0.25], but it is always true that |x| ≤ 1 in [−0.25, 0.25] so that standard stability
∆t
condition ∆x ≤ 1 should work.
1
2 STEINAR EVJE
Three Related Exercises. The following exercises deal with extensions of the stability
criterion that was found for the upwind scheme for ut +ux = 0 with initial data and boundary
data defined by
u(x, t = 0) = u0 (x), u(x = 0, t) = u(x = 1, t) = 0.
The upwind scheme then takes the form:
∆t
un+1
j = unj − λ(unj − unj−1 ), j = 1, . . . , M, λ=
∆x
u0 = uM +1 = 0.
PM PM PM
It was found that 0 ≤ λ ≤ 1 would ensure that 1 |un+1
j |≤ 1 |unj | ≤ . . . ≤ 1 |u0j |.
∆t
What is the condition on λ = ∆x we must take into account in order to achieve this
estimate and ensure numerical stability?
∆t
subject to the stability criterion aλ = a ∆x ≤ 1.
3
where max[0,1] |a0 (x)| ≤ K and T > 0 is final time. Can you demonstrate this?