400 Chapter 7 Numerical Methods
We need to knowu 0 ,u 1 ,...,un. The derivative boundary condition atx= 1
forces us to includeun+ 1 among the unknowns, so we will need to use Eq. (10)
fori= 1 , 2 ,...,nin order to have enough equations to find all the unknowns.
Since we have no use forun+ 1 , the usual practice is to solve the boundary-
condition replacement forun+ 1 ,
un+ 1 =un− 1 − 2 x, (12)
and then to use this expression in the version of Eq. (10) that corresponds to
i=n. Thus, the equation
un+ 1 − 2 un+un− 1
( x)^2 −^10 un=f(xn)
is combined with Eq. (12) to get
2 un− 1 − 2 x− 2 un
( x)^2
− 10 un=f(xn). (13)
Then Eq. (10) fori= 1 ,...,n−1 and Eq. (13) givenequations that determine
unknownsu 1 ,u 2 ,...,un.
To b e s p e c i fi c , l e t u s t a k en=4, so x= 1 /4. The three(i= 1 , 2 , 3 )versions
of Eq. (10) are
16 (u 2 − 2 u 1 +u 0 )− 10 u 1 = 0 (i= 1 ),
16 (u 3 − 2 u 2 +u 1 )− 10 u 2 =− 50 (i= 2 ),
16 (u 4 − 2 u 3 +u 2 )− 10 u 3 =− 100 (i= 3 )
and Eq. (13) adapted ton=4is
16
(
2 u 3 −^1
2
− 2 u 4
)
− 10 u 4 =− 100.
When these equations are cleaned up and the boundary conditionu 0 =1is
applied, the result is the following system of four equations:
− 42 u 1 + 16 u 2 =− 16
16 u 1 − 42 u 2 + 16 u 3 =− 50
16 u 2 − 42 u 3 + 16 u 4 =− 100
32 u 3 − 42 u 4 =− 92.
(14)
In Table 3 are shown the values ofuiobtained by solving Eq. (14) and also
more exact values found by usingn=100.
Elimination is not the only way to get the solution of a system like Eqs. (7)
or (14). An alternative is an iterative method, which generates a sequence of
approximate solutions. For one such method, we solve algebraically theith