Subsections
So far, we haven't defined how the spatial derivatives are to be
calculated numerically. It is usually most accurate to discretise
these in a symmetric way around the current spatial point, essentially
through a Taylor expansion around the current point. This leads to a
`Centered Space' discretisation, so that the matrix
is a spatially symmetric discretised version
of the spatial differential operator.
An example is the discretised spatial differential operator for the
scalar gradient,
. First, consider the
Taylor expansion:
 |
(A.4) |
Next, we can write a similar expression for the value of
:
 |
(A.5) |
Subtracting these two equations gives the accurate CS discretisation,
of form:
![$\displaystyle \frac{\partial }{\partial x} \mbf{A}(t_n,\mbf{x}_l) = \frac{1}{2 ...
...a x} [\mbf{A}(t_n,\mbf{x}_{l+1}) - \mbf{A}(t_n,\mbf{x}_{l-1})] + O(\Delta x^2).$](img286.png) |
(A.6) |
If this derivative term was the only spatial derivative, then:
 |
(A.7) |
Suppose we consider a scalar field
, and regard this as a column
vector over its spatial indices, defined at each point in time. Then
for a
case, the discretisation matrix
for the
operator
is:
![$\displaystyle \mbf{D}= \frac{1}{2\Delta x} \left[ \begin{array}{cccccc} 0 & 1 &...
...\ & & -1 & 0 & 1 & \\ & & & -1 & 0 & 1 \\ & & & & -1 & 0 \end{array} \right]$](img290.png) |
(A.8) |
Here we assume Dirichlet boundary conditions, with the boundary values
set to zero at the boundaries, which are located at
and
. The lattice does not have to
include these points, in this case, since the values of the fields at
these locations doesn't change.
Adding the two equations gives an approximation for the diffusion
operator, or second order derivative, of form:
![$\displaystyle \frac{\partial ^2}{\partial x^2} \mbf{A}(t_n,\mbf{x}_l) = \frac{1...
...{l+1}) - 2\mbf{A}(t_n,\mbf{x}_l) + \mbf{A}(t_n,\mbf{x}_{l-1})] + O(\Delta x^2).$](img293.png) |
(A.9) |
Note that the error estimate is proportional to
,
because it is proportional to fourth order derivative terms. The CS
method causes a cancellation to occur in the error terms proportional
to third order derivatives, which otherwise would give errors
proportional to
. If this derivative term was the only
spatial derivative, then:
 |
(A.10) |
The combination of the Euler method in time, with a spatially centered
discretisation for the spatial differential operator is called an FTCS
algorithm.
Suppose we consider a scalar field
, and regard this as a column
vector over its spatial indices, defined at each point in time. Then
for a
case, the discretisation matrix
for the
operator
is:
![$\displaystyle \mbf{D}= \frac{1}{\Delta x^2} \left[ \begin{array}{cccccc} -2 & 1...
...\ & & 1 & -2 & 1 & \\ & & & 1 & -2 & 1 \\ & & & & 1 & -2 \end{array} \right]$](img297.png) |
(A.11) |
Here we assume Dirichlet boundary conditions, with the boundary values
set to zero at the boundaries, which are located at
and
. The lattice does not have to
include these points, in this case, since the values of the fields at
these locations doesn't change. For periodic boundary conditions,
which are often useful for obtaining traveling wave solutions, define:
![$\displaystyle \mbf{D}= \frac{1}{\Delta x^2} \left[ \begin{array}{cccccc} -2 & 1...
...\ & & 1 & -2 & 1 & \\ & & & 1 & -2 & 1 \\ & & & & 1 & -2 \end{array} \right]$](img297.png) |
(A.12) |
Paul Cochrane
2002-04-18