
22.4. Numerical Solutions and Their Visualizations 1317
Example 22.34. Linear heat equation. Initial-boundary value problem. Num erical, graphi-
cal, and exact solu tions. Crank –Nicolson method. Consider the following initial-boundary value
problem for the linear one-dimensio nal heat equation:
u
t
= k u
xx
, 0 < x < L, t > 0, u(x,0) = f (x), u(0,t) = g
1
(t), u(L,t) = g
2
(t),
where L = 1, k = 0.1, f (x) = x(1 −x), g
1
(t) = 0, and g
2
(t) = 0. By co nstructing the numerical and
graphica l solutions of this problem, we apply on e of the suc cessful implicit finite difference schemes
based on six grid points, the
CrankNicholson
method [see Crank and Nicolso n