heat equation

logistic_guy

Senior Member
Joined
Apr 17, 2024
Messages
2,214
\(\displaystyle \textcolor{indigo}{\bold{Solve.}}\)

\(\displaystyle k\frac{\partial^2 u}{\partial x^2} = \frac{\partial u}{\partial t}, \ \ \ \ \ 0 < x < L, \ \ \ \ t > 0\)


\(\displaystyle u(0,t) = u(L,t) = 0, \ \ \ \ \ t > 0\)

\(\displaystyle u(x,0) = \begin{cases}1, & 0 < x < L/2 \\0, & L/2 < x < L \end{cases}\)
 
🗣️👤

\(\displaystyle u(x,t) = X(x) \ T(t)\)


\(\displaystyle kT\frac{\partial^2 X}{\partial x^2} = X\frac{\partial T}{\partial t}\)


\(\displaystyle \left(\frac{1}{X}\right)\frac{\partial^2 X}{\partial x^2} = \left(\frac{1}{kT}\right)\frac{\partial T}{\partial t} \)
 
\(\displaystyle \left(\frac{1}{X}\right)\frac{\partial^2 X}{\partial x^2} = \left(\frac{1}{kT}\right)\frac{\partial T}{\partial t} \)
\(\displaystyle \left(\frac{1}{X}\right)\frac{\partial^2 X}{\partial x^2} = \left(\frac{1}{kT}\right)\frac{\partial T}{\partial t} = -\lambda\)

This gives two ordinary differential equations.

\(\displaystyle \frac{\partial^2 X}{\partial x^2} + \lambda X = 0\)


\(\displaystyle \frac{\partial T}{\partial t} + \lambda kT = 0\)
 
The first equation is:

\(\displaystyle \frac{\partial^2 X}{\partial x^2} + \lambda X = 0\)

\(\displaystyle X(0) = 0\)
\(\displaystyle X(L) = 0\)

This differential equation has a solution only when \(\displaystyle \lambda > 0\).

Let \(\displaystyle \lambda = \alpha^2\), then

\(\displaystyle X(x) = c_1\cos \alpha x + c_2\sin \alpha x\)
 
The second equation is:

\(\displaystyle \frac{\partial T}{\partial t} + \lambda kT = 0\)

Or

\(\displaystyle \frac{\partial T}{\partial t} + \alpha^2 kT = 0\)

Its solution is:

\(\displaystyle T(t) = c_3e^{-\alpha^2 k t}\)
 
Let us go back to our \(\displaystyle X\) solution.

\(\displaystyle X(x) = c_1\cos \alpha x + c_2\sin \alpha x\)

This solution has two boundary conditions:

\(\displaystyle X(0) = 0\)
\(\displaystyle X(L) = 0\)

Let us apply them and see what we get.

\(\displaystyle X(0) = 0 = c_1\)

Then,

\(\displaystyle X(x) = c_2\sin \alpha x\)

\(\displaystyle X(L) = 0 = c_2\sin \alpha L\)

\(\displaystyle \alpha L = \pi, 2\pi, 3\pi,\cdots\)

Or

\(\displaystyle \alpha L = n\pi, \ \ \ \ \ n = 1,2,3,\cdots\)

Or

\(\displaystyle \alpha = \frac{n\pi}{L}, \ \ \ \ \ n = 1,2,3,\cdots\)

Then,

\(\displaystyle X(x) = \textcolor{indigo}{c_2\sin \frac{n\pi x}{L}}\)
 
Our solution so far.

\(\displaystyle u(x,t) = X(x) \ T(t) = c_2\sin \frac{n\pi x}{L}c_3e^{-\frac{n^2\pi^2}{L^2}kt}\)

Or

\(\displaystyle u_n(x,t) = A_n\sin \frac{n\pi x}{L}e^{-\frac{n^2\pi^2}{L^2}kt}\)

Or

\(\displaystyle u(x,t) = \sum_{n=1}^{\infty}A_n\sin \alpha_nx \ e^{-\alpha^2_nkt}\)


where \(\displaystyle \alpha_n = \frac{n\pi}{L}\)
 
Let us apply the initial condition.

\(\displaystyle u(x,0) = \sum_{n=1}^{\infty}A_n\sin \alpha_nx\)


\(\displaystyle u(x,0)\sin \alpha_mx = \sum_{n=1}^{\infty}A_n\sin \alpha_nx\sin \alpha_mx\)


\(\displaystyle \int_{0}^{L}u(x,0)\sin \alpha_mx \ dx = \sum_{n=1}^{\infty}A_n\int_{0}^{L}\sin \alpha_nx\sin \alpha_mx \ dx\)



\(\displaystyle \int_{0}^{L/2}\sin \alpha_mx \ dx = A_m\int_{0}^{L}\sin^2 \alpha_mx \ dx\)



\(\displaystyle \frac{1 - \cos\left(\frac{L}{2}\alpha_m\right)}{\alpha_m} = A_m\frac{2L\alpha_m - \sin\left(2L\alpha_m\right)}{4\alpha_m}\)



\(\displaystyle A_m = \frac{4\left[1 - \cos\left(\frac{L}{2}\alpha_m\right)\right]}{2L\alpha_m - \sin\left(2L\alpha_m\right)} = \frac{4\left[1 - \cos\left(\frac{1}{2}m\pi\right)\right]}{2m\pi - \sin\left(2m\pi\right)} = \frac{2\left[1 - \cos\left(\frac{1}{2}m\pi\right)\right]}{m\pi}\)
 
The final solution is:

\(\displaystyle u(x,t) = \sum_{n=1}^{\infty}A_n\sin \alpha_nx \ e^{-\alpha^2_nkt}\)


where \(\displaystyle \alpha_n = \frac{n\pi}{L}\)

And

\(\displaystyle A_n = \frac{2\left[1 - \cos\left(\frac{1}{2}n\pi\right)\right]}{n\pi}\)
 
Top