HOME
PDF

Symbolic generating of system equations for 2D regular grid for solving the Laplace equation using finite difference method

Nasser M. Abbasi

Math 228A, UC Davis, Fall 2010 page compiled on July 1, 2015 at 7:15pm
∂2u    ∂2u
---- + ----=  f(x,y)
∂x2    ∂x2

When solving the above equation using finite difference method on square, in order to make it easy to see the internal structure of the A matrix using the standard 5 points Laplacian scheme, the following is a small function which generates the symbolic format of these equations for a given N  , the number of grid points on one edge. At the end of this note, the system equations are generated for N =  4,5,6,7,8  . One can see the form of the A  matrix with the dominant diagonal.

1.
HTML
2.
PDF
3.
Mathematica notebook