# Heat equation with strange boundary condition

I've attempted a few different solutions to this math methods problem from an old qualifying exam, but I can't seem to hack it. The setup for the problem is that the temperature sand in the Australian outback obeys the usual heat equation, $$\frac{\partial T}{\partial t} = \frac{\kappa}{\rho s} \frac{\partial^2 T}{\partial z^2},$$ where z is the distance into the sand, with the temperature at z=0 given by $$T = T_0 \cos \left[2 \pi \frac{t-t_0}{t_d} \right],$$ where $t_0$ is the hottest time of day, and $t_d$ is the length of the day. We are asked to find how the temperature depends on z and the coolest part of the sand at $t=t_0$.

How is this possible? Don't we need at least two boundary conditions in order to find the solution? Is the best thing to assume the temperature goes to zero at infinity? Also, using separation of variables, one finds $$\frac{1}{T} \frac{\partial T}{\partial t} = \lambda = \text{const}.$$ And so the time dependence should be exponential. How is it that the solution is periodic? Lastly, I tried to use a Green's function solution (which I admittedly am not super confident about), and found that $$T(z,t) = \int_0^t \frac{z~ \cos \left[2 \pi \frac{\tau-t_0}{t_d} \right] }{\sqrt{ (t - \tau)}} \exp \left(\frac{z^2}{4 \alpha (t- \tau)} \right) d\tau.$$ If I set the z derivative of this to zero and solve for $z$, I get the only extremum is at $$z^2 \propto \int_0^t \frac{ \cos \left[2 \pi \frac{\tau-t_0}{t_d} \right] } {\sqrt{4 \pi \alpha (t - \tau)}} \exp \left(\frac{z^2}{4 \alpha (t- \tau)} \right) d\tau \\ \left( \int_0^t \frac{ \cos \left[2 \pi \frac{\tau-t_0}{t_d} \right] }{\sqrt{ (t - \tau)^3}} \exp \left(\frac{z^2}{4 \alpha (t- \tau)} \right) d\tau \right)^{-1} = 0.$$ I assume this is a maximum. This fits with my intuition, but not the instructions. Did I do this correctly?

To recap my specific questions:

• Do we have to assume more boundary conditions to solve the problem?

• How can there be non-exponential time dependence without some source term added to the heat equation?

• Is my Green's function correct?

• The method of Green's functions is for nonhomogeneous differential equations, so I'm wondering how exactly you got to yours? – Wouter Jul 12 '13 at 9:35

With the heat equation : $$\frac{\partial T}{\partial t} = D ~\frac{\partial^2 T}{\partial z^2}$$ You got a kernel : $$K(z,t) = \frac{1}{\sqrt{4\pi Dt}}~ e^{- \large \frac{z^2}{4Dt}}$$ such as :

$$T(z',t') = \int dz K(z'-z,t'-t) T(z,t)~~~~~~~~(0)$$

Noting $T(0,t') = T_0(t')$, we have :

$$T_0(t') = \int dz K(-z,t'-t) T(z,t)~~~~~~~~~~~~~~~~~~~~~~~~~~~~(1)$$

This is true for all $t$, so this is true for $t=0$:

$$T_0(t') = \int dz K(-z,t') T(z,0)~~~~~~~~~~~~~~~~~~~~~~~~~~~~(1')$$

It is simpler to consider $T_0(t')$ and $T(z,t)$ as the real part of complex quantities : $T_0(t') = \mathbb{Re}(\tilde T_0(t')), T(z,t)= \mathbb{Re}(\tilde T(z,t))$

Here, $\tilde T_0(t') = T_0 e^{ 2 i \pi \large \frac{t'-t_0}{t_d}}$, the relation between complex quantities is then :

$$\tilde T_0(t') = \int dz K(-z,t') \tilde T(z,0)~~~~~~~~~~~~~~~~~~~~~~~~~~~~(2)$$

We are now using the identity :

$$\sqrt{\frac{2 \pi}{a}}e^{\large \frac{b^2}{2a}} = \int dz e^{- \large \frac{az^2}{2}+bz}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(3)$$

With $a = \frac{1}{2Dt'}$ and $b = \sqrt{\large \frac{2 i \pi}{D t_d}}$, so that $\frac{b^2}{2a} = \frac{2i \pi t'}{t_d}$, this gives :

$$\sqrt{4 \pi Dt'}e^{\large \frac{2i \pi t'}{t_d}} = \int dz e^{- \large \frac{z^2}{4Dt'}+\sqrt{\large \frac{2 i \pi}{D t_d}}z}~~~~~~~~~~~~~~~~~~~~~~~~~~~(4)$$

From this equation and equation $(2)$, we get :

$$\tilde T(z,0) = T_0 e^{\large \frac{-2i \pi t_0}{t_d}}e^{+ \sqrt{\large \frac{2 i \pi}{D t_d}}z} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~(5)$$

Now one can use the formula :

$$~\tilde T(z',t') = \int dz K(z'-z,t') \tilde T(z,0)~~~~~~~~~~~~~~~~~~~~~~~~(6)$$

This gives, using (4), (5), and some basic algebra :

$$~\tilde T(z',t') = T_0 e^{ 2 i \pi \large \frac{t'-t_0}{t_d}}e^{+ \sqrt{\large \frac{2 i \pi}{D t_d}}z'}~~~~~~~~~~~~~~~~~~~~~~~~(7)$$

The correct square root of $i$ is $-\frac{1+i}{\sqrt{2}}$ in order to have a decreasing exponential in $z$, taking the real part, we get the general expression for $T$, with $z' >0$:

$$~T(z',t') = T_0 ~ \cos( 2 \pi \frac{t'- t_0}{t_d} - \sqrt{ \frac{ \pi}{D t_d}}z')~e^{- \sqrt{\large \frac{\pi}{D t_d}}z'}~~~~~~~~~~~~~~~~~~~~~~~~(8)$$

At $t'=t_0$, we get :

$$~T(z',t_0) = T_0 ~\cos( \sqrt{ \frac{ \pi}{D t_d}}z')~e^{- \sqrt{\large \frac{\pi}{D t_d}}z'}~~~~~~~~~~~~~~~~~~~~~~~~(9)$$

The $z_{min}$ corresponding to the coolest temperature, is simply the first minimum of this function.

• Thanks a lot for the answer. I'm confused about a few of your equations. In $$T(z',t') = \int dz K(z'-z,t'-t)T(z,t)$$, why is there no integration to get rid of the t dependence? – ZachMcDargh Jul 12 '13 at 15:42
• In equation (6), you integrate over $z_0$, but that variable doesn't show up in your integrand. Should it just be $z$? – ZachMcDargh Jul 12 '13 at 15:56
• There was a typo in equation (6). I have edited the answer (Yes, the integration variable is $z$). The equation (0) : $$T(z',t') = \int dz K(z'-z,t'-t)T(z,t)$$ is correct, this is the standard use of the heat Kernel. You may consider $t$ as a initial time $t_0$ where the temperature is supposed to be known.In fact, if $T(z,t_o) =\delta(z)$, you will have $T(z',t') = K(z', t'- t_0)$ . – Trimok Jul 12 '13 at 18:46
• As an exercise, check that the solution (8) verify the heat equation $\frac{\partial T}{\partial t} = D ~\frac{\partial^2 T}{\partial z^2}$ – Trimok Jul 12 '13 at 19:06

I will answer points 1 and 2, and if I have time I'll add in something about the Green's function but I'm not an expert there so I don't know if I'll be much help.

Yes, you do need 2 boundary conditions. We know this because you have a second derivative in your spatial coordinate, so we have to impose 2 boundary conditions on it. Since you have one temporal derivative, we know you need one condition there -- your initial condition.

The trick here is to remember that there are two possible types of boundary conditions. One is specifying the value of the variable, in this case temperature, at the boundary. This is the Dirichlet boundary condition.

The second type is the Neumann boundary condition, where the value of the derivative, or $dT/dz$ is specified.

Your BC at $z_{0}$ is given as your function. So you are using a Dirichlet boundary condition.

Your BC towards the center of the Earth is unknown though. You don't know what T should be there (although you could make an educated guess, it turns out that the temperature of the Earth's crust is relatively constant, which allows things like geo-thermal heating). However, that's not the point here. The idea is that you can apply the Neumann BC and say that the rate of change of temperature at some $z = z_{min}$ is specified.

What should that $z_{min}$ be and what should the rate of change of temperature be there? Well, that's part of what you need to consider and is left as an exercise.

Once you determine the BC's, you'll find an answer to why there is an exponential decay.

• Thanks. All I've been able to think of is that I could say that $\frac{\partial T}{\partial z} = 0$ at some $z_{min}$, or that $\frac{\partial T}{\partial t} = 0$ as $z \rightarrow \infty$. I'm not sure how to implement the former without knowing $z_{min}$. It seems like that just give the standard solutions, with some periodic function in z and an exponential one in t. The latter I don't really understand either, because I don't see how it would jive with separation of variables, though it could work with a $-\exp(z^2/t)$ type solution. – ZachMcDargh Jul 11 '13 at 19:11

You're supposed to sorta guess the answer in your head, and then decide on a second boundary condition based on "what's really going on".

Underspecified problems are common in qualifying exams because they're trying to test your ability to come up with reasonable assumptions about a physical system, and not just your ability to solve differential equations.

What's going on? As each day passes, the top of the sand is very hot, then very cold, then very hot, then very cold. Deeper in the sand, you expect that it should get a bit hotter, then a bit colder, a bit hotter, a bit colder, but it should be partly "insulated" from the extreme temperature variation at the surface. Deeper and deeper you go, the oscillations become weaker.

So what boundary condition do you want? What's going on deep in the earth? Well, for one thing, it's probably not varying over the course of 24 hours! Here are a few scenarios:

(1) $T \rightarrow T_0$ as $z\rightarrow -\infty$. In other words, the oscillations damp down towards the center of the oscillation; deep underground is the average temperature of the top of the sand. The underground flow of heat in this case is periodically towards the surface, then away from the surface, towards, away, but the 24-hour average heat flow anywhere is zero. The only source and sink of heat is the sun and air affecting the surface of the sand.

(2) There is an underground source of heat which continuously sends heat flowing up to the surface. For example, maybe there's a geothermal hot-spot with temperature $T > T_0$. In this case, we still have the oscillations damping down as you go deeper underground, but if you average over the oscillation you do not get a constant-temperature profile ... It gets hotter and hotter as you go down deep in the ground.

(3) There is a cold underground heat-sink, opposite the above.

There's some characteristic depth $L$ underground, such that a depth much smaller than $L$ can feel the daily temperature variations, and a depth much larger than $L$ cannot. If the underground "boundary" (e.g. bottom of the sand pile) is much deeper than $L$, then the solution for (2) or (3) will be the exact same as the solution for (1) plus a constant temperature gradient. (Do you see why? Superposition principle...) This one-parameter family is every possible solution, no matter what the bottom boundary condition is. OTOH, if the underground source or sink is closer to the surface than $L$, a wider variety of temperature profiles can occur. (Do you see why?)

I think an ideal solution to this problem would: (A) Qualitatively discuss what will happen (like an abbreviated version of the above), (B) State the assumption of scenario (1) and then calculate the solution under that assumption. (C) Argue that scenario (1) is reasonable, or discuss the circumstances under which scenario (1) might or might not be reasonable. For example, $L$ had better be much smaller than the thickness of the sand for scenario (1) to be applicable.

Of course you're in a hurry on an exam, but even a few words along these lines of thinking through different scenarios, qualitatively thinking about different possible solutions, will do wonders in getting partial credit and convincing professors that you're a good physicist. And moreover it will help you quantitatively solve the problem, to already have an idea of what the solution should look like.