Page 60 -
P. 60
2.2 A Finite Difference Approximation
Here the constant M g is given by
M g = sup |g
(x)|.
(4)
x
We observe that for a fixed function g, the error term E h tends to zero as
h tends to zero. In particular, if g is a polynomial of degree ≤ 3, such that
g
≡ 0, the error term satisfies E h (x) = 0 for all x. This property will
(4)
be discussed in Exercise 2.16. Further discussions on Taylor series can be
found in Project 1.1.
2.2.2 A System of Algebraic Equations 47
The first step in deriving a finite difference approximation of (2.1) is to
partition the unit interval [0, 1] into a finite number of subintervals. We
introduce the grid points {x j } n+1 given by x j = jh, where n ≥ 1isan
j=0
integer and the spacing h is given by h =1/(n+1). Typically n will be large,
and hence the spacing h is small. The solution v of the discrete problem is
defined only at the grid points x j where the values of the approximation
are given by v j . Between these points, an approximation can be defined by,
for example, piecewise linear interpolation.
As usual, we let u denote the solution of the two-point boundary value
problem
−u (x)= f(x), x ∈ (0, 1), u(0) = u(1)=0,
and we define the approximation {v j } n+1 by requiring
j=0
− v j−1 − 2v j + v j+1 = f(x j ) for j =1,... ,n, and v 0 = v n+1 =0.
h 2
(2.13)
Obviously, the second-order derivative in the differential equation is ap-
proximated by the finite difference derived above; see (2.11). The system
n
of n equations and n unknowns {v j } defined by (2.13) can be written
j=1
in a more compact form by introducing the n × n matrix
2 −1 0 ... 0
. .
. .
−1 2 −1 . .
. . .
. . .
A = 0 . . . 0 . (2.14)
.
. .
.
. . −1 2 −1
0 ... 0 −1 2
Furthermore, let b =(b 1 ,b 2 ,... ,b n ) T be an n-vector with components
given by
b j = h f(x j ) for j =1, 2,... ,n.
2