DiscreteSecondDerivativeMatrix
DiscreteSecondDerivativeMatrix
(3)
u00 (x1 ) u(x )
L
−2 1 0 0 ... 0 1
u00 (x2 ) 1 u(x2 ) 0
−2 1 0 ... 0
.. 0 .. ..
1 −2 1 ... 0 .
. = 1 . 1 2
.. h2
..
. ..
.
..
.
..
.
..
.
..
. + h2 . + O(h )
. . .. ..
0
u00 (xN −2 ) 0 ... 1 −2 1 u(xN −2 ) 0
00
u (xN −1 ) 0 0 ... 0 1 −2 u(xN −1 ) R
In (3), the O(h2 ) quantity is the error vector whose contents are unknown,
but whose magnitude is known to be of order h2 as h → 0.
Let’s write the above system as
1
(4) u00 = 2 Au + b + O(h2 )
h
Notice that we have incorporated the h12 term into the vector b.
From this we can see that if we want to find a solution to the two-point
boundary value problem u00 (x) = f (x) with u(a) = L and u(b) = R, we can
drop the O(h2 ) vector and replace the vector carrying the u00 values with
2
The Discrete Second Derivative Matrix c 2007 Stephen Demko
°
the right hand side of the above and solve the system below for the vector
of ui values. Note that the ui s are the entities that we actually find. They
are not the values u(xi ), but are hopefully close to them.
−2 1 0 0 ... 0 u1 f (x1 ) L
1 −2 1 0 ... u
0 2 f (x 2 ) 0
. . .
1 0 1 −2 1 ... 0
.. ..
1
..
. . . . . . =
.. .. .. −
h2 .. . . .. .. .. h2 ...
. .
0 0 . . . 1 −2 1 uN −2 f (xN −2 ) 0
0 0 ... 0 1 −2 uN −1 f (xN −1 ) R
We can write this system as h12 Aû = f − b. We want to compare the
vectors u and û. Since u00 = f (as function and as vectors), we have
1
Au = f − b + O(h2 )
h2
1
Aû = f − b
h2
Subtracting gives
1
A(u − û) = O(h2 )
h2
u − û = A−1 (O(h4 ))
For a general norm we can conclude ku − ûk ≤ kAkO(h2 ). However, we
can be more precise here, because it can be verified that if A−1 = (rij ), then
for i ≤ j
i(N − j)
rij = rji =
N
With this one can prove that kA k∞ ≤ (b − a)2 /2h2 and conclude that
−1
1. Define fα (z) = 1+αz. Let M = f (A) For different values of n (take them
even, say n = 10, 50, 100) investigate the behavior of M k en/2 as k grows.
Take the following values of α: 0.25, 0.5, 0.75, 1.00.
1
2. Repeat the investigations of problem 1 using gα (z) = 1−αz instead of f .
3. Repeat the investigations of problem 1 using hα (z) = 1+0.5αz
1−0.5αz instead of
f.
Things to look for: Does the process settle down? Does it blow up?
when? why? In the cases that it settles down, does it do so with oscillations
or without oscillations.
Explain what you see in terms of the eigenanalysis of the appropriate
matrix.