7.2 Heat Problems 407
the replacement equations are found to be (for n = 4)
u
1
(m +1) = ru
0
(m) +(1 −2r)u
1
(m) +ru
2
(m),
u
2
(m +1) = ru
1
(m) +(1 −2r)u
2
(m) +ru
3
(m),
u
3
(m +1) = ru
2
(m) +(1 −2r)u
3
(m) +ru
4
(m),
u
4
(m +1) = 2ru
3
(m) +
1 −2r −
1
2
rγ
u
4
(m).
(13)
(Remember that u(1, t), corresponding to u
4
, is an unknown. The boundary
condition has been incorporated into the equation for u
4
(m + 1).) Again, the
second stability requirement is satisfied automatically; but the first rule re-
quires that
1 −2r −
1
2
rγ ≥ 0orr ≤
1
2 +
1
2
γ
. (14)
EXERCISES
1. Solve Eqs. (4)–(6) numerically with f (x) = x,asinthetext(x = 1/4,
r =1/2), but take u
4
(0) = 0. Compare your results with Table 4.
2. Solve Eqs. (4)–(6) numerically with f (x) = x, x = 1/4, u
4
(0) = 1, as in
the text, but use r = 1/4. Compare your results with Table 4. Be sure to
compare results at corresponding times.
3. For the problem in Eqs. (10)–(12), find the longest stable time step when
γ = 1, and compute the numerical solution with the corresponding value
of r.
4. Solve the problem in Eqs. (10)–(12) with x = 1/4, r = 1/2andγ = 0, for
m up to 5.
For each problem in the following exercises, set up the replacement equations
for n = 4, compute the longest stable time step, and calculate the numerical
solution for a few values of m.
5.
∂
2
u
∂x
2
=
∂u
∂t
, u(0, t) = u(1, t) = t, u(x, 0) =0.
6.
∂
2
u
∂x
2
−u =
∂u
∂t
, u(0, t) = u(1, t) = 1, u(x, 0) = 0.
7.
∂
2
u
∂x
2
=
∂u
∂t
−1, u(0, t) = u(1, t) = 0, u(x, 0) = 0.