Subsections

Examples:

Advection equation

The advection equations gives an example of the numerical integration problem that can occur where the algorithm itself can amplify the error. This is called a numerical instability, or divergence. For example, suppose we consider the equation:

$\displaystyle \frac{\partial }{\partial t} A(x,t) = \mathcal{D} A = \kappa \frac{\partial }{\partial x} A$ (A.19)

In this case, the FTCS method becomes (using Einstein summation convention for summing over the spatial indices $ m$):

$\displaystyle A_l(t_{n+1}) = [\delta_{l,m} + \Delta t \mathcal{D}_{l,m}] A_m(t_n) = A_l(t_n) + \frac{\kappa \Delta t}{2 \Delta x} (A_{l+1}(t_n) - A_{l-1}(t_n))$ (A.20)

It turns out that the FTCS algorithm is unstable for ALL step-sizes! It is possible to modify the algorithm to stabilize the result, but usually only by including various effects which reduce the accuracy (for example, by introducing a spurious diffusion).

Diffusion equation

Another example is the case of diffusion of a scalar field in one space dimension. Let:

$\displaystyle \frac{\partial }{\partial t} A(x,t) = \mathcal{D} \cdot A = \kappa \frac{\partial ^2}{\partial x^2} A$ (A.21)

The simplest `Centered Space' discretised operator in this case is:

$\displaystyle [\mathcal{D} \cdot A_l(t_n)] = \sum_m \mathcal{D}_{l,m} A_m(t_n) = \frac{\kappa}{\Delta x^2} (A_{l+1}(t_n) - 2A_l(t_n) + A_{l-1}(t_n))$ (A.22)

In the abstract notation given above, since there are only derivative terms, the algorithm can be written in an extended matrix form as:

$\displaystyle \mbf{A}(t_{n+1}) = [1 + \Delta t \mbf{D}] \mbf{A}(t_n),$ (A.23)

Alternatively, to give the full, spatially-indexed `FTCS' algorithm:

$\displaystyle A_l(t_{n+1}) = \sum_m [\delta_{l,m} + \Delta t \mathcal{D}_{l,m}]...
... + \frac{\kappa \Delta t}{\Delta x^2} (A_{l+1}(t_n) - 2A_l(t_n) + A_{l-1}(t_n))$ (A.24)

The equation above must be modified in the boundary regions, to handle the boundary conditions. In the case of Dirichlet boundary conditions, with the boundary value set to zero, the procedure is simple. Terms in the above sums that have indices with $ l = 0$ or $ l = L + 1$ are set to zero. This means that the matrix $ \mbf{D}$ will only operate on the fields inside the boundary, which do not vanish. We note from the discussion above, that the Euler method has relatively slow convergence, with local errors at least of order $ \Delta t^2$, and global errors--after propagating for many steps--of order $ \Delta t$. However, this is not the worst of it. In addition, there is a well-known instability if we use this method for the diffusion operator. This arises if $ \Delta t = t_{n+1} - t_n > \Delta x^2 / 2
\kappa$.

If the time-step is larger than this critical value, the FTCS method diverges extremely rapidly.

However, in this case, the BTCS method is stable. This is very useful in treating situations where the step-size or coupling constants are varying over the region of interest, and it might not be very practical to satisfy the critical step-size requirement everywhere!

Paul Cochrane 2002-04-18