This sections presents examples of solving the Laplace and Helmholtz equations subject to the Dirichlet boundary conditions in rectangular coordinates. The Dirichlet problem goes back to George Green who studied the problem on general domains with general boundary conditions in his «An Essay on the Application of Mathematical Analysis to the Theories of Electricity and Magnetism», published in 1828.
Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to the main page for the first course APMA0330
Return to the main page for the second course APMA0340
Return to Part VI of the course APMA0340
Introduction to Linear Algebra with Mathematica
Let Ω be a subset of n-dimensional Euclidean space ℝ^{n} with a smooth boundary ∂Ω; let also
\( L\left[ \texttt{D} \right] \) be a elliptic partial differential operator of the second order. There are known two Dirichlet problems: either interior or inner Dirichlet problem or exterior or outer Dirichlet problem. The inner problem asks to find a solution of elliptic equation
\( L\left[ \texttt{D}\right] u = 0 \) inside the domain Ω given values on the boundary ∂Ω of Ω. The exterior Dirichlet problem asks for a solution outside the domain Ω subject the boundary conditions on ∂Ω. These two Dirichlet problems are also called first boundary value problem.
A typical example of an elliptic partial differential equation is Laplace's equation ∇²u = 0, and its solutions deserve a special name.
Solutions of Laplace's equation ∇²u = 0 are called potential functions or harmonic functions. The operator Δ = ∇·∇ = ∇² is called the Laplace operator or Laplacian. In the Cartesian coordinates, the Laplacian is written as \( \Delta = \frac{\partial^2}{\partial x_1^2} + \frac{\partial^2}{\partial x_2^2} + \cdots + \frac{\partial^2}{\partial x_n^2} . \)
Consider the general planar Dirichlet problem for Laplace's equation
\begin{equation} \label{EqDirichlet.1}
u_{xx} + u_{yy} =0 , \qquad 0 < x < a, \quad 0< y <b ,
\end{equation}
in the rectangle \( [0,a] \times [0,b] , \) and also satisfying the boundary conditions
\begin{equation} \label{EqDirichlet.2}
u(x,0) = f_0 (x) , \qquad u(x,b) = f_b (x) , \qquad 0 < x < a,
\end{equation}
Since the boundary of the rectangle has four corner points, we need to impose the requirement on the behavior of the solution in neighborhoods of each corner point to guarantee the uniqueness of the formulated boundary value problem. This topic is beyond the scope of the tutorial, so there are some references.
Kondratiev V.A. and Oleinik O.A. On asymptotics in a neighbourhood of infinity of solutions with the finite Dirichlet integral for second order elliptic equations. Proceedings of the Petrovsky Seminar, Moscow University Press, 1987, No 12, p. 149--163.
Kondratiev V.A. and Oleinik O.A. Boundary value problems for partial differential equations in nonsmooth domains, Uspekhi Mat. Nauk, Vol 38, no 2, 1983, (230) 3--76; English translation in Russian Math Surveys, vol 38, 1983.
Oleinik O.A., Shamaev A.S., and Yosifian G.A. Mathematical Problems in Elasticity and Homogenization, Elsevier, North Holland, 1992.
Sobolev S.L. Some Applications of Functional Analysis in Mathematical Physics, American Mathematical Society, Providence; New edition, 2008.
Also, in applications, it is required that boundary functions satisfy the regularity conditions:
These regularity conditions guarantee that the Dirichlet boundary value problem for the Laplace equation is well-posed.
The first observation of the Dirichlet problem for Laplace's equation is that the partial differential equation is both linear and homogeneous, while the boundary conditions are only linear, but not homogeneous. Therefore, we cannot directly apply the separation of variable method because its application requires homogenization in one of the boundary value variables. Since we don't know any other solving method yet, we break the given problem into sum of four auxiliary problems that have homogeneous boundary conditions on each side of the rectangle except one. So we are going to solve four Dirichlet problems for Laplace's equation:
Note that such decomposition into four Dirichlet problems may violate the regularity conditions; however, we ignore this issue for time being.
The four problems are probably best shown with a quick sketch. Actually, the separation of variables requires representation of the solution as the sum of two functions
We seek partial nontrivial solutions of the Laplace equation representing by the product of two functions \( u(x,y) = X(x)\,Y(y) \) and satisfying the homogeneous boundary conditions in y. Substituting u = X Y in the Laplace equation and separating variables, we obtain
From the homogeneous boundary conditions in y, it follows that
\[
Y(0) =0, \qquad Y(b) =0 .
\]
So we get the Sturm--Liouville problem for variable Y(y): \( Y'' (y) + \lambda\, Y(y) = 0 , \quad Y(0) =0, \ Y(b) =0 . \) This problem is essentially identical to one encountered previously, and we conclude that the Sturm--Liouville problem has discrete number of eigenvalues
for some constant c_{1} and c_{2}.
Since the solution X(x) depends on n, we use the notation X_{n}(x) instead of X(x).
The boundary condition X(𝑎) = 0 dictates
These functions satisfy the Laplace equation and two homogeneous boundary conditions in variable y for each value of n.
To satisfy the remaining nonhomogeneous boundary condition at x=0, we assume, as usual, that we can represent the solution as the sum of all partial nontrivial solutions:
To solve problem B, we proceed in exactly the same as in the previous problem: set \( u(x,y) = X(x)\,Y(y) \) and substitute into the Laplace equation and homogeneous boundary conditions in y. This gives the familiar Sturm--Liouville problem for Y:
To satisfy the homogeneous boundary condition at x = 0, we have to set c_{1n} = 0, leaving the another constant c_{2n} arbitrary.
The solution of the given Dirichlet problem B for Laplace's equation is assumed to be represented as the sum of all partial nontrivial solutions:
\[
u(x,y) = \sum_{n\ge 1} X_n (x)\, Y_n (y) .
\]
Since each term in the above sum satisfies Laplace's equation and the homogeneous boundary conditions in variables y and x\( u(x,0) = u(x,b) =0 \quad \mbox{and} \quad u(0,y) = 0, \) we know that the sum has the same property (subject to uniform convergence, which is assumed). To satisfy the boundary conditions in variable x, we have
Therefore, if we set \( X_n (0) =0 , \) which is equivalent to \( c_{1n} =0, \) it will guarantee that the first boundary condition holds. With this in hand, we obtain the general solution:
which solution we seek in the form of the product \( u(x,y) = X(x) \, Y(y) . \) Substituting this product into Laplace's equation and homogeneous boundary conditions, we obtain the Sturm--Liouville problem
Example:
Find the potential inside a cubical box [0,a]×[0,b]×[0,c]
with grounded walls, except for the side at z = c which has potential \( \displaystyle V_0 \left[ 1 - \left( \frac{2x}{a} -1 \right)^2 \right] . \) his potential increases from zero at the walls to V_{0} at x = a/2.
There is no charge inside the box, so the potential satisfies Laplace’s equation
in a cube with sides a in x, b in y, and c in z with Dirichlet boundary conditions. We try to separate variables by seeking for nontrivial solutions of the form \( u(x,y,z) = X(x)\,Y(y)\,Z(z) . \) Then
\[
X'' Y Z + X Y'' Z = XYZ'' =0 \qquad \Longleftrightarrow \qquad \frac{X''(x)}{X(x)} + \frac{Y''(y)}{Y(y)} + \frac{Z''(z)}{Z(z)} = 0.
\]
The potential is zero at x = 0 and at x = a, so we need k_{1} to be negative and equals to \( - \left( \frac{n\pi}{a} \right)^2 . \) Similar argument gives \( k_2 = - \left( \frac{m\pi}{b} \right)^2 , \) and \( Y_m (y) = \sin \frac{m\pi y}{b} . \) Finally,
We seek its partial nontrivial solutions in the form \( u(x,y) = X(x)\,Y(y) \) that satisfy the homogeneous boundary conditions in y: \( u(x,0) = u(x,b) =0 . \) Upon substitution of the product into the Helmholtz equation, we get
The general solution of the above differential equation depends on the sign of \( \mu = k^2 - \lambda_n = \left( k - \frac{n\pi}{b} \right) \left( k + \frac{n\pi}{b} \right) . \) Therefore, we have to consider three cases.
assuming that u tends to zero as
\( \displaystyle \sqrt{x^2 + y^2} \to \infty . \)
We solve this boundary value problem with the aid of sine Fourier transform. So we multiply Laplace's equation by sin (kx) and integrate with respect to x from 0 to infinity.
is the sine Fourier transform of function u with respect to x variable. This allows us to rewrite the given partial differential equation as an ordinary differential equation:
As we see, the function u_{f} is hard to determined because it is expressed via the double integral. However, function u_{g}
is expressed as the special form of convolution:
Example:
Consider a semi-infinite strip with specified temperature that modeled by the following Dirichlet problem:
\[
\begin{split}
u_{xx} + u_{yy} =0 , \qquad 0 < x < a, \quad 0 < y < \infty ;
\\
u(0,y) = A, \qquad u(a,y) = B , \qquad 0 < y < \infty ;
\\
u(x,0) = f(x) \qquad 0 < x < a, \qquad u(x,y) \,\mapsto \,0 \quad\mbox{as}\quad y \to \infty ,
\end{split}
\]
where A and B are constants. It should be noted that such choice of boundary functions is not realistic because it is impossible to maintain constant temperatures (other than zero) on the boundaries x=0 and x=a because it requires infinite energy supply. In reality, A and B are functions of y decaying with y so they are square integrable (=finite energy).
We have two options to solve this problem: separation of variables method and sine Fourier transform. We show how both options work, starting with the latter.
We can apply separation of variables only when boundary conditions in one of the variables are homogeneous. Therefore, we represent the required solution as the sum
\[
u(x,y) = w(x,y) + v(x,y) ,
\]
where w(x,y) is any function that satisfies the Dirichlet boundary condition in variable x:
\[
w(0,y) = A , \qquad w(a,y) =B.
\]
So we choose \( \displaystyle w = \frac{x}{a}\,B + \frac{a-x}{a} \,A , \) which obviously satisfies the required boundary conditions in variable x. Then for v, we get a similar Dirichlet problem but with homogeneous boundary conditions in variable x:
\[
\begin{split}
v_{xx} + v_{yy} =0 , \qquad 0 < x < a, \quad 0 < y < \infty ;
\\
v(0,y) = 0 \qquad v(a,y) = 0 , \qquad 0 < y < \infty ;
\\
v(x,0) = f(x) - w(x) \qquad 0 < x < a, \qquad v(x,y) \,\mapsto \,0 \quad\mbox{as}\quad y \to \infty .
\end{split}
\]
Now we apply separation of variables. We seek partial nontrivial solutions of the Laplace equation Δv=0 that satisfy the homogeneous boundary conditions in variable x, and is represented as a product of two functions
\[
v(x,y) = X(x)\,Y(y) .
\]
Substituting this form of solutions into the Laplace equation and boundary conditions in the variable x, we obtain the following differential equation in Y
Now we show how to determine the solution using sine Fourier transform. Recall that the sine Fourier transform of a function f define on semi-infinite interval (0, ∞) is
are sine Fourier transforms of functions A(y) and B(y), respectively. I believe that Mathematica knows how to solve the corresponding homogeneous boundary value problem and how to determine the Green function.
DSolve[{u''[x] -p^2 *u[x] ==0, u[0]==A, u[a]==B}, u, x ]
{{u -> Function[{x}, (
E^(-p x) (-B E^(a p) + A E^(2 a p) - A E^(2 p x) +
B E^(a p + 2 p x)))/(-1 + E^(2 a p))]}}
DSolve[{u''[x] -p^2 *u[x] ==0, u[0]==0, u[a]==1}, u[x], x ]
{{u[x] -> (E^(a p - p x) (-1 + E^(2 p x)))/(-1 + E^(2 a p))}}
Therefore, the sine Fourier transform of the unknown solutions is
Return to Mathematica page
Return to the main page (APMA0340)
Return to the Part 1 Matrix Algebra
Return to the Part 2 Linear Systems of Ordinary Differential Equations
Return to the Part 3 Non-linear Systems of Ordinary Differential Equations
Return to the Part 4 Numerical Methods
Return to the Part 5 Fourier Series
Return to the Part 6 Partial Differential Equations
Return to the Part 7 Special Functions