next up previous
Next: 5.2.4 Dufort-Frankel Scheme (DF) Up: 5.2 Initial Value Problems Previous: 5.2.2 Implicit Scheme of


5.2.3 Crank-Nicholson Scheme (CN)

As before, replace $\partial u/\partial t$ by $\Delta_{n} u/\Delta t \equiv (u^{n+1}-u^{n})/\Delta t$.

Noting that this approximation is in fact centered at $t_{n+1/2}$, introduce the same kind of time centering on the right-hand side: taking the mean of $\delta_{j}^{2}u^{n}$ (= FTCS) and $\delta_{j}^{2}u^{n+1}$ (= implicit scheme) we write
$\displaystyle \frac{1}{\Delta t} \left[ u_{j}^{n+1}-u_{j}^{n}\right]$ $\textstyle =$ $\displaystyle \frac{\lambda}{2(\Delta x)^{2}}
\left[ (u_{j+1}^{n+1}-2 u_{j}^{n+1}+u_{j-1}^{n+1})
+ (u_{j+1}^{n}-2 u_{j}^{n}+u_{j-1}^{n}) \right]$  



\begin{figure}\includegraphics[width=120pt]{figures/f5cn.ps}
\end{figure}


The Crank-Nicholson formula is of second order in $\Delta t$.

Defining $a \equiv \lambda \Delta t / 2(\Delta x)^{2}$ we may write CN as
    $\displaystyle \fbox{$ \displaystyle
-a u_{j-1}^{n+1}+(1+2a)u_{j}^{n+1}-a u_{j+1}^{n+1}=
a u_{j-1}^{n}+(1-2a)u_{j}^{n}+a u_{j+1}^{n}
$}$  



or
$\displaystyle \mbox{${\bf A}$} \cdot \mbox{$\bf u$}^{n+1}$ $\textstyle =$ $\displaystyle \mbox{${\bf B}$} \cdot \mbox{$\bf u$}^{n}$  

with

\begin{displaymath}
\mbox{${\bf A}$} \!\equiv \!
\left(
\begin{array}{cccccc}
...
...& 1\!-\!2a & a \\
. & . & . & 0 & 0 & 1
\end{array}\right)
\end{displaymath}



Tridiagonal $\Longrightarrow$Solve by Recursion!

Stability of CN:

The amplification factor is
$\displaystyle g(k)$ $\textstyle =$ $\displaystyle \frac{1-2a\,\sin^{2}(k\Delta x/2)}{1+2a\,\sin^{2}(k\Delta x/2)}
\leq 1 \; ,$  

which makes the CN method unconditionally stable.



EXAMPLE: The time-dependent Schroedinger equation,
$\displaystyle \frac{\partial u}{\partial t}$ $\textstyle =$ $\displaystyle -i H u \; , \;\;\; {\rm with} \;\; H \equiv
\frac{\partial^{2}}{\partial x^{2}} + U(x)$  

when rewritten à la Crank-Nicholson, reads
$\displaystyle \frac{1}{\Delta t}[u_{j}^{n+1}-u_{j}^{n}]$ $\textstyle =$ $\displaystyle - \frac{i}{2}
[(Hu)_{j}^{n+1}+(Hu)_{j}^{n}]$  
  $\textstyle =$ $\displaystyle - \frac{i}{2} \left[ \frac{\delta_{j}^{2}u_{j}^{n+1}}{(\Delta x)^...
...}^{n+1}
+\frac{\delta_{j}^{2}u_{j}^{n}}{(\Delta x)^{2}}
+U_{j}u_{j}^{n} \right]$  

With $a \equiv \Delta t/2 (\Delta x)^{2}$ and $b_{j} \equiv U(x_{j}) \Delta t/2 $ this leads to
$\displaystyle (ia) u_{j-1}^{n+1}+(1-2ia+ib_{j})u_{j}^{n+1}$ $\textstyle +$ $\displaystyle (ia) u_{j+1}^{n+1}=$  
    $\displaystyle =(-ia) u_{j-1}^{n}+(1+2ia-ib_{j})u_{j}^{n}+(-ia) u_{j+1}^{n}$  

Again, we have a tridiagonal system which may be inverted very efficiently by recursion.

next up previous
Next: 5.2.4 Dufort-Frankel Scheme (DF) Up: 5.2 Initial Value Problems Previous: 5.2.2 Implicit Scheme of
Franz J. Vesely Oct 2005
See also:
"Computational Physics - An Introduction," Kluwer-Plenum 2001