A first example of problem-specific algorithms is afforded by consideration of the steady-state diffusion problem
(1) |
where can be understood to denote the temperature in an infinitesimal volume positioned at in -dimensional space, and is a local rate of heat generation. The above arises from setting the time derivative zero in . Though often stated in this thermal language, the Poisson equation (1) is generally valid for unresolved transport by Brownian motion. The mathematical concept of an “infinitesimal volume” is interpreted as setting some length scale much smaller than the length scale characterizing the size of the domain . As an example, for heat conduction in a column of water of length m the length scale of a quasi-infinitesimal volume can be considered as, say, m. There is no physical significance to the mathematical limit process due to the discrete structure of matter, and for all practical purposes setting m is an acceptable threshold to delimit a phenomenon of interest to behavior that can be neglected. In this case the phenomenon of interest is the average transport of thermal energy in volumes of size greater than . The detailed Brownian motion of the water molecules that occurs on length scales can be neglected and is said to be unresolved. The only observable effect of this motion is that temperature gradients lead to a heat flux as described by (Fourier's law). The same equation (1) arises in epidemiology when m, an average separation between an infected and susceptible individual, , the size of a large city, and is reinterpreted as the percentage of infected individuals in the population. Again, the detailed Brownian steps of size taken by individuals can be neglected.
Understanding the underlying unresolved Brownian motion is useful in constructing numerical solutions. For , (1) becomes which states that there is no net heat flux in an infinitesimal volume, , colloquially: “what flows in on one side goes out on the other”. A function that satisfies Laplace's equation is said to be harmonic. For , the ordinary differential equation is obtained with solution , and boundary conditions at and at gives . A temperature difference at the boundaries induces diffusive fluxes that lead to the mean value at the midpoint. An analogous statement is made for starting from Green's formula on ball with spherical boundary of radius
for scalar functions . For and the mean value theorem
(2) |
is obtained, which states that the value of a harmonic function is the average of the values on a surrounding sphere. For the analogous statement is
(3) |
Midpoint quadrature of (3) over four subintervals gives
(4) |
Apply the above on a grid covering some arbitrary domain with boundary to obtain
(5) |
Complications arise for general boundaries , but for a square domain grid points align with the boundary, . Instead of two indices, one for each spatial direction, organize the grid values through a single index , with denoting the value at the interior points . The vector of interior grid values has components, and the mean value theorem leads to the linear system
(6) |
where has a regular sparsity pattern induced by the uniform spacing of the grid
The vector contains the boundary values, for example .
|
|||
The system (6) was obtained by discretization of the mean-value integral (3). The same linear system is also obtained by discretization of the differential equation
where indices denote differentiation. The minus sign arises from compatibility with the unsteady form of the heat equation . A centered finite difference approximation of the derivatives on the uniform grid leads to
and (6) is recovered. For the Poisson equation the right hand side changes to
(7) |
with . It is often the case that the same discrete system arises from both the differential and the integral formulation of a conservation law on a uniform grid.
The above discussion of the underlying physics of the Poisson equation productively guides construction of numerical solution procedures. Solving the linear system (7) by general factorizations such as or is costly in terms of memory usage since the sparisty pattern is lost. For the uniform grid and square domain considered above the matrix need not be explicitly stored at all since , and when or . The discrete mean value theorem (5) suggests that some approximation can be improved by the iteration
(8) |
The above is known as Jacobi iteration, and can be stated in matrix form by expressing as
(9) |
with containing non-zero components of below, above the diagonal, and containing the diagonal of . In contrast to the multiplicative decompositions considered up to now, the , , SVD, eigen or Schur decompositions, the decomposition (9) is now additive. Note that in (9) are strictly lower, upper diagonal matrices with zeros on the diagonal in contrast to the notation for the standard factorization algorithm. Recall that the utility of matrix multiplication was associated with the representation of linear mapping composition. Additive decompositions such as (9) generally are useful when separating different aspects of a physical process, and are a simple example of operator splitting. For the discrete Poisson system Jacobi iteration can be expressed as
(10) |
Several variants of the idea can be pursued. The matrix splitting (9) is useful in theoretical convergence analysis, but implementations directly use (8) within loops over the indices. Updated values can be immediately utilized leading to either of the following iterations
(11) |
depending on loop organization. These are known as Gauss-Seidel iterations. Convergence might accelerated by extrapolation,
(12) |
where the new iteration is continued by factor in the direction of the Gauss-Seidel update. When this is known as successive over-relaxation (SOR) and goes further in the Gauss-Seidel direction. Choosing leads to successive under-relaxation.
Turning now from algorithm construction to analysis of its behavior, simplify notation by letting denote the current iterate. The previous notation was convenient since individual components were referenced as in , but convergence analysis is determined by the properties of the operator splitting and not of the current iterate. Introduce the error at iteration as the difference between the exact solution and the current iterate , . Also introduce the residual , and the correction to the current iterate
The above methods can be formulated as a residual correction algorithm through the steps:
residual computation,
correction computation,
approximation update,
When the exact solution is recovered in one step
Iterative methods use some approximation of the (unknown) inverse, . Jacobi iteration uses since
recovering (10). Table 1 shows several common choices for . Two key aspects govern the choice of the inverse approximant:
Computational efficiency stated as a requirement that each iteration cost either or operations;
Capturing the essential aspects of .
|
||||||||||||||||
The iteration converges to the solution if for increasing . The error at iteration is expressed as
(13) |
The repeated matrix multiplication indicates that the eigenstructure of the iteration matrix determines iteration convergence. Indeed the above is simply power iteration for and can be expected to converge as
with the eigenpair that corresponds to the largest eigenvalue in absolute value, , known as the spectral radius of , denoted by Clearly, the above iterations will exhibit linear order of convergence when . The rate of convergence at iteration is estimated by the Rayleigh quotient
and is monitored in implementations of iterative methods, and determined by the eigenvalues of .
The eigenstructure of is difficult for arbitrary matrices , but can be carried out when has special structure induced by known physical phenomena. The relation between analytical and numerical formulations plays an essential role in convergence analysis. The diffusion equation (5) leads to a symmetric matrix , due to two aspects:
the chosen discretization is symmetric using centered finite differences;
the operator itself exhibits symmetry.
Insight into the above two aspects is most readily gained from the one-dimensional case with homogeneous Dirichlet boundary conditions . The linear system obtained from the centered finite difference discretization
has a symmetric tridiagonal system matrix . The symmetry can be expressed through scalar products in a way that generalizes to differential operators. Recall that a real-valued scalar product must satisfy symmetry . For the standard inner product has this property. Consider the action of the operator on the two terms. If the operator is said to be symmetric. For the inner product
and the two expressions are equal if . The same approach extends to the diffusion operator using the scalar product
Applying integration by parts
For homogeneous boundary conditions , the symmetry condition is satisfied. Note that symmetry involves both the operator anId the boundary conditions of the problem. For the scalar product
is defined on the unit square , and for homogeneous Dirichlet boundary conditions two applications of Green's formula leads to , and the Laplace operator is symmetric.
For , , , the eigenvalues of are inferred from those of the operator with homogeneous boundary conditions at ,
Positing that an eigenvector of is the discretization of the continuum eigenfunction leads to
hypothesis that is verified by the calculation of component of
thereby obtaining the eigenvalue
which recovers the analytical eigenvalue in the limit
For Jacobi , so the eigenvalues of are
The eigenvalues of are therefore
Replacing the largest eigenvalue is obtained for
For large , , and slow convergence is expected as verified in the numerical experiment from Fig. 2.
Jacobi iteration and its variants have limited practical utility by comparison to other iterative procedures due to slow convergence, but the concept of operator spliting has wide applicability. A more consequential example of operator splitting is to consider the advection diffusion equation
which can be interpreted as stating that the time evolution of is due to the effect of a diffusion operator and an advection operator
Suppose both operators are discretized leading to matrices and the discrete system
with initial condition . Advancing the solution by a time step can be written as
and can be separated into two stages
The quantity captures advection effects and is the diffusion correction. Since advection and diffusion are markedly different physical effects describing resolved versus unresolved transport, it can be expected that matrices have different properties that require specific solution procedures.
By contrast, the Jacobi iteration splitting does not separate physical effects and simply is suggested by the sparsity of and computational efficiency per iteration. For example, the forward Gauss-Seidel iteration with leads to
(14) |
The matrix is (non-strictly) lower-triangular and (14) is easily solved by forward substitution. The implementation is very simple to express while preserving two-dimensional indexing.
Algorithm (Componentwise forward Gauss-Seidel)
In the above implementation a single memory space is used for with new values taking place of the old, leading to just four floating point additions and one multiplication per grid point. Since the algorithm essentially takes the current average of neighboring values, it is also known as a relaxation method, smoothing out spatial variations in .
Though such simple implementation is desirable, the non-physical splitting and associated slow convergence usually outweighs ease of coding effort and suggests looking for alternative approaches. The only scenarios where such simply implemented iterations find practical use is in parallel execution and as a preliminary modification of the system prior to use of some other algorithm.