next up previous
Next: Example 2-d electrostatic calculation Up: Poisson's equation Previous: An example 2-d Poisson

An example solution of Poisson's equation in 2-d

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} (181)

for $0\leq x\leq 1$ and $0\leq y \leq 1$. The boundary conditions at $x=0$ are $\alpha _l = 1$, $\beta_l=0$, and $\gamma_l=0$ [see Eq. (147)], whereas the boundary conditions at $x=1$ are $\alpha _h=1$, $\beta_h=0$, and $\gamma_h=y\,(1-y)$ [see Eq. (148)]. The simple Dirichlet boundary conditions $u(x,0)=u(x,1)=0$ are applied at $y=0$ and $y=1$. Of course, this problem can be solved analytically to give
\begin{displaymath}
u(x,y) = y\,(1-y)\,x^3.
\end{displaymath} (182)

Figures 63 and 64 show comparisons between the analytic and finite difference solutions for $N=J=64$. 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 $y$-direction. The solution is plotted versus $x$ at $y=0.5$. The dotted curve (obscured) shows the analytic solution, whereas the open triangles show the finite difference solution for $N=J=64$.
\begin{figure}
\epsfysize =3in
\centerline{\epsffile{p2da.eps}}
\end{figure}

Figure 64: Solution of Poisson's equation in two dimensions with simple Dirichlet boundary conditions in the $y$-direction. The solution is plotted versus $y$ at $x=0.5$. The dotted curve (obscured) shows the analytic solution, whereas the open triangles show the finite difference solution for $N=J=64$.
\begin{figure}
\epsfysize =3in
\centerline{\epsffile{p2db.eps}}
\end{figure}

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} (183)

for $0\leq x\leq 1$ and $0\leq y \leq 1$. The boundary conditions at $x=0$ are $\alpha _l = 1$, $\beta_l=0$, and $\gamma_l=2\,y^3-3\,y^2+1$ [see Eq. (147)], whereas the boundary conditions at $x=1$ are $\alpha _h=1$, $\beta_h=0$, and $\gamma_h=0$ [see Eq. (148)]. The simple Neumann boundary conditions $\partial u(x,0)/\partial y=\partial u(x,1)/\partial y=0$ are applied at $y=0$ and $y=1$. 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} (184)

Figures 65 and 66 show comparisons between the analytic and finite difference solutions for $N=J=64$. 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 $y$-direction. The solution is plotted versus $x$ at $y=0.5$. The dotted curve (obscured) shows the analytic solution, whereas the open triangles show the finite difference solution for $N=J=64$.
\begin{figure}
\epsfysize =3in
\centerline{\epsffile{p2dc.eps}}
\end{figure}

Figure 66: Solution of Poisson's equation in two dimensions with simple Neumann boundary conditions in the $y$-direction. The solution is plotted versus $y$ at $x=0.5$. The dotted curve (obscured) shows the analytic solution, whereas the open triangles show the finite difference solution for $N=J=64$.
\begin{figure}
\epsfysize =3in
\centerline{\epsffile{p2dd.eps}}
\end{figure}


next up previous
Next: Example 2-d electrostatic calculation Up: Poisson's equation Previous: An example 2-d Poisson
Richard Fitzpatrick 2006-03-29