# How do you solve the heat equation?

Mar 23, 2017

$q = m c \Delta T$
(to remember: q equals m-cat)

#### Explanation:

$q =$ heat energy (Joules)
$m =$ mass (grams)
$c =$ specific heat ($\left(\text{Joules")/("Celsius x grams}\right)$ )
$\Delta T =$change in temperature (Celsius)

specific heat is the amount of heat required to raise the temperature of one gram of substance by one degree Celsius. It is different for every element/compound and is usually given.

$\Delta T = {T}_{\text{final" - T_"initial}}$

Mar 23, 2017

Just in case this was a partial differential equations question instead... the heat equation as I know it is:

$k {\nabla}^{2} u - \frac{\partial u}{\partial t} = 0$ $\text{ "" "" }$ $0 < x < L$, $t > 0$
$u \left(0 , t\right) = u \left(L , t\right) = 0$ $\text{ "" }$ $t > 0$
$u \left(x , 0\right) = f \left(x\right)$ $\text{ "" "" "" }$ $0 < x < L$

where:

• ${\nabla}^{2}$ is the second order derivative in all dimensions considered. Its form depends on what coordinates you are in.
• $k$ is a constant describing the extent of heat conduction.
• $u$ is the function describing the current temperature.
• $\frac{\partial u}{\partial t}$ is the change in temperature over time.
• ${\nabla}^{2} u$ is the change in temperature throughout space.

In one dimension cartesian, it would be:

$\boldsymbol{k \frac{{\partial}^{2} u}{\partial {x}^{2}} - \frac{\partial u}{\partial t} = 0}$

To solve this equation, we would apply separation of variables. Since there is a change in temperature, $\frac{\partial u}{\partial t} \ne 0$. By substituting $u \left(x , t\right) = \phi \left(x\right) G \left(t\right)$, we obtain:

$k \frac{{\partial}^{2} \left(\phi \left(x\right) G \left(t\right)\right)}{\partial {x}^{2}} = \frac{\partial \left(\phi \left(x\right) G \left(t\right)\right)}{\partial t}$

$k G \left(t\right) \frac{{d}^{2} \phi \left(x\right)}{{\mathrm{dx}}^{2}} = \phi \left(x\right) \frac{\mathrm{dG} \left(t\right)}{\mathrm{dt}}$

$\frac{1}{\phi \left(x\right)} \frac{{d}^{2} \phi \left(x\right)}{{\mathrm{dx}}^{2}} = \frac{1}{k G \left(t\right)} \frac{\mathrm{dG} \left(t\right)}{\mathrm{dt}} = - \lambda$

Since the two sides of the equation each depend on only one variabe now, they are each equal to the same constant, known as the "separation constant". We call it $- \lambda$ since $\lambda > 0$ can be shown to yield meaningful answers.

Now we have two ordinary differential equations to solve.

$\frac{1}{\phi \left(x\right)} \frac{{d}^{2} \phi \left(x\right)}{{\mathrm{dx}}^{2}} = - \lambda$

$\frac{1}{k G \left(t\right)} \frac{\mathrm{dG} \left(t\right)}{\mathrm{dt}} = - \lambda$

The first:

$\frac{{d}^{2} \phi \left(x\right)}{{\mathrm{dx}}^{2}} + \lambda \phi = 0$

We assume the solution $\phi = {e}^{r x}$ to get that ${r}^{2} + \lambda = 0$ and thus $r = \pm i \sqrt{\lambda}$ and $\phi = {c}_{1} {e}^{i \sqrt{\lambda}} + {c}_{2} {e}^{- i \sqrt{\lambda}}$. By Euler's formula to get real numbers, we get:

$\textcolor{g r e e n}{\phi \left(x\right) = A \cos \left(\sqrt{\lambda} x\right) + B \sin \left(\sqrt{\lambda} x\right)}$

The second equation gives:

$\frac{\mathrm{dG} \left(t\right)}{\mathrm{dt}} = - \lambda k G$

$\int \frac{1}{G} \mathrm{dG} = - \int \lambda k \mathrm{dt}$

$\ln G \left(t\right) = - \lambda k t + C$

$\textcolor{g r e e n}{G \left(t\right) = A {e}^{- \lambda k t}}$

where $A = {e}^{C}$.

Now that we have two ordinary differential equations solutions, we apply boundary conditions to the space equation to get:

$u \left(0 , t\right) = u \left(L , t\right) = 0$

$\implies \phi \left(0\right) = A \cos \left(\sqrt{\lambda} 0\right) + B \sin \left(\sqrt{\lambda} 0\right) = 0$

Since $\sin \left(0\right) = 0$, to satisfy this condition we must have $A = 0$ so that:

$\phi \left(x\right) = B \sin \left(\sqrt{\lambda} x\right)$

The other boundary condition gives:

$\phi \left(L\right) = B \sin \left(\sqrt{\lambda} L\right) = 0$

To get this, $\sqrt{\lambda} L = n \pi$, so that $\lambda = {\left(\frac{n \pi}{L}\right)}^{2}$. Finally, to satisfy the initial conditions so that $u \left(x , 0\right) = f \left(x\right)$ with no time dependence (the stationary state), we would write a Fourier series as:

$\textcolor{b l u e}{{u}_{n} \left(x , t\right) = {\sum}_{n = 1}^{\infty} {B}_{n} \sin \left(\frac{n \pi x}{L}\right) {e}^{- {\left(\frac{n \pi x}{L}\right)}^{2} k t}}$

where ${B}_{n} = \frac{2}{L} {\int}_{0}^{L} \phi \left(x\right) \sin \left(\frac{n \pi x}{L}\right)$.