548 Numerical Methods
smaller than when using the five-point formula. The exact value for the potential
is obtained in both cases.
The so-called Gaussian elimination is oftentimes used for the direct solution
of the systems of equations, whereby the coefficient matrix is transformed into a
triangular matrix by applying elementary row operations. This results in an easily
solvable system of equations. Another method is the so-called LR decomposition
(“left-right decomposition”). In this case, the matrix is transformed into a product
of two triangular matrices, which also allows to conveniently solve the system of
equations.
Oftentimes the system is solved iteratively. For this purpose, one uses
estimations for the potentials at the gridpoints. Then, by means of the respective
formulas, one calculates new values etc., i.e. from the potentials of the n-th
iteration steps ( ) one calculates the values of the (n+1)-th step ( ) as
follows:
.
(8.176)
This is the so-called Jacobi method. Convergence of the iteration is accelerated in
case of the Gauss-Seidel method. Here, in step (n+1), not only the old values n are
used, but already the new values of the step (n+1) are used as much as they are
available. Further acceleration of the convergence can be achieved through the
relaxation method, which shall only be mentioned here, but not further discussed.
Of course, the iteration converges better, if the initial estimates are more
accurate. At least for the current example, it is easy to find very useful estimates by
using the five-point formula or – what amounts to the same – using the mean value
theorem. Consider initially only an inner gridpoint in the center, then based on the
boundary values one estimates a value of . Now one narrows the grid
according to Fig. 8.9. From and the boundary values, the corners in particular,
one obtains an estimate for and , namely and
. This allows one to estimate the remaining potentials,
, , . Now, based on these values one iterates by use
of eq. (8.176). It remains left for the reader to convince himself, that this converges
towards the approximations given in (8.173), but not towards the exact value. The
Gauss-Seidel method accelerates the convergence. In contrast to the Jacobi
method, the symmetry of the values for the potential of the present problem is
initially lost, even though this will, of course, finally converge towards the
symmetric approximation solution.
These proceedings may be modified in many ways. The grid spacing for the
various coordinate directions may be chosen with different values. The lattice does
not need to be uniform, i.e. the grid may be variable inside a region. This leads to
the method of local grid refinement, if inside a particular region an extremely fine
discretization is needed in order to achieve a required accuracy.
Of course, the method of finite differences is applicable to all sorts of
differential equations. Space or time dependent problems (for example diffusion
equations or wave equations), generally require one to also discretize the time.
ϕ
4
25=
ϕ
ij,
n()
ϕ
ij,
n 1+()
ϕ
ij,
n 1+()
1
4
---
ϕ
i 1+ j,
n()
ϕ
i 1– j,
n()
ϕ
ij 1+,
n()
ϕ
ij 1–,
n()
+++()=
ϕ
4
0()
25=
ϕ
4
0()
ϕ
1
0()
ϕ
5
0()
ϕ
1
0()
175 4 44≈⁄=
ϕ
5
0()
25 4 6≈⁄=
ϕ
2
0()
53= ϕ
3
0()
19= ϕ
6
0()
9=