Scientific Computing

This module illustrates the numerical solution of Laplace's equation
using iterative methods to solve the linear system resulting from a
finite difference discretization. Laplace's equation (also called the
potential equation) in two space dimensions is the partial differential
equation *u*_{xx} +
*u*_{yy} = 0,*u*(*x*, *y*)*x* and *y*, and subscripts indicate partial
differentiation with respect to the given independent variable. This
module considers Laplace's equation on the unit square *u* to Laplace's equation can be visualized as a surface
over the unit square, whose height at a given point *x*,
*y*)*u*(*x*,
*y*)*n* × *n*

The user begins by selecting from the menu provided a set of boundary
conditions, whose values are displayed below the menu. Next the user
specifies the number of interior grid points n to be used in each
dimension of a two-dimensional grid discretizing the unit square.
Finally, the user chooses an iterative method to solve the resulting
system of *n*^{2} finite difference equations, with one
equation and one unknown for each interior grid point. The menu of
iterative methods is roughly ordered from slowest to fastest
convergence rate. For the SOR method, the user can specify the
relaxation parameter *ω*. Any choice allowed for
*ω* will eventually converge, but the optimal *ω*
indicated gives the best asymptotic convergence rate for this
particular finite difference system. Here the SOR method is
implemented using the "red-black" ordering, in which the mesh points
are colored as in a checkerboard, and on each iteration the solution
components corresponding to the red points are updated before those
corresponding to the black points.

The initial guess for the solution is taken to be zero at each
interior grid point. At any stage of the iterative solution process,
the current approximate solution is represented in three dimensions as
a surface over the unit square, including both the approximate solution
values at interior points and the prescribed boundary values at
boundary points. An iteration is performed each time the user clicks
*Iterate*, and the resulting new approximate solution surface is
updated in the graph. The residual displayed provides a means of
monitoring convergence to the solution of the linear system. At
convergence, the accuracy of the discrete approximation to the
continuous solution of Laplace's equation depends on the number of grid
points, with the error being proportional to *n*^{2}

**Reference:** Michael T. Heath, *Scientific Computing,
An Introductory Survey*, 2nd edition, McGraw-Hill, New York,
2002. See Section 11.3.1, especially Example 11.5, and Section 11.5.

**Developers:** Evan VanderZee and Michael Heath