next up previous
Next: Program Listing Up: Comparison of various runs Previous: Comparison of various runs

Algorithm

The Jacobi method here is applied to solve the Laplace's equation $\nabla^2 \phi=0$. Using finite difference, the Laplace's equiation can be written as

\begin{displaymath}
\frac{\phi_{i+1,j}-2\phi_{i,j}+\phi_{i-1,j}}{\Delta x^2} +
\frac{\phi_{i,j+1}-2\phi_{i,j}+\phi_{i,j-1}}{\Delta y^2} = 0\end{displaymath}

For $\Delta x = \Delta y$, we get

\begin{displaymath}
-4\phi_{i,j}+\phi_{i+1,j}+\phi_{i-1,j}+\phi_{i,j+1}+\phi_{i,j-1}=0\end{displaymath}

So, the Jacobi method simply becomes

\begin{displaymath}
\phi^{n+1}_{i,j} = \frac{1}{4} \left [ \phi^n_{i+1,j}+
\phi^n_{i-1,j}+\phi^n_{i,j+1}+\phi^n_{i,j-1} \right ]\end{displaymath}

where n is the iteration level.

For the problem we are solving, we have a square domain with constant $\phi$ (in this case temperature) along two different continuous boundaries ($\phi=0$ for one and $\phi=100$ for the other which represents the initial temperature) and it varies linearly (from to 100) in between the two regions.



Anirudh Modi
4/10/1998