Numerical Methods for Partial Differential Equations
MATH 18.336

Fall 2009
18.336 Pset 4 Solutions
Bn,n1 = xn1 /6.
Amn can be split into two pieces: Amn =
Kmn + Vmn where K is the kinetic energy
d2
from the 2 and V is the potential energy
dx
from the V (x). Kmn we evaluated in class
Due Thursday, 20 April 2006.
Problem 1: Galerk
Numerical Methods of Partial Differential Equations
MATH 18.336

Spring 2009
18.336 spring 2009
lecture 14
Von Neumann Stability Analysis
Laxequivalence theorem (linear PDE):
Consistency and stability
convergence
(Taylor expansion) (property of numerical scheme)
Idea in von Neumann stability analysis:
Study growth of waves eikx
Numerical Methods of Partial Differential Equations
MATH 18.336

Spring 2009
18.336 spring 2009
lecture 5
02/19/09
Finite Dierence (FD) Approximation
Consider u C l .
Goal: Approximate derivative by nitely many function values:
m
ku
(x0 )
ai u(xi ) (k l)
xk
i=0
Image by MIT OpenCourseWare.
Vector of coecients a = (a0 , a1 , , am
Numerical Methods of Partial Differential Equations
MATH 18.336

Spring 2009
18.336 spring 2009
lecture 9
Nonperiodic Domains
So use algebraic polynomials p(x) = a0 + a1 x + + aN xN
Problem: Runge phenomenon on equidistant grids
p(x)u(x) as N
Remedy: Chebyshev points
j
xj = cos
N
PN (x) u(x) as N
1
03/05/09
Spectral Dierentiat
Numerical Methods of Partial Differential Equations
MATH 18.336

Spring 2009
18.336 spring 2009
lecture 1
02/03/09
18.336 Numerical Methods for Partial Dierential Equations
Fundamental Concepts
Domain Rn with boundary
PDE in
b.c. on
PDE = partial dierential equation
b.c. = boundary conditions
(if time involved, also i.c. = in
Numerical Methods of Partial Differential Equations
MATH 18.336

Spring 2009
18.336 spring 2009
lecture 15
02/13/08
Finite Dierence Methods for the OneWay
Wave Equation
ut = cux
u(x, 0) = u0 (x)
Solution: u(x, t) = u0 (x + ct)
Information travels to the left
with velocity c.
Image by MIT OpenCourseWare.
Three Approximations:
n
n
Numerical Methods of Partial Differential Equations
MATH 18.336

Spring 2009
18.336 spring 2009
lecture 11
03/12/09
Ecient Methods for Sparse Linear Systems
If spectral FFT !
If nonspectral (FD, FE):
elimination (direct)
iterative multigrid
Krylov methods (e.g. conjugate gradients)
Elimination Methods
Solve A
x = b
Matlab: x
Numerical Methods of Partial Differential Equations
MATH 18.336

Spring 2009
18.336 spring 2009
lecture 6
02/24/09
General Linear Second Order Equation
a(x)uxx (x) + b(x)ux (x) +
c(x)u(x) = f (x) x ]0, 1[
u(0) =
u(1) =
diusion
advection
growth/decay
source
Approximation:
ui1 2ui + ui+1
ui+1 ui1
ai
+ bi
+ ci ui = fi
2
Numerical Methods of Partial Differential Equations
MATH 18.336

Spring 2009
18.336 spring 2009
lecture 3
Four Important Linear PDE
Laplace/Poisson equation
2 u = f in
u = g on 1 Dirichlet boundary condition
u
= h on 2 Neumann boundary condition
n
1 2 =
Image by MIT OpenCourseWare.
f 0 Laplace equation
2 u = 0
u = harmonic func
Numerical Methods for Partial Differential Equations
MATH 18.336

Fall 2009
18.336 Pset 3 Solutions
Problem 1: Staggeredgrid Leapfrog
(a) For
= 0,
un+1 in terms of un and v n+1/2
im
the m dependence with e
:
leapfrog works as follows. We rst express
after taking the spatial Fourier transform to replace
via,
v
un+1 = un + b(2i
Numerical Methods for Partial Differential Equations
MATH 18.336

Fall 2009
18.336 Pset 2 Solutions
Problem 1: CrankNicolson
We'll analyze it for a general rst. As usual, we look at a Fourier eigenmode: let v
and solve for the amplication factor g(, x, t). Then:
n
m
g = 1 at g
and thus:
g=
where = t/x. Therefore, g
2
= g n eim
Numerical Methods for Partial Differential Equations
MATH 18.336

Fall 2009
18.336 Pset 1 Solutions
0
10
1
10
Problem 1: Trig. interp. poly.
2
10
When aliasing is included, the general form
(x) d2100/dx2
(a)
for the interpolated function is:
N 1
ck ei(k+
f (x) =
k N )x
,
k=0
3
10
4
10
5
10
6
10
7
10
and thus the meansquare slo
Numerical Methods for Partial Differential Equations
MATH 18.336

Fall 2009
18.336 Midterm Exam
1
0.8
equal weight,
90 minutes. All problems have
so
0.6
don't spend too much time on one prob0.4
lem.
0.2
Problem 1 (30 points): Velocity
0
0.2
Consider the leapfrog method for the (unsplit)
scalar wave equation
2
utt = a uxx :
0.4
Numerical Methods for Partial Differential Equations
MATH 18.336

Fall 2009
18.336 Midterm Solutions
1
0.9
Problem 1 (30 points): Velocity
ei(mn) ,
(a) Plugging in
0.8
0.7
and employing the
0.6
vg / a
usual trig identites, we nd:
sin(/2) = a sin(/2)
0.5
0.4
0.3
vg = d/d/
This gives a group velocity
of:
0.2
0.1
vg
=
a
cos(/2)
1
(
Numerical Methods of Partial Differential Equations
MATH 18.336

Spring 2009
18.336 spring 2009
lecture 13
03/19/09
Initial Value Problems (IVP)
ut = Lu
u = u0
u=g
where L
in ]0, T [
PDE
on cfw_0
initial condition
on ]0, T [ boundary condition
dierential operator.
Ex.: L = 2
Poisson equation heat equation
Lu = b u
advection eq
Numerical Methods of Partial Differential Equations
MATH 18.336

Spring 2009
18.336 spring 2009
lecture 2
02/05/09
WellPosedness
Def.: A PDE is called wellposed (in the sense of Hadamard), if
(1) a solution exists
(2) the solution is unique
(3) the solution depends continuously on the data
(initial conditions, boundary condition
Numerical Methods of Partial Differential Equations
MATH 18.336

Spring 2009
18.336 spring 2009
lecture 10
03/10/09
Elliptic Equations and Linear Systems
In rectangular geometries, construct 2D/3D from 1D by Tensor product.
(uxx + uyy ) = f (x, y ) ] 1, 1[2
Ex.:
u = 0 on
Image by MIT OpenCourseWare.
A
ssume have 1D discretization
Numerical Methods of Partial Differential Equations
MATH 18.336

Spring 2009
18.336 spring 2009
lecture 4
02/12/09
Heat equation
ut = 2 u
Physics:
Ficks law: ux F
= au
d
mass balance:
u dx = b
F n dS = b
divF dx
dt V
V
V
ut = b div(au) = c 2 u
simple: c = 1
Fundamental Solution
x2
1
(x, t) =
e 4t
(4t)n/2
ut = 2 u
in Rn ]