17 Helmholtz PDE in Cartesian coordinates

17.1 Dirichlet problem for the Helmholtz equation in a rectangle
17.2 With no boundary conditions specified

____________________________________________________________________________________

17.1 Dirichlet problem for the Helmholtz equation in a rectangle

problem number 126

Taken from Mathematica DSolve help pages.

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

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

Boundary conditions

\begin {align*} u(x,0) &= \text {UnitTriangle[x-2]} \\ u(x,2) &= 0 \\ u(0,y) &= 0 \\ u(4,y) &=0 \end {align*}

Mathematica

ClearAll[x, y, n, u]; 
 pde = {Laplacian[u[x, y], {x, y}] + 5*u[x, y] == 0}; 
 bc = {u[x, 0] == Piecewise[{{-1 + x, x > 1 && x < 2}, {3 - x, x > 2 && x < 3}}], u[x, 2] == 0, u[0, y] == 0, u[4, y] == 0}; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], {x, y}], 60*10]]; 
 sol = sol /. K[1] -> n
 

\[ \left \{\left \{u(x,y)\to \frac {1}{2} \sum _{n=1}^{\infty }\frac {128 \left (\cos \left (\frac {n \pi }{8}\right )+\cos \left (\frac {3 n \pi }{8}\right )\right ) \text {csch}\left (\frac {1}{2} \sqrt {n^2 \pi ^2-80}\right ) \sin ^3\left (\frac {n \pi }{8}\right ) \sin \left (\frac {n \pi x}{4}\right ) \sinh \left (\frac {1}{4} \sqrt {n^2 \pi ^2-80} (2-y)\right )}{n^2 \pi ^2}\right \}\right \} \]

Maple

 
x:='x'; y:='y'; u:='u'; 
pde:=diff(u(x,y),x$2)+diff(u(x,y),y$2)+5*u(x,y)=0; 
bc:=u(x,0)=piecewise( x>1 and x<2, 
                      -1+x,x>2 and x<3 , 
                      3-x), 
    u(x,2)=0, 
    u(0,y)=0, 
    u(4,y)=0; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc],u(x,y))),output='realtime'));
 

\[ u \left ( x,y \right ) =\sum _{n=1}^{\infty }32\,{\frac {\sin \left ( 1/4\,n\pi \,x \right ) \left ( 1/2\, \left ( \sin \left ( 1/2\,\pi \,n \right ) -1/2\,\sin \left ( 1/4\,\pi \,n \right ) -1/2\,\sin \left ( 3/4\,\pi \,n \right ) \right ) \sin \left ( 1/2\,\sqrt {-{\pi }^{2}{n}^{2}+80} \right ) \cos \left ( 1/4\,\sqrt {-{\pi }^{2}{n}^{2}+80}y \right ) +\cos \left ( 1/2\,\sqrt {-{\pi }^{2}{n}^{2}+80} \right ) \sin \left ( 1/4\,\pi \,n \right ) \cos \left ( 1/4\,\pi \,n \right ) \sin \left ( 1/4\,\sqrt {-{\pi }^{2}{n}^{2}+80}y \right ) \left ( \cos \left ( 1/4\,\pi \,n \right ) -1 \right ) \right ) }{\sin \left ( 1/2\,\sqrt {-{\pi }^{2}{n}^{2}+80} \right ) {n}^{2}{\pi }^{2}}} \]

____________________________________________________________________________________

17.2 With no boundary conditions specified

problem number 127

Added December 27, 2018.

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

\begin {align*} u_{xx}+u_{yy} + 5 u(x,y) & = 0 \end {align*}

Mathematica

ClearAll[x, y, n, u]; 
 pde = {Laplacian[u[x, y], {x, y}] + 5*u[x, y] == 0}; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[pde, u[x, y], {x, y}], 60*10]];
 

\[ \text {Failed} \] why? It solved earlier with BC?

Maple

 
x:='x'; y:='y'; u:='u'; 
pde:=diff(u(x,y),x$2)+diff(u(x,y),y$2)+5*u(x,y)=0; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve(pde,u(x,y),'build')),output='realtime'));
 

\[ u \left ( x,y \right ) ={\it \_C1}\,{{\rm e}^{\sqrt {{\it \_c}_{{1}}}x}}{\it \_C3}\,\sin \left ( \sqrt {{\it \_c}_{{1}}+5}y \right ) +{\it \_C1}\,{{\rm e}^{\sqrt {{\it \_c}_{{1}}}x}}{\it \_C4}\,\cos \left ( \sqrt {{\it \_c}_{{1}}+5}y \right ) +{\frac {{\it \_C2}\,{\it \_C3}\,\sin \left ( \sqrt {{\it \_c}_{{1}}+5}y \right ) }{{{\rm e}^{\sqrt {{\it \_c}_{{1}}}x}}}}+{\frac {{\it \_C2}\,{\it \_C4}\,\cos \left ( \sqrt {{\it \_c}_{{1}}+5}y \right ) }{{{\rm e}^{\sqrt {{\it \_c}_{{1}}}x}}}} \]