2D Laplace equation using iterative methods - Your turn

2D Laplace equation using iterative methods - Your turn#

Using the same criteria as the example problem, adjust the code for the Gauss-Seidel iteration method using \(30\) nodes. The iteration scheme is

\[ u_{i,j}^{n+1} = \dfrac{u_{i-1,j}^{n+1} + u_{i+1,j}^{n} + u_{i,j-1}^{n+1} + u_{i,j+1}^{n}}{4} \]

Note

The difference in efficiency may not be noticeable, but the Gauss-Seidel method will help the calculations reach the steady-state solution faster (i.e., with fewer iterations) than with the Jacobi method.

# TODO: Write your solution below

Exporting your work#

When you’re ready, the easiest way to export the notebook is to File > Print it and save it as a PDF. Remove any excessively long, unrelated outputs first by clicking the arrow → next to the output box and then Show/hide output. Obviously don’t obscure any necessary output or graphs!