Example 2.  Solve Laplace's equation over a  21 by 21  grid with boundary conditions
    Top:       180
    Left:         80
    Bottom:   20
    Right:        0

Solution 2.

This problem has the same boundary values as Example 1.  Let's do it with a 21 by 21 grid which is about 5.5 times as much work.
It will require more iterations, but the graph will be nicer.  You most likely do not want to "look at" the data structure which is a 21 by 21 matrix.

 

[Graphics:../Images/EllipticPDEMod_gr_33.gif]

Next, solve it.

[Graphics:../Images/EllipticPDEMod_gr_34.gif]

[Graphics:../Images/EllipticPDEMod_gr_35.gif]

Plot the solution.

[Graphics:../Images/EllipticPDEMod_gr_36.gif]


[Graphics:../Images/EllipticPDEMod_gr_37.gif]

[Graphics:../Images/EllipticPDEMod_gr_38.gif]

[Graphics:../Images/EllipticPDEMod_gr_39.gif]


We can make a contour plot of the solution.  However, to get the orientation like the table and the 3D figure requires reversing the rows in the matrix.

[Graphics:../Images/EllipticPDEMod_gr_40.gif]


[Graphics:../Images/EllipticPDEMod_gr_41.gif]

[Graphics:../Images/EllipticPDEMod_gr_42.gif]

[Graphics:../Images/EllipticPDEMod_gr_43.gif]

The contour graph is looking better when there are more grid points.  However, because of the discontinuities in each corner, Mathematica is having difficulties computing the contour lines.  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004