8 Heat PDE in rectangle

8.1 No source
8.2 Internal source term
8.3 Articolo 6.6.3

____________________________________________________________________________________

8.1 No source

problem number 81

Taken from Maple help pages on PDE. Solve the heat equation for \(u(x,y,t)\) \[ u_t= \frac {1}{10} \nabla ^2 u(x,y) \] For \(0<x<1\) and \(0<y<1\) and \(t>0\). The boundary conditions are \begin {align*} u(0,y,t) &= 0 \\ u(1,y,t) &= 0 \\ u(x,0,t) &= 0 \\ u(x,1,t) &= 0 \end {align*}

Initial condition is \(u(x,y,0)=x(1-x)(1-y)y\).

Mathematica

ClearAll[x, y, t]; 
 pde = D[u[x, y, t], t] == (1*(D[u[x, y, t], {x, 2}] + D[u[x, y, t], {y, 2}]))/10; 
 ic = u[x, y, 0] == x*(1 - x)*(1 - y)*y; 
 bc = {u[0, y, t] == 0, u[1, y, t] == 0, u[x, 0, t] == 0, u[x, 1, t] == 0}; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[x, y, t], {x, y, t}], 60*10]];
 

\[ \text {Failed} \]

Maple

 
x:='x'; u:='u'; t:='t'; y:='y'; 
pde  := diff(u(x, y, t), t) = 1/10*(diff(u(x, y, t), x$2)+diff(u(x, y, t), y$2)); 
bc := u(0, y, t) = 0, u(1, y, t) = 0, u(x, 0, t) = 0, u(x, 1, t) = 0; 
ic:=u(x, y, 0) = x*(1-x)*(1-y)*y; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,ic,bc],u(x,y,t))),output='realtime'));
 

\[ u \left ( x,y,t \right ) =\sum _{{\it n1}=1}^{\infty } \left ( \sum _{n=1}^{\infty }-16\,{\frac { \left ( - \left ( -1 \right ) ^{{\it n1}+n}+ \left ( -1 \right ) ^{n}+ \left ( -1 \right ) ^{{\it n1}}-1 \right ) \sin \left ( n\pi \,x \right ) \sin \left ( {\it n1}\,\pi \,y \right ) {{\rm e}^{-1/10\,{\pi }^{2}t \left ( {n}^{2}+{{\it n1}}^{2} \right ) }}}{{n}^{3}{\pi }^{6}{{\it n1}}^{3}}} \right ) \]

____________________________________________________________________________________

8.2 Internal source term

problem number 82

Taken from Maple help pages on PDE

Solve the heat equation for \(u(x,y,t)\) \[ \frac { \partial u}{\partial t}= 1/10 \left ( \frac { \partial ^2 u}{\partial x^2} + \frac { \partial ^2 u}{\partial y^2} \right ) -\frac {1}{5} u(x,y,t); \] For \(0<x<1\) and \(0<y<1\) and \(t>0\). The boundary conditions are \begin {align*} \frac {\partial u}{\partial x} u(0,y,t) &= 0 \\ u(1,y,t) &= 0 \\ u(x,0,t) &= 0 \\ \frac {\partial u}{\partial y} u(x,1,t) &= 0 \\ \end {align*}

Initial condition is \(u(x,y,0)=(1-x^2)(1- \frac {1}{2} y) y\).

Mathematica

ClearAll[x, y, t]; 
 pde = D[u[x, y, t], t] == (1*(D[u[x, y, t], {x, 2}] + D[u[x, y, t], {y, 2}]))/10 - (1*u[x, y, t])/5; 
 ic = u[x, y, 0] == (-x^2 + 1)*(1 - (1/2)*y)*y; 
 bc = {Derivative[1, 0, 0][u][0, y, t] == 0, u[1, y, t] == 0, u[x, 0, t] == 0, Derivative[0, 1, 0][u][x, 1, t] == 0}; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[x, y, t], {x, y, t}], 60*10]];
 

\[ \text {Failed} \]

Maple

 
x:='x'; u:='u'; t:='t'; y:='y'; 
pde  := diff(u(x, y, t), t) = 1/10*(diff(u(x, y, t), x$2) 
                              +diff(u(x, y, t), y$2)) - 1/5 * u(x,y,t); 
ic:= u(x, y, 0) = (-x^2+1)*(1-(1/2)*y)*y; 
bc := (D[1](u))(0, y, t) = 0, 
       u(1, y, t) = 0, 
       u(x, 0, t) = 0, 
       (D[2](u))(x, 1, t) = 0; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, ic,bc], u(x, y, t))),output='realtime'));
 

\[ u \left ( x,y,t \right ) =\sum _{{\it n1}=0}^{\infty } \left ( \sum _{n=0}^{\infty }512\,{\frac { \left ( -1 \right ) ^{n}{{\rm e}^{-1/10\,t \left ( 2+ \left ( {n}^{2}+{{\it n1}}^{2}+n+{\it n1}+1/2 \right ) {\pi }^{2} \right ) }}\sin \left ( 1/2\, \left ( 1+2\,{\it n1} \right ) \pi \,y \right ) \cos \left ( 1/2\, \left ( 1+2\,n \right ) \pi \,x \right ) }{{\pi }^{6} \left ( 1+2\,n \right ) ^{3} \left ( 1+2\,{\it n1} \right ) ^{3}}} \right ) \]

____________________________________________________________________________________

8.3 Articolo 6.6.3

problem number 83

Added December 20, 2018.

Example 6.6.3 from Partial differential equations and boundary value problems with Maple/George A. Articolo, 2nd ed :

We seek the temperature distribution in a thin rectangular plate over the finite two-dimensional domain \(D = {(x, y) \text {s.t.} 0<x<1, 0<y<1}\). The lateral surfaces of the plate are insulated. The boundaries \(y = 0\) and \(y = 1\) are fixed at temperature \(0\), the boundary \(x = 0\) is insulated, and the boundary \(x = 1\) is losing heat by convection into a surrounding medium at temperature \(0\). The initial temperature distribution f(x, y) is \[ u(x,y,0) = \left (1- \frac {x^2}{3} \right ) y(1-y) \] The thermal diffusivity is \(k = \frac {1}{50}\). Solve for \(u(x,y,t)\) the heat PDE \[ \frac { \partial u}{\partial t}= k \left ( \frac { \partial ^2 u}{\partial x^2} +\frac { \partial ^2 u}{\partial y^2} \right ) \] With \(0<x<1,0<y<1\) and \(t>0\). Boundary conditions are \begin {align*} \frac {\partial u}{\partial x}(0,y,t) &= 0 \\ \frac {\partial u}{\partial x}(1,y,t) + u(1,y,t) &= 0 \\ u(x,0,t) &= 0\\ u(x,1,t) &=0 \end {align*}

Mathematica

ClearAll[x, y, t, k]; 
 k = 1/50; 
 pde = D[u[x, y, t], t] == k*(D[u[x, y, t], {x, 2}] + D[u[x, y, t], {y, 2}]); 
 bc = {Derivative[1, 0, 0][u][0, y, t] == 0, Derivative[1, 0, 0][u][1, y, t] + u[1, y, t] == 0, u[x, 0, t] == 0, u[x, 1, t] == 0}; 
 ic = u[x, y, 0] == (1 - (1/3)*x^2)*y*(1 - y); 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, y, t], {x, y, t}], 60*10]];
 

\[ \text {Failed} \]

Maple

 
x:='x'; u:='u'; y:='y'; t:='t';k:='k'; 
k:=1/50; 
pde := diff(u(x, y, t), t) = k*(diff(u(x, y, t), x$2)+diff(u(x, y, t), y$2)); 
bc_left_edge:=eval( diff(u(x,y,t),x),x=0)=0; 
bc_right_edge:= eval( diff(u(x,y,t),x),x=1)+u(1,y,t)=0; 
bc_bottom_edge:=u(x,0,t)=0; 
bc_top_edge:=u(x,1,t)=0; 
bc:=bc_left_edge,bc_right_edge,bc_bottom_edge,bc_top_edge; 
ic:=u(x, y, 0) = (1-(1/3)*x^2)*y*(1-y); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc,ic], u(x, y, t)) assuming 0 <= x, x <= 1, 0 <= y, y <= 1),output='realtime'));
 

\[ u \left ( x,y,t \right ) =\mbox {{\tt casesplit/ans}} \left ( \sum _{n=1}^{\infty } \left ( \sum _{{\it n1}=0}^{\infty }{\frac {32\,{{\rm e}^{-{\frac {1}{50}}\,t \left ( {\pi }^{2}{n}^{2}+{\lambda _{{{\it n1}}}}^{2} \right ) }} \left ( -1+ \left ( -1 \right ) ^{n} \right ) \cos \left ( \lambda _{{{\it n1}}}x \right ) \sin \left ( n\pi \,y \right ) \left ( -{\lambda _{{{\it n1}}}}^{2}\sin \left ( \lambda _{{{\it n1}}} \right ) +\lambda _{{{\it n1}}}\cos \left ( \lambda _{{{\it n1}}} \right ) -\sin \left ( \lambda _{{{\it n1}}} \right ) \right ) }{3\,{\pi }^{3}{n}^{3}{\lambda _{{{\it n1}}}}^{2} \left ( \sin \left ( 2\,\lambda _{{{\it n1}}} \right ) +2\,\lambda _{{{\it n1}}} \right ) }} \right ) , \left \{ {\it And} \left ( \tan \left ( \lambda _{{{\it n1}}} \right ) \lambda _{{{\it n1}}}-1=0,0<\lambda _{{{\it n1}}} \right ) \right \} \right ) \]