18 Reduced Helmholtz PDE in Cartesian coordinates

18.1 Inside square

____________________________________________________________________________________

18.1 Inside square

problem number 128

Added December 20, 2018.

Example 24, taken from https://www.mapleprimes.com/posts/209970-Exact-Solutions-For-PDE-And-Boundary--Initial-Conditions-2018

Solve for \(u\left ( x,y\right ) \)

\begin {align*} \frac {\partial ^{2}u}{\partial x^{2}}+\frac {\partial ^{2}u}{\partial y^2} - k u(x,y) & = 0 \end {align*}

With \(k>0\). It is called reduced Helmholtz, because of the minus sign above. Otherwise, standard Helmholtz has a positive sign.

Boundary conditions

\begin {align*} u(x,0) &= 0 \\ u(x,\pi ) &= 0 \\ u(0,y) &= 1 \\ u(\pi ,y) &=0 \end {align*}

Mathematica

ClearAll[x, y, n, u, k]; 
 pde = Laplacian[u[x, y], {x, y}] - k*u[x, y] == 0; 
 bc = {u[x, 0] == 0, u[x, Pi] == 0, u[0, y] == 1, u[Pi, y] == 0}; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], {x, y}, Assumptions -> k > 0], 60*10]];
 

\[ \text {Failed} \]

Maple

 
x:='x'; y:='y'; u:='u';k:='k'; 
pde:= diff(u(x, y), x$2)+diff(u(x, y), y$2)-k*u(x, y) = 0; 
bc_left_edge:=u(0, y) = 1; 
bc_lower_edge:=u(x, 0) = 0; 
bc_top_edge:=u(x,Pi)=0; 
bc_right_edge:=u(Pi,y)=0; 
bc:=bc_left_edge,bc_lower_edge,bc_top_edge,bc_right_edge; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc ], u(x, y)) assuming k>0),output='realtime'));
 

\[ u \left ( x,y \right ) =\sum _{n=1}^{\infty }-2\,{\frac {\sin \left ( ny \right ) \left ( -1+ \left ( -1 \right ) ^{n} \right ) \left ( {{\rm e}^{- \left ( x-2\,\pi \right ) \sqrt {{n}^{2}+k}}}-{{\rm e}^{\sqrt {{n}^{2}+k}x}} \right ) }{ \left ( {{\rm e}^{2\,\sqrt {{n}^{2}+k}\pi }}-1 \right ) \pi \,n}} \]