next up previous
Next: An example 1-d Poisson Up: Poisson's equation Previous: An example tridiagonal matrix


1-d problem with mixed boundary conditions

Previously, we solved Poisson's equation in one dimension subject to Dirichlet boundary conditions, which are the simplest conceivable boundary conditions. Let us now consider the following much more general set of boundary conditions:
\begin{displaymath}
\alpha_l\,u(x) + \beta_l\,\frac{du(x)}{dx} = \gamma_l,
\end{displaymath} (132)

at $x=x_l$, and
\begin{displaymath}
\alpha_h \,u(x)+ \beta_h\,\frac{du(x)}{dx} = \gamma_h,
\end{displaymath} (133)

at $x=x_h$. Here, $\alpha_l$, $\beta_l$, etc., are known constants. The above boundary conditions are termed mixed, since they are a mixture of Dirichlet and Neumann boundary conditions.

Using the previous notation, the discretized versions of Eq. (132) and (133) are:

$\displaystyle \alpha_l\,u_0 + \beta_l\,\frac{u_1-u_0}{\delta x}$ $\textstyle =$ $\displaystyle \gamma_l,$ (134)
$\displaystyle \alpha_h\,u_{N+1} + \beta_h\,\frac{u_{N+1}-u_N}{\delta x}$ $\textstyle =$ $\displaystyle \gamma_h,$ (135)

respectively. The above expressions can be rearranged to give
$\displaystyle u_0$ $\textstyle =$ $\displaystyle \frac{\gamma_l\,\delta x-\beta_l\,u_1}{\alpha_l\,\delta x -\beta_l},$ (136)
$\displaystyle u_{N+1}$ $\textstyle =$ $\displaystyle \frac{\gamma_h\,\delta x + \beta_h\,u_N}{\alpha_h\,\delta x +\beta_h}.$ (137)

Using Eqs. (115), (136), and (137), the problem can be reduced to a tridiagonal matrix equation ${\bf M}\,{\bf u} = {\bf w}$, where the left, center, and right diagonals of ${\bf M}$ possess the elements $a_i=1$ for $i=2,N$, with

\begin{displaymath}
b_1 = -2 - \frac{\beta_l}{\alpha_l\,\delta x-\beta_l},
\end{displaymath} (138)

and $b_i = -2$ for $i=2,N-1$, plus
\begin{displaymath}
b_N = -2 + \frac{\beta_h}{\alpha_h\,\delta x+\beta_h},
\end{displaymath} (139)

and $c_i = 1$ for $i=1, N-1$, respectively. The elements of the right-hand side are
\begin{displaymath}
w_1 = v_1\,(\delta x)^2 - \frac{\gamma_l\,\delta x}{\alpha_l\,\delta x-\beta_l},
\end{displaymath} (140)

with $w_i = v_i\,(\delta x)^2$ for $i=2,N-1$, and
\begin{displaymath}
w_N = v_N\,(\delta x)^2 - \frac{\gamma_h\,\delta x}{\alpha_h\,\delta x+\beta_h}.
\end{displaymath} (141)

Our tridiagonal matrix equation can be inverted using the algorithm discussed previously.


next up previous
Next: An example 1-d Poisson Up: Poisson's equation Previous: An example tridiagonal matrix
Richard Fitzpatrick 2006-03-29