Analytical solution of heat equation with non-homogenous boundary conditions

159 Views Asked by At

I am trying to get analytical solution of heat equation with non-homogenous boundary conditions, which i can code in MATLAB and compare with my numerical results.

In short, i am unable to reach the correct analytical solution. Can someone help me with this. Here is the equation with BCs:

$\frac{\partial{u(x,t)}}{\partial{t}} = \alpha\frac{\partial^2{u(x,t)}}{\partial{x^2}}$ $\qquad$ (where $0<x<L$ and $t>0$)

where $\alpha$ is the thermal diffusivity.

IC: $u(x,0)= f(x)$

BC1: $u(0,t)= a(t)$

BC2: $u(L,t)= b(t)$

Thanks in advance.

2

There are 2 best solutions below

2
On

$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

$\ds{\left.\partiald{\mrm{u}\pars{x,t}}{t} = \alpha\,\partiald[2]{\mrm{u}\pars{x,t}}{x} \right\vert_{\ {\Large x\ \in\ \pars{0,L}} \atop\ {\Large t\ \in\ \pars{0,\infty}}}.\qquad}$ $\ds{\left\{\begin{array}{rcl} \ds{\mrm{u}\pars{x,0}} & \ds{\equiv} & \ds{\mrm{f}\pars{x}} \\ \ds{\mrm{u}\pars{0,t}} & \ds{\equiv} & \ds{\mrm{a}\pars{t}} \\ \ds{\mrm{u}\pars{L,t}} & \ds{\equiv} & \ds{\mrm{b}\pars{t}} \end{array}\right.}$

\begin{equation} \mbox{Lets}\ \mrm{u}\pars{x,t} \equiv \mrm{a}\pars{t} + \bracks{\mrm{b}\pars{t} - \mrm{a}\pars{t}}{x \over L} + \mrm{U}\pars{x,t} \end{equation} such that \begin{align} &\partiald{\mrm{U}\pars{x,t}}{t} - \alpha\,\partiald[2]{\mrm{U}\pars{x,t}}{x} = -\dot{\mrm{a}}\pars{t} - \bracks{\dot{\mrm{b}}\pars{t} - \dot{\mrm{a}}\pars{t}}{x \over L} \\[5mm] &\ \mrm{U}\pars{x,0} \equiv \mrm{f}\pars{x} - \mrm{a}\pars{0} - \bracks{\mrm{b}\pars{0} - \mrm{a}\pars{0}}{x \over L} \equiv \,\mrm{F}\pars{x} \label{1}\tag{1} \\[5mm] &\ \ds{\left\{\begin{array}{rcl} \ds{\mrm{U}\pars{0,t}} & \ds{\equiv} & \ds{0} \\ \ds{\mrm{U}\pars{L,t}} & \ds{\equiv} & \ds{0} \end{array}\right.} \end{align}


Then, $\ds{\mrm{U}\pars{x,t} = \sum_{n =1}^{\infty}\mrm{A}_{n}\pars{t} \sin\pars{{n\pi \over L}x}}$ which leads to \begin{align} \sum_{m =1}^{\infty}\bracks{\dot{\mrm{A}}_{m}\pars{t} + {m^{2} \over L^{2}}\mrm{A}_{m}\pars{t}}\sin\pars{{m\pi \over L}x} = -\dot{\mrm{a}}\pars{t} - \bracks{\dot{\mrm{b}}\pars{t} - \dot{\mrm{a}}\pars{t}}{x \over L} \end{align}

Multiply both sides by $\ds{\sin\pars{n\pi x/L}}$ and integrate over $\ds{\pars{0,L}}$:

\begin{align} &\dot{\mrm{A}}_{n}\pars{t} + {n^{2} \over L^{2}}\mrm{A}_{n}\pars{t} = 2\,{\pars{-1}^{n}\,\dot{\mrm{b}}\pars{t} - \dot{\mrm{a}}\pars{t} \over n\pi} \\[5mm] &\ \totald{\bracks{\mrm{A}_{n}\pars{t}\exp\pars{n^{2}t/L^{2}}}}{t} = 2\,{\pars{-1}^{n}\,\dot{\mrm{b}}\pars{t} - \dot{\mrm{a}}\pars{t} \over n\pi}\,\exp\pars{{n^{2} \over L^{2}}\,t} \\[1cm] &\ \mrm{A}_{n}\pars{t}\exp\pars{{n^{2} \over L^{2}}\,t} - \mrm{A}_{n}\pars{0} \\[2mm] = &\ {2 \over n\pi} \int_{0}^{t}\bracks{\pars{-1}^{n}\dot{\mrm{b}}\pars{\tau} - \dot{\mrm{a}}\pars{\tau} \exp\pars{{n^{2} \over L^{2}}\,\tau}}\dd\tau \label{2}\tag{2} \end{align}

\eqref{2} determines $\ds{\mrm{A}_{n}\pars{t}}$ in terms of $\ds{\mrm{A}_{n}\pars{0}}$ which can be later find with \eqref{1}.

I hope you work out some details !!!.

0
On

Thanks for the clarification. Here is the answer in terms of Fourier series.

$u(x,t) = a(t) + [b(t)-a(t)]\frac{x}{L} + \sum_{n=1}^{\infty} [\tilde{\phi_{n}} {e^{-\alpha(\frac{n\pi}{L})^2t} + \int_{0}^{t}} e^{{\alpha}(\frac{n\pi}{L})^2(\tau -t)}\tilde{f}{_{n}(\tau)d\tau}]sin\frac{n\pi x}{L}$

where; $\tilde{\phi}_{n} = \frac{2}{L}\int_{0}^{L}\tilde{\phi(x)}sin\frac{n\pi x}{L}dx$

and; $\tilde{f_{n}(t)} = \frac{2}{L}\int_{0}^{L}\tilde{f}(x,t)sin\frac{n\pi x}{L}dx$

also; $\tilde{\phi(x)} = f(x)-(1-\frac{x}{L})a(0) - \frac{x}{L}b(0)$

and; $\tilde{f}(x,t) = -(1-\frac{x}{L})\dot{a}(t) - \frac{x}{L}\dot{b}(t)$

BR.