Information Technology Reference
In-Depth Information
than the explicit and implicit Euler schemes? To answer this question we must look
at the error in the Crank-Nicolson scheme. It can be shown that the error now is
E D C 1 x 2 C C 2 t 2 ;
where C 1 and C 2 are constants that depend on the behavior of the exact solution.
The temporal error is now of order t 2 , in contrast to just t for the explicit and
implicit Euler schemes. This means that the error in the Crank-Nicolson scheme
approaches zero fast as we reduce t . To keep the two error terms approximately
the same size, we should choose t proportional to x: t D ˇx for some
constant ˇ.
Consider a computation on a grid with a given x, performed with all three
schemes. Suppose we then halve x. In the implicit and Euler schemes we should
divide t by four, and in the explicit method this is required because of stabil-
ity reasons. In the Crank-Nicoloson scheme we only need to divide t by two.
That is, we can halve the work compared to the other two methods. This makes
the Crank-Nicolson scheme more efficient. Again, we must emphasize that these
considerations are very rough.
The Scheme
7.5.6
In the previous sections we derived three different methods to solve the diffusion
PDE numerically: (1) the explicit forward Euler scheme, (2) the implicit backward
Euler scheme, and (3) the implicit Crank-Nicolson scheme. It is possible to derive
a generalized scheme that simplifies to these three simpler schemes. This gener-
alized scheme is called the scheme, because of a parameter used to weight
contributions from time level ` 1 versus time level `.The scheme can be
written as
D ˛ u i1
2 u i
C u iC1
C ˛.1 / u `1
2 u `1
i
C u `1
iC1
u i
u `1
i
i1
C f
i
;
(7.146)
t
x 2
x 2
where
f
i
D f `
i
C .1 /f `1
i
:
Again, we collect the unknowns on the left-hand side and the known quantities on
the right-hand side:
˛ u i1
C .1 C 2˛/ u i
˛ u iC1
D
˛.1 / u `1
i1
C .1 2˛.1 // u `1
i
C ˛.1 / u `1
iC1
C
t .f `
i
C .1 /f `1
i
/:
(7.147)
Search WWH ::




Custom Search