____________________________________________________________________________________
Added December 29, 2018.
Solve for \(u(x,t)\) in \[ u_t = k u_{xx} + r u \] with \(k=\frac {1}{10},r=1\) and \(0<x<1\) and \(t>0\). With boundary conditions \begin {align*} u(0,t) &= 0\\ u(1,t) &=0 \end {align*}
And initial conditions \(u(x,0)=1\).
Mathematica ✗
ClearAll[x, t, k, r]; k = 1/10; r = 1; pde = D[u[x, t], t] == k*D[u[x, t], {x, 2}] + r*u[x, t]; bc = {u[0, t] == 0, u[1, t] == 0}; ic = u[x, 0] == 1; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, t], {x, t}], 60*10]];
\[ \text {Failed} \]
Maple ✓
x:='x'; u:='u'; t:='t';k:='k';r:='r'; k:=1/10; r:=1; pde := diff(u(x,t), t) = k*diff(u(x, t), x$2) + r*u(x,t); bc:=u(0,t)=0,u(1,t)=0; ic:=u(x,0) = 1; cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc,ic], u(x,t))),output='realtime'));
\[ u \left ( x,t \right ) =\sum _{n=1}^{\infty }-2\,{\frac { \left ( -1+ \left ( -1 \right ) ^{n} \right ) \sin \left ( n\pi \,x \right ) {{\rm e}^{-1/10\,t \left ( {\pi }^{2}{n}^{2}-10 \right ) }}}{n\pi }} \]
Hand solution
Solution added 4/3/2019.\begin {align*} u_{t} & =ku_{xx}+ru\qquad t>0,0<x<1\\ u\left ( 0,t\right ) & =0\\ u\left ( 1,t\right ) & =0\\ u\left ( x,0\right ) & =1 \end {align*}
Let \(u=ve^{rt}\). Hence \(u_{t}=v_{t}e^{rt}+vre^{rt}\) and \(u_{xx}=v_{xx}e^{rt}\). Hence the PDE becomes \(v_{t}e^{rt}+vre^{rt}=v_{xx}e^{rt}+rve^{rt}\) which simplifies to\begin {align*} v_{t} & =kv_{xx}\qquad t>0,0<x<1\\ v\left ( 0,t\right ) & =0\\ v\left ( 1,t\right ) & =0 \end {align*}
The above is now in canonical form, it is standard heat PDE with homogeneous B.C. This has the solution\[ v\left ( x,t\right ) =\sum _{n=1}^{\infty }B_{n}e^{-n^{2}\pi ^{2}t}\sin \left ( n\pi x\right ) \] Therefore\begin {align*} u & =ve^{rt}\\ u & =\sum _{n=1}^{\infty }B_{n}e^{-t\left ( n^{2}\pi ^{2}-r\right ) }\sin \left ( n\pi x\right ) \end {align*}
At \(t=0\) the above becomes\[ 1=\sum _{n=1}^{\infty }B_{n}\sin \left ( n\pi x\right ) \] Hence \(B_{n}\) are \(\sin \) Fourier coefficient of \(1\) which is \begin {align*} B_{n} & =2\int _{0}^{1}\sin \left ( n\pi x\right ) dx\\ & =2\left ( -\frac {1}{n\pi }\right ) \left ( \cos n\pi x\right ) _{0}^{1}\\ & =\frac {-2}{n\pi }\left ( \left ( -1\right ) ^{n}-1\right ) \end {align*}
Hence the solution becomes\[ u=\sum _{n=1}^{\infty }\frac {-2}{n\pi }\left ( \left ( -1\right ) ^{n}-1\right ) e^{-t\left ( n^{2}\pi ^{2}-r\right ) }\sin \left ( n\pi x\right ) \] But \(r=\frac {1}{10}\), therefore\[ u\left ( x,t\right ) =-\frac {2}{\pi }\sum _{n=1}^{\infty }\frac {\left ( \left ( -1\right ) ^{n}-1\right ) }{n}e^{-t\left ( n^{2}\pi ^{2}-\frac {1}{10}\right ) }\sin \left ( n\pi x\right ) \]
____________________________________________________________________________________
Added December 29, 2018.
Solve for \(u(x,t)\) in \[ u_t = k u_{xx} + r u\left (1- \frac {u}{\alpha } \right ) \]
with \(k=\frac {1}{100},r=\frac {1}{10},\alpha =10\) and \(0<x<1\) and \(t>0\).
With boundary conditions \begin {align*} u(0,t) &= 0\\ u(1,t) &=0 \end {align*}
And initial conditions \(u(x,0)=1\).
Mathematica ✗
ClearAll[x, t, k, r, alpha]; k = 1/100; r = 1/10; alpha = 10; pde = D[u[x, t], t] == k*D[u[x, t], {x, 2}] + r*u[x, t]*(1 - u[x, t]/alpha); bc = {u[0, t] == 0, u[1, t] == 0}; ic = u[x, 0] == 1; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, t], {x, t}], 60*10]];
\[ \text {Failed} \]
Maple ✗
x:='x'; u:='u'; t:='t';k:='k';r:='r'; k := 1/100; r := 1/10; alpha := 10; pde := diff(u(x, t), t)= k*diff(u(x, t),x$2) + r*u(x, t)*(1- u(x,t)/alpha); bc := u(0, t) = 0, u(1, t) = 0; ic := u(x, 0) =1; cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, ic, bc], u(x, t))),output='realtime'));
\[ \text { sol=() } \]
____________________________________________________________________________________
Added December 29, 2018.
Solve for \(u(x,t)\) in \[ u_t = k u_{xx} + \alpha u + \beta u ^2 - \gamma u^3 \]
with \(k=\frac {1}{1000},\alpha =\frac {1}{100},\beta =\frac {1}{100}, \gamma =\frac {5}{1000}\) and \(0<x<1\) and \(t>0\).
With boundary conditions \begin {align*} u(0,t) &= 0\\ u(1,t) &=0 \end {align*}
And initial conditions \(u(x,0)=1\).
Mathematica ✗
ClearAll[x, t, k, alpha, beta, gamma]; k = 1/1000; alpha = 1/10; beta = 1/100; gamma = 5/1000; pde = D[u[x, t], t] == k*D[u[x, t], {x, 2}] + alpha*u[x, t] + beta*u[x, t]^2 - gamma*u[x, t]^3; bc = {u[0, t] == 0, u[1, t] == 0}; ic = u[x, 0] == 1; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, t], {x, t}], 60*10]];
\[ \text {Failed} \]
Maple ✗
x:='x'; u:='u'; t:='t';k:='k'; k := 1/100; alpha:=1/100;beta:=1/1000; g:=5/1000; pde := diff(u(x, t), t)= k*diff(u(x, t),x$2) + alpha*u(x,t)+ beta*u(x,t)^2 - g*u(x,t)^3; bc := u(0, t) = 0, u(1, t) = 0; ic := u(x, 0) =1; cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde, ic, bc], u(x, t))),output='realtime'));
\[ \text { sol=() } \]