Chapter 7 Numerical Methods 399
of Eq. (3) are
25 (u 2 − 2 u 1 +u 0 )−^125 u 1 =− 1 ,
25 (u 3 − 2 u 2 +u 1 )−
24
5 u^2 =−^1 ,
25 (u 4 − 2 u 3 +u 2 )−^36
5
u 3 =− 1 ,
25 (u 5 − 2 u 4 +u 3 )−
48
5 u^4 =−^1.
(5)
When we use the boundary conditions
u 0 = 1 , u 5 =−1(6)
and collect coefficients, the foregoing equations become
− 52. 4 u 1 + 25 u 2 =− 26
25 u 1 − 54. 8 u 2 + 25 u 3 =− 1
25 u 2 − 57. 2 u 3 + 25 u 4 =− 1
25 u 3 − 59. 6 u 4 = 24.
(7)
This system of four simultaneous equations can be solved manually by elimi-
nation or by software. The result will be a set of numbers giving the approxi-
mate values ofuat the pointsx 1 = 0. 2 ,...,x 4 = 0 .8. The numbers in Table 1
were obtained by a similar process, but usingn=100 instead ofn=5.
Example.
To see how to handle derivative boundary conditions, we solve the problem
d^2 u
dx^2 −^10 u=f(x),^0 <x<^1 , (8)
u( 0 )= 1 , du
dx
( 1 )=− 1 , (9)
f(x)=
0 , 0 <x<^12 ,
− 50 , x=^12 ,
− 100 ,^12 <x<1.
The replacement equations for this problem are easily obtained by using Ta-
ble 2. They are
ui+ 1 − 2 ui+ui− 1
( x)^2
− 10 ui=f(xi), (10)
u 0 = 1 , un+^12 − xun−^1 =− 1. (11)