In this problem we will consider the diffusion equation $$ \begin{align} \frac{\partial u}{\partial t} = \alpha\frac{{\partial}^2u}{\partial x^2} \,, \label{eq:diffusion} \end{align} $$
and the advection equation: $$ \begin{align} \frac{\partial u}{\partial t} + a_0\frac{\partial u}{\partial x} = 0 \,, \quad a_0 > 0 \,. \label{eq:advection} \end{align} $$
Notation: $$ \begin{align} t_n = \Delta t \cdot n \,, n=0,1\,\dots N \,, \quad x_j = \Delta x \cdot j \,, j=0,1\,\dots K \,. \label{eq:notation} \end{align} $$
a) Discretize Eq. \eqref{eq:diffusion} with first order backward differences for \( \frac{\partial u}{\partial t} \) and central differences for \( \frac{{\partial}^2u}{\partial x^2} \) and show that resulting discretized equation takes the form: $$ \begin{align} u_j^{n + 1} = u_j^{n} + D\left(u_{j + 1}^{n + 1} - 2u_{j}^{n+1} + u_{j - 1}^{n + 1}\right) \,, \label{eq:Laasonen} \end{align} $$
and write out the expression for \( D \). Is the scheme explicit or implicit?
b) Use von Neumann stability analysis and show that Eq. \eqref{eq:Laasonen} is stable for all values of \( D \) (unconditionally stable).
c) Another discretized version (scheme) for Eq. \eqref{eq:diffusion} is given by: $$ \begin{align} D\,u_{j - 1}^{n + 1} - \left(2\,D+3\right)u_{j}^{n+1} + D\,u_{j + 1}^{n + 1} = -2D\,u_{j - 1}^{n} + \left(4\,D-3\right)u_{j}^{n} - 2D\,u_{j + 1}^{n}\,. \label{eq:other} \end{align} $$
Use von Neumann stability analysis and show that the the amplification factor \( G \), may be expressed as $$ \begin{align} G =\frac{3 - 8\,D\cdot sin^2\frac{\delta}{2}}{3 + 4\,D\cdot sin^2\frac{\delta}{2}}\,, \quad \delta = \beta \cdot \Delta x \,, \label{eq:other_amplification} \end{align} $$ and use this to find an expression (in terms of \( D \)) for the stability limit of the scheme.
d) Forward in time central in space (FTCS) discretization of Eq. \eqref{eq:advection} results in the following scheme: $$ \begin{align} u_j^{n + 1} = u_j^{n} - \frac{C}{2}\left(u_{j + 1}^{n} - u_{j- 1}^{n}\right) \,, \label{eq:FTCS} \end{align} $$ where \( C=a_0 \cdot \frac{\Delta t}{\Delta x} \). The FTCS scheme is unconditionally unstable, but a modification of Eq. \eqref{eq:FTCS}, suggested by Peter Lax, is to replace \( u_j^n \) by \( u_j^n = \frac{1}{2}\left(u_{j+1}^n + u_{j-1}^n\right) \). Introduce this modification and show that the resulting scheme i stable for \( C \leq 1 \), by use of the criterion for positive coefficients (PC-criterion).
e) Use von Neumanns stability analysis on and show that the amplification factor \( G \), for the resulting scheme in the previous sub-exercise, may be expressed as $$ \begin{align} G = cos \, \delta - i \cdot C \cdot sin \,\delta \,, \label{eq:Lax_amplification} \end{align} $$
and show that you obtain the same stability limit as with the PC-criterion.
f) Discretize Eq. \eqref{eq:advection} with first order forward differences for both the temporal and spatial derivatives, and use von Neumann stability analysis to show that the resulting scheme is unstable for all values of C.
Show that the amplification factor may be written as: $$ \begin{align} G = 1 + C \cdot \left(1 - cos \, \delta \right) - C \cdot i \cdot sin \, \delta \,, \quad \rightarrow \quad \lvert G \rvert^2 = 1 + 2 \cdot C \cdot \left(1 - cos \, \delta\right) \cdot \left(1 + C\right) \,, \label{eq:ftfs_amplification} \end{align} $$ and introduce the substitution \( 1 - cos \, \delta = 2 \cdot sin^2 \frac{\delta}{2} \)