next up previous
Next: 3. Stochastics Up: 2.5 Sample Applications Previous: 2.5.1 Thermal Conduction in

2.5.2 Potential Equation in 2D

Discretize the elliptic PDE
    $\displaystyle \frac{\partial^{2}u}{\partial x^{2}}+\frac{\partial^{2}u}{\partial y^{2}}=
-\rho$  

$\Longrightarrow$
    $\displaystyle \frac{1}{(\Delta x)^{2}} \left[ u_{i+1,j} - 2u_{i,j} + u_{i-1,j} +
u_{i,j+1} - 2u_{i,j} + u_{i,j-1} \right] = -\rho_{i,j}$  
    $\displaystyle \hspace{14em}i=1,\dots N; \, j=1, \dots M$  

Combining the $N$ row vectors $\{u_{i,j}\,;\;j=1, \dots M \}$ sequentially to a vector $\mbox{$\bf v$}$ of length $N.M$ we may write these equations in the form
    $\displaystyle \mbox{${\bf A}$} \cdot \mbox{$\bf v$} = \mbox{$\bf b$}$  

where $\mbox{${\bf A}$}$ is a sparse matrix, and where the vector $\mbox{$\bf b$}$ contains the charge density $\rho$ and the given boundary values of the potential function $u$.

Solve by applying any of the Relaxation Methods.


Franz J. Vesely Oct 2005
See also:
"Computational Physics - An Introduction," Kluwer-Plenum 2001