414 Chapter 7 Numerical Methods
7.4 Potential Equation
In this section, we will be concerned with approximate solutions of the po-
tential equation and related equations in a region
R of the xy-plane. For the
sake of simplicity, we will limit ourselves to regions whose boundaries can be
made to coincide with the lines on a sheet of graph paper with square divi-
sions. Thus, we admit such shapes as rectangles, L’s and T’s, but not circles or
triangles. The graph paper provides us with a ready-made mesh of points in
the region
R and on its boundary, at which we wish to know the solution of
ourproblem.Thesepointsaretobenumberedinsomefashion—usuallyleft
to right and bottom to top.
On such a mesh, the replacement for the Laplacian operator is the following:
∂
2
u
∂x
2
+
∂
2
u
∂y
2
→
u
W
−2u
i
+u
E
(x)
2
+
u
N
−2u
i
+u
S
(y)
2
, (1)
where the subscripts E, W stand for the indices of the mesh points to the left
and right of point i and the subscripts N, S stand for those above and below
(see Fig. 1). The result is sometimes called the five-point approximation to the
Laplacian. Because we are assuming that x = y,weobtainafurthersim-
plification in the replacement:
∂
2
u
∂x
2
+
∂
2
u
∂y
2
→
u
N
+u
S
+u
E
+u
W
−4u
i
(x)
2
. (2)
Example.
Solve this problem numerically (see Chapter 4 for the analytical solution):
∂
2
u
∂x
2
+
∂
2
u
∂y
2
=0, 0 < x < 1, 0 < y < 1, (3)
u(0, y) = 0, u(1, y) = 0, 0 < y < 1, (4)
u(x, 0) = f (x), u(x, 1) = f (x), 0 < x < 1, (5)
f (x) =
2x, 0 < x <
1
2
,
2(1 −x),
1
2
≤x < 1.
(6)
Let us take x = y = 1/4 and number the mesh points inside the 1 × 1
square as shown in Fig. 2.
At each of the nine mesh points, we will have the replacement equation
u
N
+u
S
+u
E
+u
W
−4u
i
=0. (7)
Together, these make up a system of nine equations in the nine unknowns
u
1
, u
2
,...,u
9
. Referring to Fig. 2, where the values of u at boundary points are