Next: Example 2-d electrostatic calculation
Up: Poisson's equation
Previous: An example 2-d Poisson
Let us now use the techniques discussed above to solve Poisson's
equation in two dimensions. Suppose that the source term is
![\begin{displaymath}
v(x,y) = 6\,x\,y\,(1-y) - 2\,x^3
\end{displaymath}](img793.png) |
(181) |
for
and
. The boundary conditions
at
are
,
, and
[see Eq. (147)], whereas
the boundary conditions at
are
,
,
and
[see Eq. (148)]. The simple Dirichlet boundary
conditions
are applied at
and
. Of course,
this problem can be solved analytically to give
![\begin{displaymath}
u(x,y) = y\,(1-y)\,x^3.
\end{displaymath}](img800.png) |
(182) |
Figures 63 and 64 show comparisons between the analytic and finite difference
solutions for
. It can be seen that the finite difference solution mirrors
the analytic solution almost exactly.
Figure 63:
Solution of Poisson's equation in two dimensions with simple
Dirichlet boundary conditions in the
-direction. The solution is plotted versus
at
.
The dotted curve (obscured)
shows the analytic solution, whereas the open triangles show the finite difference
solution for
.
![\begin{figure}
\epsfysize =3in
\centerline{\epsffile{p2da.eps}}
\end{figure}](img801.png) |
Figure 64:
Solution of Poisson's equation in two dimensions with simple
Dirichlet boundary conditions in the
-direction. The solution is plotted versus
at
.
The dotted curve (obscured)
shows the analytic solution, whereas the open triangles show the finite difference
solution for
.
![\begin{figure}
\epsfysize =3in
\centerline{\epsffile{p2db.eps}}
\end{figure}](img802.png) |
As a second example, suppose that the source term is
![\begin{displaymath}
v(x,y) =-2\,(2\,y^3-3\,y^2+1) + 6\,(1-x^2)\,(2\,y-1)
\end{displaymath}](img803.png) |
(183) |
for
and
. The boundary conditions
at
are
,
, and
[see Eq. (147)], whereas
the boundary conditions at
are
,
,
and
[see Eq. (148)]. The simple Neumann boundary
conditions
are applied at
and
. Of course,
this problem can be solved analytically to give
![\begin{displaymath}
u(x,y) = (1-x^2)\,(2\,y^3-3\,y^2+1).
\end{displaymath}](img807.png) |
(184) |
Figures 65 and 66 show comparisons between the analytic and finite difference
solutions for
. It can be seen that the finite difference solution mirrors
the analytic solution almost exactly.
Figure 65:
Solution of Poisson's equation in two dimensions with simple
Neumann boundary conditions in the
-direction. The solution is plotted versus
at
.
The dotted curve (obscured)
shows the analytic solution, whereas the open triangles show the finite difference
solution for
.
![\begin{figure}
\epsfysize =3in
\centerline{\epsffile{p2dc.eps}}
\end{figure}](img808.png) |
Figure 66:
Solution of Poisson's equation in two dimensions with simple
Neumann boundary conditions in the
-direction. The solution is plotted versus
at
.
The dotted curve (obscured)
shows the analytic solution, whereas the open triangles show the finite difference
solution for
.
![\begin{figure}
\epsfysize =3in
\centerline{\epsffile{p2dd.eps}}
\end{figure}](img809.png) |
Next: Example 2-d electrostatic calculation
Up: Poisson's equation
Previous: An example 2-d Poisson
Richard Fitzpatrick
2006-03-29