Notes 2
Notes 2
PDE
Mary Pugh
1 Ownership
These notes are the joint property of Rob Almgren and Mary Pugh.
2 Boundary Conditions
We now want to discuss in detail methods for solving the linear di usion
equation for u(x, t)
ut = D uxx (1)
We shall suppose that the domain is XL ≤ x ≤ XR , and that initial data
u0 (x) is given at t = 0:
u(x, 0) = u0 (x), X L ≤ x ≤ XR .
1
2 Mary Pugh Mat1062 Jan. 13, 2009
xj = XL + j h, j = 0, 1, . . . , N,
Uj (t) ≈ u xj , t), j = 0, . . . , N.
That is, the jth component of the vector, Uj (t) is supposed to approximate
the PDE's solution at the xj grid point: u(xj , t).
We take the initial data to be an exact sample of the true initial data
u0 (x):
Uj (0) = u0 xj .
However, these expressions are not quite what we want. The vector on the
left is of size N − 1 and will determine the interior grid values. The vector
on the right is of size N + 1; it involves both the interior grid values and the
boundary values. We need to express derivatives at the interior grid points
in terms only of interior grid values and the Dirichlet boundary conditions.
This means that we need to eliminate U0 and UN from the above.
Substituting the boundary values u0 = uL (t), uN = uR (t), we approxi-
mate uxx (with Dirichlet boundary conditions on [XL , XR ]) via the inhomo-
geneous linear operator L1
L 1 U = M 1 U + R1 ,
the endpoints of a linear grid, and then the derivatives can be computed by
doing the (N − 1) × (N + 1) multiplication above.
Of course, the matrix M1 never actually exists in the computer, nor do
we ever actually do a matrix multiply as written above: since most entries
are zero, storing the matrix and doing a matrix multiply would be a huge
waste of memory and time. \Multiplication" really means \apply the linear
operator," which we do by taking di erences.
M 2 U + R2 ,
as a result
U1 − 2U0 + U−1 2U1 − (2 − 2ah/b)U0 2uL (t)
uxx (XL , t) ∼ 2
= − .
h h2 bh
Similarly,
UN+1 − UN−1
uR (t) = c u(XR , t) + d ux (XR , t) ∼ c UN + d
2h
2ch 2huR (t)
=⇒ UN+1 = UN−1 − UN +
d d
hence
U1 − 2U0 + U−1 2UN−1 − (2 + 2ch/d)UN 2uR (t)
uxx (XR , t) ∼ 2
= + .
h h2 dh
In this way, we can approximate uxx (with Robin boundary conditions
on [XL , XR ]) as the inhomogeneous linear operator
= M 3 U + R3
2.5 Summary
The spatial derivative operator
on [XL , XR ]
Lu = Duxx
u(XL , t) = uL (t)
u(X , t) = u (t)
R R
Mat1062 Jan. 13, 2009 Mary Pugh 7