398 Chapter 7 Numerical Methods
x:0. 00. 20. 40. 60. 81. 0
u(x):1. 00. 643 0. 302 − 0. 026 − 0. 406 − 1. 0
Table 1 Approximate solution of Eqs. (1) and (2)
Differential equation Boundary condition
u(x)→ui u( 0 )→u 0
d^2 u
dx^2 (x)→
ui+ 1 − 2 ui+ui− 1
( x)^2
du
dx(^0 )→
u 1 −u− 1
2 x
du
dx(x)→
ui+ 1 −ui− 1
2 x u(^1 )→un
f(x)→f(xi) dudx( 1 )→un+^12 − xun−^1
Table 2 Constructing replacement equations
First, the values ofxfor the table will be uniformly spaced across the interval
0 ≤x≤1, which we assume to be the interval of the boundary value problem
xi=i x, x=
1
n.
These are calledmeshpoints. The numbers approximating the values ofuare
ui∼=u(xi), i= 0 , 1 ,...,n.
These numbers are required to satisfy a set of equations obtained from the
boundary value problem by making the replacements shown in Table 2. The
entryf(x)refers to any coefficient or inhomogeneity in the differential equa-
tion.
Example.
The boundary value problem in Eqs. (1) and (2) would be replaced by the
algebraic equations
ui+ 1 − 2 ui+ui− 1
( x)^2
− 12 xiui=− 1 , i= 1 , 2 ,...,n− 1 , (3)
u 0 = 1 , un=− 1. (4)
Equation (3) holds fori= 1 ,...,n−1, so the unknownsu 1 ,...,un− 1 would
be determined by this set of equations. The equations become specific when we
choosen.Letustaken=5, so x= 1 /5, and the four(i= 1 , 2 , 3 , 4 )versions