I have solved a PDE in this from numerically on Mathematica, but does anyone know if there is a way to solve the following PDE analytically, an analytical solution would really help me. This is an adapted heat equation accounting for lateral heat loss in a rod of length $0.2$ ${m}$:
$$u_{t} =\alpha u_{xx}-\kappa(u-T_{0})$$
Where:
$\alpha=1.12*10^{-4}$$m^2 s^{-1}$
$\kappa=2.61*10^{-4}$$s^{-1}$
$T_{0}=17$ C
With boundary conditions:
$$u_{x}(0,t) =0$$ $$u_{x}(0.2,t) =0$$
And initial condition:
$$u(x,0)=\begin{cases} 35.6236 + 0.161087e^{59.9842x},0<x<0.1 \\ 35.6236 + 0.161087e^{59.9842 (-x + 0.2)},0.1<x< 0.2 \\ \end{cases} $$
Any help will be much appreciated. Thanks in advanced.
The functions $\{ \cos(n\pi x/L) \}_{n=0}^{\infty}$ form a commplete orthogonal set of functions on $[0,L]$. So you can expand $$ u(x,t) = \sum_{n=0}^{\infty}c_{n}(t)\cos(n\pi x/L). $$ In order to solve the equation, plug this form into the equation and solve for the coefficient functions $c_{n}(t)$: $$ \sum_{n=0}^{\infty}\{c_{n}'(t)+\alpha n^{2}\pi^{2}/L^{2}c_{n}(t)+\kappa c_{n}(t)\}\cos(n\pi x/L)= \kappa T_{0} $$ The right side is a series in the $\cos$ terms where only the coefficient of the constant term is non-zero. Therefore, \begin{align} c_{0}'(t)+\kappa c_{0}(t) & =\kappa T_{0},\\ c_{n}'(t)+(\alpha n^{2}\pi^{2}/L^{2}+\kappa)c_{n}(t) & =0,\;\; n > 0. \end{align} The solutions of these equations involve an initial constant $c_{n}(0)=C_{n}$. For $n=0$: $$ (e^{\kappa t}c_{0}(t))'=(e^{\kappa t} T_{0})' \\ e^{\kappa t}c_{0}(t)-C_{0} = T_{0}(e^{\kappa t}-1) \\ c_{0}(t) = C_{0}e^{-\kappa t}+ T_{0}(1-e^{-\kappa t}). $$ For $n > 0$, $$ c_{n}(t) = C_{n}e^{-(\alpha n^{2}\pi^{2}/L^{2}+\kappa)t} $$ The last condition to be satisfied is the initial condition $u(x,0)=f(x)$, which becomes $$ f(x) = \sum_{n=0}^{\infty}C_{n}\cos(n\pi x/L). $$ Hence, using the orthogonality of the $\cos$ terms, $$ \int_{0}^{L}f(x)\cos(m\pi x/L)dx = C_{m}\int_{0}^{L}\cos^{2}(m\pi x/L)dx. $$ Note that $\int_{0}^{L}\cos^{2}(m\pi x/L)dx=L/2$ for $m \ge 1$ and $L$ for $m=0$. The final solution: $$ u(x,t) = \sum_{n=1}^{\infty}\left(\frac{2}{L}\int_{0}^{L}f(x)\cos(n\pi x/L)dx\right) e^{-(\alpha n^{2}\pi^{2}/L^{2}+\kappa)t}\cos(n\pi x/L) \\ + \left(\frac{1}{L}\int_{0}^{L}f(x)dx\right)e^{-\kappa t}+ T_{0}(1-e^{-\kappa t}). $$ Check everything. I'm good at errors. :)