Poisson Solver

Fast Poisson Solver in a Square. The following is a Fast Solver for the PDE: uxx + uyy = f(x,y) in a square, implemented in Matlab. I followed the outline from Arieh Iserles’ Numerical Analysis of Differential Equations (Chapter 12), James Demmel’s Applied Numerical Linear Algebra (Chapter 6), and some personal inspiration. This Poisson Solver is written to use the modified 9-point scheme of order (delta x)^4 instead of the plain 5 and 9 point schemes of order (delta x)^2. However, any of the three schemes can be used. That is, to call this function, type poisson(m,endpt,N) where m = the mesh refinement (best to keep below 150 on a PC. m = 150 on my PC took 7-8 minutes to solve), endpt = the endpt of the the square (i.e., 0endpt), and N = 5,9 or 10. If you want to use the five-point scheme, set N = 5, for the 9-point scheme, set N = 9 and for the Modified 9-point scheme, set N = 10. (If f(x,y) = 0 in uxx + uyy = f(x,y), it is best to set N = 9 since the 9 and modified 9-point schemes are equivalent when f = 0)