7.2 Heat Problems 405
i
m 01234
0 00. 25 0. 50. 75 1
1 0 0. 25 0. 50. 75 0
2 0 0. 25 0. 50. 25 0
3 0 0. 25 0. 25 0. 25 0
4 0 0. 125 0. 25 0. 125 0
5 0 0. 125 0. 125 0. 125 0
Table 4 Numerical solution of Eqs. (4)–(6)
Example.
Solve Eqs. (4)–(6) with x= 1 /4andr= 1 /2, making t= 1 /32. The equa-
tions giving theu’s at time levelm+1are
u 1 (m+ 1 )=^1
2
(
u 0 (m)+u 2 (m)
)
,
u 2 (m+ 1 )=^12
(
u 1 (m)+u 3 (m)
)
,
u 3 (m+ 1 )=
1
2
(
u 2 (m)+u 4 (m)
)
.
(9)
Recall that the boundary conditions of this problem specifyu 0 (m)=0and
u 4 (m)=0 form= 1 , 2 , 3 ,.... Thus we fill in the columns of the table that
correspond to pointsx 0 andx 4 with 0’s (shown in italics in Table 4). Also
the initial condition specifiesui( 0 )=f(xi),sothetoprowofthetablecanbe
filled. In this example we takef(x)=x, and the corresponding values appear
in italics in the top row of Table 4.
The initial condition,u(x, 0 )=x,0<x<1, suggests thatu( 1 , 0 )should
be 1, while the boundary condition suggests that it should be 0. In fact, nei-
ther condition specifiesu( 1 , 0 ), nor is there a hard and fast rule telling what to
do in case of conflict. Fortunately, it does not matter much, either. (See Exer-
cise 1.)
Stability
Thechoicewemadeofr= 1 /2 in the Example seems natural, perhaps, because
it simplifies the computation. It might also seem desirable to take a larger value
ofr(signifying a larger time step) to get into the future more rapidly. For
example, withr=1( t= 1 / 16 )the replacement equations take the form
ui(m+ 1 )=ui− 1 (m)−ui(m)+ui+ 1 (m).
In Table 5 are values ofui(m)computed from this formula. No one can believe
that these wildly fluctuating values approximate the solution to the heat prob-