heat equation - New

logistic_guy

Senior Member
Joined
Apr 17, 2024
Messages
1,526
Solve the heat equation k2ux2=ut,   0<x<L,   t>0  \displaystyle k\frac{\partial^2 u}{\partial x^2} = \frac{\partial u}{\partial t}, \ \ \ 0 < x < L, \ \ \ t > 0 \ \ subject to the given conditions. Assume a rod of length L\displaystyle L.


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

u(x,0)={1   0<x<L/20   L/2<x<L\displaystyle u(x,0) =\begin{cases}1 & \ \ \ 0 <x<L/2\\0 & \ \ \ L/2 < x < L\end{cases}
 
Let us try to solve this partial differential equation by separation of variables.

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

Then,

kT2Xx2=XTt\displaystyle kT\frac{\partial^2 X}{\partial x^2} = X\frac{\partial T}{\partial t}


1X2Xx2=1kTTt\displaystyle \frac{1}{X}\frac{\partial^2 X}{\partial x^2} = \frac{1}{kT}\frac{\partial T}{\partial t}


1X2Xx2=1kTTt=λ\displaystyle \frac{1}{X}\frac{\partial^2 X}{\partial x^2} = \frac{1}{kT}\frac{\partial T}{\partial t} = -\lambda

This will give us two ordinary differential equations:

2Xx2+λX=0\displaystyle \frac{\partial^2 X}{\partial x^2} +\lambda X = 0

Tt+λkT=0\displaystyle \frac{\partial T}{\partial t} + \lambda kT = 0

Or

d2Xdx2+λX=0\displaystyle \frac{d^2 X}{dx^2} +\lambda X = 0

dTdt+λkT=0\displaystyle \frac{d T}{dt} + \lambda kT = 0

We will continue in the next post!

💪👹
 
Experience tells us that when we have Dirichlet Boundary Conditions, we will get a non trivial solution only when λ>0\displaystyle \lambda > 0.

Let λ=μ2\displaystyle \lambda = \mu^2.

Then,

d2Xdx2+μ2X=0\displaystyle \frac{d^2 X}{dx^2} +\mu^2 X = 0

This is an elementary differential equation and its solution is:

X(x)=Acosμx+Bsinμx\displaystyle X(x) = A\cos \mu x + B\sin \mu x

Apply the first boundary condition.

0=A+0\displaystyle 0 = A + 0

So, the solution becomes:

X(x)=Bsinμx\displaystyle X(x) = B\sin \mu x

Apply the second boundary condition.

0=BsinμL\displaystyle 0 = B\sin \mu L

It's either B=0\displaystyle B = 0 or sinμL=0\displaystyle \sin \mu L = 0. If B=0\displaystyle B = 0, we will get the trivial solution X(x)=0\displaystyle X(x) = 0, so it must be sinμL=0\displaystyle \sin \mu L = 0.

Then,

μL=π,2π,3π,\displaystyle \mu L = \pi, 2\pi, 3\pi, \cdots

Or

μL=nπ\displaystyle \mu L = n\pi, where n=1,2,3,\displaystyle n = 1,2,3,\cdots

Or

μ=nπL\displaystyle \mu = \frac{n\pi}{L}

And the solution becomes:

Xn(x)=BsinnπLx\displaystyle X_n(x) = B\sin \frac{n\pi}{L} x

💪🤢
 
Back to the second equation.

dTdt+λkT=0\displaystyle \frac{d T}{dt} + \lambda kT = 0

This is also an elementary differential equation and it has the solution:

T(t)=Ceλkt\displaystyle T(t) = Ce^{-\lambda k t}
 
un(x,t)=Xn(x) Tn(t)=DsinnπLx en2π2L2kt\displaystyle u_n(x,t) = X_n(x) \ T_n(t) = D\sin \frac{n\pi}{L} x \ e^{-\frac{n^2\pi^2}{L^2} k t}

where D=BC\displaystyle D = BC and λ=μ2=n2π2L2\displaystyle \lambda = \mu^2 = \frac{n^2\pi^2}{L^2}
 
The solution can be written in a different form.

u(x,t)=n=1DnsinnπLx en2π2L2kt\displaystyle u(x,t) = \sum_{n = 1}^{\infty}D_n\sin \frac{n\pi}{L} x \ e^{-\frac{n^2\pi^2}{L^2} k t}
 
It's time to find the coefficient Dn\displaystyle D_n.

We will apply the initial condition.

u(x,0)=n=1DnsinnπLx\displaystyle u(x,0) = \sum_{n = 1}^{\infty}D_n\sin \frac{n\pi}{L} x

u(x,0)sinnπLx=n=1Dnsin2nπLx\displaystyle u(x,0)\sin \frac{n\pi}{L} x = \sum_{n = 1}^{\infty}D_n\sin^2 \frac{n\pi}{L} x

0Lu(x,0)sinnπLx dx=n=1Dn0Lsin2nπLx dx\displaystyle \int_{0}^{L} u(x,0)\sin \frac{n\pi}{L} x \ dx = \sum_{n = 1}^{\infty}D_n \int_{0}^{L}\sin^2 \frac{n\pi}{L} x \ dx

0L/2u(x,0)sinnπLx dx+L/2Lu(x,0)sinnπLx dx=n=1Dn0Lsin2nπLx dx\displaystyle \int_{0}^{L/2} u(x,0)\sin \frac{n\pi}{L} x \ dx + \int_{L/2}^{L} u(x,0)\sin \frac{n\pi}{L} x \ dx = \sum_{n = 1}^{\infty}D_n \int_{0}^{L}\sin^2 \frac{n\pi}{L} x \ dx

0L/2sinnπLx dx+0=n=1Dn L2\displaystyle \int_{0}^{L/2} \sin \frac{n\pi}{L} x \ dx + 0 = \sum_{n = 1}^{\infty}D_n \ \frac{L}{2}

Lπn(1cosnπ2)=n=1Dn L2\displaystyle \frac{L}{\pi n}\left(1 - \cos \frac{n\pi}{2}\right) = \sum_{n = 1}^{\infty}D_n \ \frac{L}{2}

This gives:

Dn=2πn(1cosnπ2)\displaystyle D_n = \frac{2}{\pi n}\left(1 - \cos \frac{n\pi}{2}\right)

Then, the final solution is:

u(x,t)=2πn=11n(1cosnπ2)sinnπLx en2π2L2kt\displaystyle u(x,t) = \frac{2}{\pi}\sum_{n = 1}^{\infty}\frac{1}{n}\left(1 - \cos \frac{n\pi}{2}\right)\sin \frac{n\pi}{L} x \ e^{-\frac{n^2\pi^2}{L^2} k t}
 
Top