## Solving Parabolic Partial Differential Equations The Crank Nicholson or Implicit Method

In the explicit method, we used a central difference formula for the second derivative and a forward difference formula for the first derivative (equations 1224 and 12-25). A variant of equation 12-26 that makes the approximations to both derivatives central differences is known as the Crank-Nicholson formula

- rF,_hj+] +(2 + 2r)FiJ+l - rFMJ+x = rF^j + (2 - 2r)Fu + rFMJ

or, if i represents distance x and j represents time t,

~ rFx_u+x + (2 + 2r)Fx l+l - rFx+] J+l = rFx_u + (2 - 2r)Fxt + rFx+X t

where r = Ay/(k(Ax)2). Choosing specific values for r and Ax determines the increment Ay. For r= 1, equation 12-27a simplifies to equation 12-28.

- ^t-i,i+i + 4Fx,i+i - Fx+i,t+\ = Fx-u + Fx+\,t (12-28)

Equation 12-27a or 12-28 shows that Fx^, is a function of yet-to-be-calculated values at t+\ (Fx / ,+, and Fxi i ,+\) in addition to known values at time t (the quantities on the right-hand side of the equation). This is illustrated by the stencil of the method shown in Figure 12-7. Equation 12-27a results in a set of simultaneous equations at each time step. Again, the solution procedure is best illustrated by means of an example.

Figure 12-7. Stencil of the implicit method for the solution of a parabolic PDE.

The points shown as solid squares represent previously calculated values of the function; the open circles represent unknown values in adjacent positions; the open square represents the value to be calculated. Figure 12-7. Stencil of the implicit method for the solution of a parabolic PDE.

The points shown as solid squares represent previously calculated values of the function; the open circles represent unknown values in adjacent positions; the open square represents the value to be calculated.