2.2 Implicit Methods

2.2.1 Implicit FTCS
2.2.2 Wendrof
2.2.3 Crank-Nicolson
2.2.1 Implicit FTCS

Given the explicit FTCS derived above

\[ \frac {C_{i}^{n+1}-C_{i}^{n}}{\tau }=-u\left ( \frac {C_{i+1}^{n}-C_{i-1}^{n}}{2h}\right ) \]

The above is modified it by evaluating the space center derivative at time step \(n+1\) instead of at time step \(n\), this results in

\begin{equation} \frac {C_{i}^{n+1}-C_{i}^{n}}{\tau }=-u\left ( \frac {C_{i+1}^{n+1}-C_{i-1}^{n+1}}{2h}\right ) \tag {5A}\end{equation}

Hence

\begin{equation} \fbox {$C_{i}^{n+1}+\frac {u\tau }{2h}C_{i+1}^{n+1}-\frac {u\tau }{2h}C_{i-1}^{n+1}=C_{i}^{n}$} \tag {5B}\end{equation}

Writing it in matrix form, first letting \(\alpha =\frac {u\tau }{2h}\) results in

\[\begin {bmatrix} 1 & 0 & 0 & 0 & \cdots & 0 & 0\\ -\alpha & 1 & \alpha & 0 & \cdots & 0 & 0\\ 0 & -\alpha & 1 & \alpha & \cdots & 0 & 0\\ 0 & 0 & -\alpha & 1 & \alpha & \cdots & 0\\ \vdots & & & & & & \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 \end {bmatrix}\begin {bmatrix} C_{0}^{n+1}\\ C_{1}^{n+1}\\ C_{2}^{n+1}\\ C_{3}^{n+1}\\ \vdots \\ C_{N-1}^{n+1}\end {bmatrix} =\begin {bmatrix} C_{0}^{n}\\ C_{1}^{n}\\ C_{2}^{n}\\ C_{3}^{n}\\ \vdots \\ C_{N-1}^{n}\end {bmatrix} \]

Where \(N\) is the number of space grid points.

The above is written as

\[ Ax=b \]

Solving for \(x,\) which represents the solution at time step \(n+1\) or at time \(t=\left ( n+1\right ) \tau \). \(b\) represents the current solution at time step \(n\), and \(A\) is the matrix of the coefficients shown above.

Due to the form of the \(A\) matrix, (Called tri diagonal, or Block diagonal), an algorithm that takes advantages of this form is used. This is called the Thomas algorithm. This greatly speeds up the solution. If we had used a general algorithm to solve this system such as the Gauss elimination method, it would have been much slower, making the implicit method not practical to use. (Some tests on the same data showed the Thomas algorithm to be 50 times faster than Gaussian elimination).

2.2.2 Wendrof

This method uses center difference for the derivative around the space step \(\left ( i+\frac {1}{2}\right ) h\) and the time step \(\left ( n+\frac {1}{2}\right ) \tau \)

This leads to the following scheme

\[ \fbox {$\left ( 1-\frac {u\tau }{h}\right ) C_{i}^{n+1}+\left ( 1+\frac {u\tau }{h}\right ) C_{i+1}^{n+1}=\left ( 1+\frac {u\tau }{h}\right ) C_{i}^{n}+\left ( 1-\frac {u\tau }{h}\right ) C_{i+1}^{n}$}\]

This can also be solved using similar matrix method to that used for the implicit FTCS. This method is not used in this report.

2.2.3 Crank-Nicolson

By taking the average of the explicit FTCS and the implicit FTCS formulations (shown again below), the C-N scheme is derived

\[ \frac {C_{i}^{n+1}-C_{i}^{n}}{\tau }=-u\left ( \frac {C_{i+1}^{n}-C_{i-1}^{n}}{2h}\right ) \]
\[ \frac {C_{i}^{n+1}-C_{i}^{n}}{\tau }=-u\left ( \frac {C_{i+1}^{n+1}-C_{i-1}^{n+1}}{2h}\right ) \]

Taking the average of the above results in

\[ \frac {C_{i}^{n+1}-C_{i}^{n}}{\tau }=-\frac {u}{2}\left ( \frac {C_{i+1}^{n}-C_{i-1}^{n}}{2h}\right ) -\frac {u}{2}\left ( \frac {C_{i+1}^{n+1}-C_{i-1}^{n+1}}{2h}\right ) \]
\[ \fbox {$C_{i}^{n+1}+\frac {u\tau }{4h}C_{i+1}^{n+1}-\frac {u\tau }{4h}C_{i-1}^{n+1}=C_{i}^{n}-\frac {u\tau }{4h}C_{i+1}^{n}+\frac {u\tau }{4h}C_{i-1}^{n}$}\]

Now the system \(Ax=b\) is setup to solve for future values as follows. Let \(\alpha =\frac {u\tau }{4h}\), the system can be written as

\[\begin {bmatrix} 1 & 0 & 0 & 0 & 0 & 0\\ -\alpha & 1 & \alpha & 0 & 0 & 0\\ 0 & -\alpha & 1 & \alpha & 0 & 0\\ 0 & 0 & -\alpha & 1 & \alpha & 0\\ 0 & 0 & 0 & -\alpha & 1 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 \end {bmatrix}\begin {bmatrix} C_{0}^{n+1}\\ C_{1}^{n+1}\\ C_{2}^{n+1}\\ C_{3}^{n+1}\\ \vdots \\ C_{N-1}^{n+1}\end {bmatrix} =\begin {bmatrix} C_{0}^{n}\\ C_{1}^{n}-\alpha C_{2}^{n}+\alpha C_{0}^{n}\\ C_{2}^{n}-\alpha C_{3}^{n}+\alpha C_{1}^{n}\\ C_{3}^{n}-\alpha C_{4}^{n}+\alpha C_{2}^{n}\\ \vdots \\ C_{N-1}^{n}\end {bmatrix} \]

Thomas algorithm is used to solve the above system for \(C_{i}^{n+1}.\)