Yes, there is an analytical solution. The min/max only applies to Laplace PDE, not Poisson.
Here is the analytical solution. I verified it using Mathematica's NDSolve
and it agrees. So I do not know why Mathematica DSolve
could not solve it. May be in version 12 it will.
Analytical solution
solve
\begin{align*}
\frac{u_{xx}}{A}+\frac{u_{yy}}{B} & =-2\theta\\
Bu_{xx}+Au_{yy} & =-2\theta AB\\
& =C
\end{align*}
Where $C=-2\theta AB$ is a new constant. With boundary conditions
\begin{align*}
u\left( x,-b\right) & =0\\
u\left( x,b\right) & =0\\
u\left( -a,y\right) & =0\\
u\left( a,y\right) & =0
\end{align*}
To simplify solution, shift the rectangle so its lower left corner on the
origin. Let $\tilde{x}=x+a$, and $\tilde{y}=y+b$. The boundary conditions becomes
\begin{align*}
u\left( \tilde{x},0\right) & =0\\
u\left( \tilde{x},2b\right) & =0\\
u\left( 0,\tilde{y}\right) & =0\\
u\left( 2a,\tilde{y}\right) & =0
\end{align*}
And the pde becomes $Bu_{\tilde{x}\tilde{x}}+Au_{\tilde{y}\tilde{y}}=C$.
Instead of keep writing $\tilde{x},\tilde{y}$, will use $x,y$, but remember
that these are shifted version. At the end, we shift back.
Hence the PDE to solve is $Bu_{xx}+Au_{yy}=C$ with BC
\begin{align*}
u\left( x,0\right) & =0\\
u\left( x,2b\right) & =0\\
u\left( 0,y\right) & =0\\
u\left( 2a,y\right) & =0
\end{align*}
Using eigenfunction expansion method. Let
\begin{equation}
u\left( x,y\right) =\sum_{n=1}^{\infty}b_{n}\left( y\right) X_{n}\left(
x\right) \tag{1}
\end{equation}
Where $X_{n}\left( x\right) $ is eigenfunctions for $X^{\prime\prime}\left(
x\right) +\lambda_{n}X\left( x\right) =0$ with boundary conditions
$X\left( 0\right) =X\left( 2a\right) =0$. This has eigenfunctions as
$X_{n}\left( x\right) =\sin\left( \sqrt{\lambda_{n}}x\right) $ with
eigenvalues $\lambda_{n}=\left( \frac{n\pi}{2a}\right) ^{2}$ \ for
$n=1,2,\cdots$.
Substituting (1) into the PDE $Bu_{xx}+Au_{yy}=C$ gives
$$
B\sum_{n=1}^{\infty}b_{n}\left( y\right) X_{n}^{\prime\prime}\left(
x\right) +A\sum_{n=1}^{\infty}b_{n}^{\prime\prime}\left( y\right)
X_{n}\left( x\right) =C
$$
Expanding $C$ (a constant) as Fourier sine series the above becomes
$$
B\sum_{n=1}^{\infty}b_{n}\left( y\right) X_{n}^{\prime\prime}\left(
x\right) +A\sum_{n=1}^{\infty}b_{n}^{\prime\prime}\left( y\right)
X_{n}\left( x\right) =\sum_{n=1}^{\infty}q_{n}X_{n}\left( x\right)
$$
But $X_{n}^{\prime\prime}\left( x\right) =-\lambda_{n}X_{n}\left( x\right)
$, hence the above becomes
\begin{align}
-B\sum_{n=1}^{\infty}\lambda_{n}b_{n}\left( y\right) X_{n}\left( x\right)
+A\sum_{n=1}^{\infty}b_{n}^{\prime\prime}\left( y\right) X_{n}\left(
x\right) & =\sum_{n=1}^{\infty}q_{n}X_{n}\left( x\right) \nonumber\\
Ab_{n}^{\prime\prime}\left( y\right) -B\lambda_{n}b_{n}\left( y\right) &
=q_{n}\tag{1A}
\end{align}
But
\begin{align*}
C & =\sum_{n=1}^{\infty}q_{n}X_{n}\left( x\right) \\
\int_{0}^{2a}CX_{n}\left( x\right) dx & =q_{n}\int_{0}^{2a}X_{n}^{2}\left(
x\right) dx\\
\int_{0}^{2a}C\sin\left( \sqrt{\lambda_{n}}x\right) dx & =q_{n}\int
_{0}^{2a}\sin^{2}\left( \sqrt{\lambda_{n}}x\right) dx\\
\frac{-C}{\sqrt{\lambda_{n}}}\left( \left( -1\right) ^{n}-1\right) &
=q_{n}a\\
q_{n} & =\frac{-C}{a\sqrt{\lambda_{n}}}\left( \left( -1\right)
^{n}-1\right)
\end{align*}
Hence (1A) becomes
$$
Ab_{n}^{\prime\prime}\left( y\right) -B\lambda_{n}b_{n}\left( y\right)
=\frac{-C}{a\sqrt{\lambda_{n}}}\left( \left( -1\right) ^{n}-1\right)
$$
This is standard second order linear ODE. The solution is
$$
b_{n}\left( y\right) =D_{n}e^{\sqrt{\frac{B}{A}\lambda_{n}}y}+E_{n}
e^{-\sqrt{\frac{B}{A}\lambda_{n}}y}+\frac{C}{aB\lambda_{n}^{\frac{3}{2}}
}\left( \left( -1\right) ^{n}-1\right)
$$
Using the above in (1) gives the solution
\begin{equation}
u\left( x,y\right) =\sum_{n=1}^{\infty}\left( D_{n}e^{\sqrt{\frac{B}
{A}\lambda_{n}}y}+E_{n}e^{-\sqrt{\frac{B}{A}\lambda_{n}}y}+\frac{C}
{aB\lambda_{n}^{\frac{3}{2}}}\left( \left( -1\right) ^{n}-1\right)
\right) X_{n}\left( x\right) \tag{1A}
\end{equation}
We now need to find $D_{n},E_{n}$.
Case $n$ even
When $n$ is even $\left( \left( -1\right) ^{n}-1\right) =0$ and the
solution (1A) becomes
$$
u\left( x,y\right) =\sum_{n=1}^{\infty}\left( D_{n}e^{\sqrt{\frac{B}
{A}\lambda_{n}}y}+E_{n}e^{-\sqrt{\frac{B}{A}\lambda_{n}}y}\right)
X_{n}\left( x\right)
$$
At $y=0$ the above gives
$$
0=\sum_{n=1}^{\infty}\left( D_{n}+E_{n}\right) \sin\left( \sqrt{\lambda
_{n}}x\right)
$$
Therefore
\begin{equation}
D_{n}+E_{n}=0 \tag{2}
\end{equation}
And at $y=2b$
$$
0=\sum_{n=1}^{\infty}\left( D_{n}e^{\sqrt{\frac{B}{A}\lambda_{n}}2b}
+E_{n}e^{-\sqrt{\frac{B}{A}\lambda_{n}}2b}\right) \sin\left( \sqrt
{\lambda_{n}}x\right)
$$
Therefore
\begin{equation}
D_{n}e^{\sqrt{\frac{B}{A}\lambda_{n}}2b}+E_{n}e^{-\sqrt{\frac{B}{A}\lambda
_{n}}2b}=0 \tag{3}
\end{equation}
From (2,3) we see that $D_{n}=E_{n}=0$, Hence $u\left( x,y\right) =0$ when
$n$ even.
Case $n$ odd
When $n$ is odd $\left( \left( -1\right) ^{n}-1\right) =-2$ and the
solution (1A) becomes
$$
u\left( x,y\right) =\sum_{n=1}^{\infty}\left( D_{n}e^{\sqrt{\frac{B}
{A}\lambda_{n}}y}+E_{n}e^{-\sqrt{\frac{B}{A}\lambda_{n}}y}-\frac{2C}
{aB\lambda_{n}^{\frac{3}{2}}}\right) X_{n}\left( x\right)
$$
At $y=0$ the above gives
$$
0=\sum_{n=1}^{\infty}\left( D_{n}+E_{n}-\frac{2C}{aB\lambda_{n}^{\frac{3}{2}
}}\right) \sin\left( \sqrt{\lambda_{n}}x\right)
$$
Therefore
\begin{equation}
D_{n}+E_{n}-\frac{2C}{aB\lambda_{n}^{\frac{3}{2}}}=0\tag{4}
\end{equation}
And at $y=2b$
$$
0=\sum_{n=1}^{\infty}\left( D_{n}e^{\sqrt{\frac{B}{A}\lambda_{n}}2b}
+E_{n}e^{-\sqrt{\frac{B}{A}\lambda_{n}}2b}-\frac{2C}{aB\lambda_{n}^{\frac
{3}{2}}}\right) \sin\left( \sqrt{\lambda_{n}}x\right)
$$
Therefore
\begin{equation}
D_{n}e^{\sqrt{\frac{B}{A}\lambda_{n}}2b}+E_{n}e^{-\sqrt{\frac{B}{A}\lambda
_{n}}2b}-\frac{2C}{aB\lambda_{n}^{\frac{3}{2}}}=0\tag{5}
\end{equation}
Solving (4,5) for $D_{n},E_{n}$ gives
\begin{align*}
D_{n} & =\frac{2C}{aB\lambda_{n}^{\frac{3}{2}}}\frac{1}{1+e^{\sqrt{\frac
{B}{A}\lambda_{n}}2b}}\\
E_{n} & =\frac{2C}{aB\lambda_{n}^{\frac{3}{2}}}\frac{e^{\sqrt{\frac{B}
{A}\lambda_{n}}2b}}{1+e^{\sqrt{\frac{B}{A}\lambda_{n}}2b}}
\end{align*}
Therefore the final solution from (1A) becomes
\begin{align*}
u\left( x,y\right) & =\sum_{n=1,3,5,\cdots}^{\infty}\left( D_{n}
e^{\sqrt{\frac{B}{A}\lambda_{n}}y}+E_{n}e^{-\sqrt{\frac{B}{A}\lambda_{n}}
y}-\frac{2C}{aB\lambda_{n}^{\frac{3}{2}}}\right) X_{n}\left( x\right) \\
& =\sum_{n=1,3,5,\cdots}^{\infty}\left( \left( \frac{2C}{aB\lambda
_{n}^{\frac{3}{2}}}\frac{1}{1+e^{\sqrt{\frac{B}{A}\lambda_{n}}2b}}\right)
e^{\sqrt{\frac{B}{A}\lambda_{n}}y}+\left( \frac{2C}{aB\lambda_{n}^{\frac
{3}{2}}}\frac{e^{\sqrt{\frac{B}{A}\lambda_{n}}2b}}{1+e^{\sqrt{\frac{B}
{A}\lambda_{n}}2b}}\right) e^{-\sqrt{\frac{B}{A}\lambda_{n}}y}-\frac
{2C}{aB\lambda_{n}^{\frac{3}{2}}}\right) \sin\left( \sqrt{\lambda_{n}
}x\right)
\end{align*}
Where $\lambda_{n}=\left( \frac{n\pi}{2a}\right) ^{2}$. Switching back to
original coordinates using $\tilde{x}=x+a$, and $\tilde{y}=y+b$, then the
above is
$$
u\left( x,y\right) =\sum_{n=1,3,5,\cdots}^{\infty}\left( \left( \frac
{2C}{aB\lambda_{n}^{\frac{3}{2}}}\frac{1}{1+e^{\sqrt{\frac{B}{A}\lambda_{n}
}2b}}\right) e^{\sqrt{\frac{B}{A}\lambda_{n}}\left( y+b\right) }+\left(
\frac{2C}{aB\lambda_{n}^{\frac{3}{2}}}\frac{e^{\sqrt{\frac{B}{A}\lambda_{n}
}2b}}{1+e^{\sqrt{\frac{B}{A}\lambda_{n}}2b}}\right) e\left( ^{-\sqrt
{\frac{B}{A}\lambda_{n}}y+b}\right) -\frac{2C}{aB\lambda_{n}^{\frac{3}{2}}
}\right) \sin\left( \sqrt{\lambda_{n}}\left( x+a\right) \right)
$$
Where $C=-2\theta AB$, hence
\begin{align*}
u\left( x,y\right) & =\sum_{n=1,3,5,\cdots}^{\infty}\left( \left(
\frac{-4\theta AB}{aB\lambda_{n}^{\frac{3}{2}}}\frac{1}{1+e^{\sqrt{\frac{B}
{A}\lambda_{n}}2b}}\right) e^{\sqrt{\frac{B}{A}\lambda_{n}}\left(
y+b\right) }+\left( \frac{-4\theta AB}{aB\lambda_{n}^{\frac{3}{2}}}
\frac{e^{\sqrt{\frac{B}{A}\lambda_{n}}2b}}{1+e^{\sqrt{\frac{B}{A}\lambda_{n}
}2b}}\right) e^{-\sqrt{\frac{B}{A}\lambda_{n}}\left( y+b\right) }
+\frac{4\theta AB}{aB\lambda_{n}^{\frac{3}{2}}}\right) \sin\left(
\sqrt{\lambda_{n}}\left( x+a\right) \right) \\
& =\sum_{n=1,3,5,\cdots}^{\infty}\left( \left( \frac{-4\theta A}
{a\lambda_{n}^{\frac{3}{2}}}\frac{1}{1+e^{\sqrt{\frac{B}{A}\lambda_{n}}2b}
}\right) e^{\sqrt{\frac{B}{A}\lambda_{n}}\left( y+b\right) }+\left(
\frac{-4\theta A}{a\lambda_{n}^{\frac{3}{2}}}\frac{e^{\sqrt{\frac{B}{A}
\lambda_{n}}2b}}{1+e^{\sqrt{\frac{B}{A}\lambda_{n}}2b}}\right) e^{-\sqrt
{\frac{B}{A}\lambda_{n}}\left( y+b\right) }+\frac{4\theta A}{a\lambda
_{n}^{\frac{3}{2}}}\right) \sin\left( \sqrt{\lambda_{n}}\left( x+a\right)
\right)
\end{align*}
Verification against NDsolve
Test 1
ClearAll[a, b, A, B, z, n, x, y, u, lam];
a = 1; b = 5; A = 1; B = 2; theta = 3;
(*analytic*)
lam = ((n*Pi)/(2*a))^2;
term1 = 1/(1 + Exp[Sqrt[(B/A)*lam]*2*b]);
term2 = (4*theta*A)/(a*lam^(3/2));
mysol[maxTerms_, x_, y_] :=
Sum[(((-term2)*term1)*
Exp[Sqrt[(B/A)*lam]*(y + b)] + ((-term2)*term1*
Exp[Sqrt[(B/A)*lam]*(2*b)])*
Exp[(-Sqrt[(B/A)*lam])*(y + b)] + term2)*
Sin[Sqrt[lam]*(x + a)], {n, 1, maxTerms, 2}];
(*numeric*)
pde = D[u[x, y], {x, 2}]/A + D[u[x, y], {y, 2}]/B == -2*theta;
bc = {u[x, -b] == 0, u[x, b] == 0, u[-a, y] == 0, u[a, y] == 0};
sol = NDSolve[{pde, bc}, u, {x, -a, a}, {y, -b, b}];
Compare 3D
Grid[{{Plot3D[Evaluate[u[x, y] /. sol], {x, -a, a}, {y, -b, b},
PlotLabel -> "Numerical"],
Plot3D[mysol[15, x, y], {x, -a, a}, {y, -b, b},
PlotLabel -> "Analytical"]}}]
compare contour
Grid[{{ContourPlot[Evaluate[u[x, y] /. sol], {x, -a, a}, {y, -b, b},
PlotLabel -> "NDSolve"],
ContourPlot[mysol[25, x, y], {x, -a, a}, {y, -b, b},
PlotLabel -> "Analytical"]}}]
Test 2
ClearAll[a, b, A, B, z, n, x, y, u, lam];
a = 3; b = 18; A = 7; B = -2; theta = -10;
lam = ((n*Pi)/(2*a))^2;
term1 = 1/(1 + Exp[Sqrt[(B/A)*lam]*2*b]);
term2 = (4*theta*A)/(a*lam^(3/2));
mysol[maxTerms_, x_, y_] :=
Sum[(((-term2)*term1)*
Exp[Sqrt[(B/A)*lam]*(y + b)] + ((-term2)*term1*
Exp[Sqrt[(B/A)*lam]*(2*b)])*
Exp[(-Sqrt[(B/A)*lam])*(y + b)] + term2)*
Sin[Sqrt[lam]*(x + a)], {n, 1, maxTerms, 2}];
pde = D[u[x, y], {x, 2}]/A + D[u[x, y], {y, 2}]/B == -2*theta;
bc = {u[x, -b] == 0, u[x, b] == 0, u[-a, y] == 0, u[a, y] == 0};
sol = NDSolve[{pde, bc}, u, {x, -a, a}, {y, -b, b}];
Compare 3D
Grid[{{Plot3D[Evaluate[u[x, y] /. sol], {x, -a, a}, {y, -b, b},
PlotLabel -> "Numerical"],
Plot3D[mysol[15, x, y], {x, -a, a}, {y, -b, b},
PlotLabel -> "Analytical"]}}]
Compare contour
Grid[{{ContourPlot[Evaluate[u[x, y] /. sol], {x, -a, a}, {y, -b, b},
PlotLabel -> "NDSolve"],
ContourPlot[mysol[25, x, y], {x, -a, a}, {y, -b, b},
PlotLabel -> "Analytical"]}}]
Solve[\[Phi]2[a,b]==0&&\[Phi]2[-a,-b]==0,{C[1],C[2]}]
but even after adding the parenthesis around\[Phi]2[a,b]==0&&\[Phi]2[-a,-b]==0
I still don't get a solution. $\endgroup${{}}
ofSolve
signifies that "the solution set is full dimensional" (see documentation ofSolve
). The problem is that the solution of your PDE contains two functionsC[1]
andC[2]
, andSolve
can't solve for functions. You would need to supply your boundary conditions directly toDSolve
, but I couldn't get it to work for now (you might have to useNDSolve
). Note also that the way you've written the boundary conditions in code does not match what you've written in the text. $\endgroup$ϕ2[a,b]==0
. I tried limits like I wrote in the question but got no answer. How can I enter the BCs in DSolve? $\endgroup$