Next: 2d problem with Dirichlet
Up: The diffusion equation
Previous: An improved 1d diffusion
Let us now solve the simple diffusion problem introduced in Sect. 6.4 with the above listed
CrankNicholson routine. Figure 73
shows a comparison between the analytic and numerical solutions for
a calculation performed using , , ,
, and .
It can be seen that the analytic and numerical solutions are in excellent agreement.
Note, however, that the timestep used in this calculation (i.e.,
) is much larger
than that used in our previous calculation (i.e.,
), which employed an explicit differencing
schemesee Fig. 71. According to Eq. (209), an explicit
scheme is limited to timesteps less than about
for the problem under
investigation.
Thus, we have been able to exceed this limit by a factor of 20 with our
implicit scheme, yet still maintain numerical stability.
Note that our CrankNicholson scheme is able to
obtain accurate results with a timestep as large as because it is
secondorder in time.
Figure 73:
Diffusive evolution of a 1d Gaussian pulse.
Numerical calculation performed using
, ,
, and . The pulse is evolved from to . The
solid curve shows the initial condition at , the dashed curve the numerical solution
at , and the dotted curve (obscured by the dashed curve) the analytic solution at .

Next: 2d problem with Dirichlet
Up: The diffusion equation
Previous: An improved 1d diffusion
Richard Fitzpatrick
20060329