71 | | Error, accuracy, convergence, solution is guaranteed to converge |
| 67 | Note that the above discretized Poisson equation can be rearranged for u at a given grid point, |
| 68 | |
| 69 | [[latex($u_i = \frac{1}{2}(u_{i-1}+ u_{i+1} - h f_i) $)]] |
| 70 | |
| 71 | This then can be rewritten as an iteration equation, where the left hand side (LHS) is the iterated, or updated solution, at grid point i, and the RHS is the value of the grid point's neighbors prior to the iteration step. |
| 72 | |
| 73 | Thus, starting with initial guesses at the solution for each point on the grid, one can loop through each point on the grid and 'update' it so that it solves this relationship for its neighbors (and source f). |
| 74 | |
| 75 | We say that the iteration converges when the LHS-RHS < tol, where tol is some small number for the tolerance. |
| 76 | |
| 77 | By evaluating the matrix spoke of earlier, one can prove that this process will both always converge (in some finite number of iterations) and will provides an approximation to how long convergence will take (see Numerical Recipes for nice overview on this process, again chapt 19). |
| 78 | |
| 79 | Jacobi iteration (the specific scheme I used), applies this equation to each grid point on the grid, stores each value of ui, and then uses all of the updated ui's in the next iteration step, if convergence was not yet reached. This is different than Gauss-Siedel, which updates half the grid in the first 1/2 of the iteration step, and the next half in the second (see Leveque). The amount of time to converge is inversely proportional to the grid point spacing. The finer your grid, the longer it takes to converge. A helpful formula is given, [http://www.rsmas.miami.edu/personal/miskandarani/Courses/MSC321/Projects/prjpoisson.pdf here] |
| 80 | |