# PDE: Sphere put into a bath

1. Nov 14, 2012

### fluidistic

1. The problem statement, all variables and given/known data
A sphere of radius R at temperature T=0 is put into a bath at time t=0 whose temperature is $T_0$.
Calculate the temperature inside the sphere $\forall t \geq 0$, $T(\vec x ,t )$.

2. Relevant equations
Heat equation: $$\frac{\partial T }{\partial t} \cdot \frac{1}{\kappa} -\triangle T =0$$

3. The attempt at a solution
I will use separation of variables as well as making the assumption that due to the symmetry of the problem, T will only depend on r and t and not on theta and phi (I'm talking about spherical coordinates).
Thus $T(\vec x , t ) = T(r,t)=\tau (t) R(r)$.
Plugging this back into the PDE and taking the Laplacian in spherical coordinates, the PDE reduces to 2 ODE's, namely $$\begin{cases} \frac{1}{\kappa } \frac{\tau '}{\tau } =-C \\ \frac{2R'}{rR} + \frac{R''}{R}=-C \end{cases}$$ where C is a constant.
I solved the first ODE, the solution is $\tau (t)=Ae^{-\kappa C t}$.
I rewrote the second ODE into the form $R''+\frac{2R'}{r}+CR=0$. To solve this DE I tried the Frobenius's method. Namely $R(r)=\sum _{n=0}^ \infty a_n r^{n+\mu}$. The secular equation gave me $\mu =-1$ or $\mu =0$. Since they differ by an integer I can only get one solution using this method and I'll have to use variation of parameters to get the linearly independent other solution.
So I have to take the lowest mu value, namely -1 here.
I reached that $a_0$ is arbitrary as well as $a_1$ but $a_0$ cannot be 0. Furthermore I obtained the following recurrence relation: $a_n=\frac{-Ca_{n-2}}{n^2-n}$, $\forall n \geq 2$.
Choosing $a_0=1$ and $a_1=0$, I sought to obtain the general form of $a_n$. But I was not successful.
I reached that $\forall n \geq 1$, $$a_n =\begin{cases} 0 \text{ if n is odd} \\ \frac{ (-1)^{n/2}C^{n/2}}{(n^2-n)[(n-2)^2-(n-2)]...(2^2-2)} \text{ if n is even} \end{cases}$$.
I'm basically stuck at rewriting the denominator of $a_n$ when n is even. Can somebody help me?
This looks pretty awful!

2. Nov 14, 2012

### dextercioby

How did you implement the 2 boundary conditions, i.e. T(R,t) = T_0 and T(r,t_0) = 0 ?

3. Nov 14, 2012

### fluidistic

I did not touch the boundary conditions yet, I'm looking for the general solution first and then I'll use the boundary condition+the initial condition.
I think they should be T(R,t)=T_0 and T(r<R,0)=0.

Edit: Hmm I think I see what you mean. My solution for the $\tau (t)$ does not seem to make any sense, right?
So basically the method of separation of variables fails here?

4. Nov 14, 2012

### dextercioby

Can you make a change of variable in your ODE, i./o. going to Frobenius ? Try u(r) = r R(r).

5. Nov 14, 2012

### fluidistic

Ok thanks a lot. I will try this suggestion. By the way what does i./o. mean? :)

6. Nov 14, 2012

### dextercioby

It should probably be i/o, a web shortage for "instead of", just like irrep stands for "irreducible representation".

7. Nov 14, 2012

### fluidistic

Ah ok!
Well that's brillant, I get the ODE $u''+Cu=0$. At first glance C will have to be negative, I'm going to proceed further in a few... I must leave for now.

8. Nov 16, 2012

### fluidistic

If I call $C=-k^2$ the solution reduces to $R(r)= \begin{cases} c_1 \frac{e^{kr}}{r}+ c_2 \frac{e^{-kr}}{r} \text{ for when } k \in \mathbb{R} \\ c_1 \frac{\cos (k_cr)}{r} + c_2 \frac{\sin (k_cr )}{r} \text { if k } \in \mathbb{C} \\ c_1+\frac{c_2}{r} \text{ if k =0} \end{cases}$ where $k_c$ stands for the imaginary part of k.
Now of course I must dicard 2 of these solutions and find the constant(s) c1 and c2. Apparently k cannot be real because both c1 and c2 must be 0 to keep a finite solution at the origin.
If k is complex, then c1 must be worth 0. I think $R(r)=c_2 \frac{\sin (k_cr )}{r}$ could be possible.
I think I can safely discard the case k=0 because c2 would have to be worth 0 and by intuition the dependence of R(r) must not be a constant.
So I don't really know how to write the answer. I think it's $R(r)=\frac{c_2 \sin ( k_c r)}{r}$ but I don't know how to deal with $k_c$, it's not necessarily worth $\sqrt C$. I'm not very confident of what I've done so far... what do you think?

9. Nov 16, 2012

### haruspex

Not sure why you think C should be negative. Indeed, I'd be surprised if your k could have a real part, so I would expect an answer c sin(r√C)/r.

10. Nov 16, 2012

### fluidistic

Sorry for my post 7, I was wrong. C indeed seems positive because an answer of the form c sin(r√C)/r assumes C is positive, for this solution is valid when k is a complex number and if it's purely imaginary then k^2 is a negative real number and thus C is positive.
So far I've reached the general form of the solution. It's $T(r,t)=Ae^{-\kappa C t} c_1 \frac{\sin (r \sqrt C) }{r}=\frac{c_2e^{-\kappa Ct}\sin (r \sqrt C)}{r}$.
So I have 2 unknowns (C and c2) and 1 boundary +1 initial condition.
But my problem is the following:
$T(R,t)=T_0 \Rightarrow c_2=\frac{RT_0}{\sin (R \sqrt C )}$. Okay so far.
But the initial condition gives me troubles: $T(r,0)=0 \Rightarrow \frac{c_2 \sin (r \sqrt C )}{r}=0 \Rightarrow c_2=0$ (that I discard) or $\sin (r \sqrt C )=0$. So that $r\sqrt C =n \pi$ with $n \in \mathbb{N}$. This makes C not a constant anymore but a variable that depends on r...
Sigh. I really don't know what's wrong.

Edit: I've just checked out and $R(r)=\frac{c_2 \sin (\sqrt C r ) }{r}$ does satisfies the ODE R''+(2/r)R'+CR=0, which is a good sign.

Edit 2: When I take the limit when r tends to 0 (when I go to the center of the sphere), I get $T(0,t)=\sqrt C c_2 e^{-\kappa Ct}$ which basically shows that it cools down (instead of heating up!!!) with time and at t=0 is worth $\sqrt C c_2$ which must equal 0 by the initial condition. So something is very wrong, but I don't see what's wrong.

Last edited: Nov 16, 2012
11. Nov 16, 2012

### haruspex

Clearly as t increases it will tend to be T0 everywhere. So there should be a constant term T0, and the general solution will be T(r,t) = T0-ƩAke-κk2tsin(kr)/r
Haven't tried to spot where you lost the T=constant solution to the ODE.
PS: I'm not suggesting k is an integer there. The set of k values is to be determined.

12. Nov 17, 2012

### TSny

Note that if you add or subtract any constant to $T(\vec x ,t )$ it will still satisfy the heat equation. Thus, you might try letting $\tau(\vec x ,t )$ = $T(\vec x ,t )$ - $T_0$. It will have the same general form of solution that you found for $T(\vec x ,t )$ exept the boundary and initial conditions will change. You should find that you can satisfy the boundary condition at r = R for $\tau(\vec x ,t )$ with an infinite number of different choices for your constant C. These values of C will be related to the k's in haruspex's expression for the solution.

13. Nov 17, 2012

### fluidistic

Thanks for the help guys, though I'm still stuck.
So $T(r,t)=T_0 - \sum _k A_k e^{-\kappa k^2 t} \frac{\sin (kr )}{r}$. The initial condition gives me $T(r,0)=0 \Rightarrow T_0 - \sum _k A_k \frac{\sin (kr )}{r}=0$. I don't know if it's possible that a constant can be written as a sum of a sinus function divided by the argument of the sinus function. Maybe this is a Fourier series, I'm not really sure. But I don't know how to get the values of k from it.
Using $\tilde T(\vec x ,t ) =T(\vec x , t ) + T_0$, the boundary condition gives me $\frac{c_2e^{-\kappa C t} \sin (R \sqrt C )}{R}=2T_0$. Which is impossible because the left side depends on t while the right side does not.
The initial condition gives me $\frac{c_2 \sin ( r \sqrt C )}{r}-T_0=0$ so that the constant is a function of r, impossible.

Yeah it's strange that my method did not reach the fact that adding a constant to the general solution would still make it a general solution.

14. Nov 17, 2012

### haruspex

We'll come back to that. Let's look at the other boundary condition first.
No, r = R should give you:
$T(R,t)=T_0 - \sum _k A_k e^{-\kappa k^2 t} \frac{\sin (kR )}{R} = T_0$
$\sum _k A_k e^{-\kappa k^2 t} \frac{\sin (kR )}{R} = 0$
That should tell you what the k values are.

15. Nov 17, 2012

### TSny

Try shifting the temperature the other way. Let

$\tilde T(\vec x ,t ) =T(\vec x , t ) - T_0$

Then reconsider the boudary condition at r = R and find the possible values of $\sqrt{C}$ $\equiv k$ that will satisfy the boundary condition. [Whoops! I see haruspex already made essentially the same comment.]

16. Nov 17, 2012

### fluidistic

Thanks once more seriously guys! I'm sorry for my careless arithmetics errors.
So I get $k=\frac{n\pi}{R}$ with n=0, 1, 2, .... This makes $C=\left ( \frac{n\pi}{R} \right ) ^2$.
The initial condition $\tilde T (r,0)=0$ gives me $\sum _{n=0}^\infty A_n \frac{\sin \left ( \frac{n\pi}{R} \right ) ^2 }{r}=T_0$. So I must get those A_n coefficients and I'd be done.
The trick is to convert the infinite series into an integral? The limits of the integral would be 0 and R I guess and it will be with respect to r. I'm not 100% sure how to proceed there.

17. Nov 17, 2012

### TSny

Good. But you should be able to see that you can ignore the n = 0 term.
Remember, the argument of the sine function is $\sqrt{C}r$.
What type of infinite series do you get on the left if you multiply both sides of the equation $\sum _{n=1}^\infty A_n ...=T_0$ by $r$?

18. Nov 17, 2012

### fluidistic

True, because we discarted the case k=0 already, right?
Yes, I made a latex typo and forgot to include the "r" part.

Hmm I don't really know. Looks like a sine Fourier series.

19. Nov 17, 2012

### TSny

Right, k = 0 will give zero contribution due to sin(kr) = 0 when k = 0.
And also forgot to take the square root of C.
Yes. There's a standard way to find the coefficients of a Fourier series.

20. Nov 17, 2012

### fluidistic

Oh right, another latex typo I did not see.

I look at http://mathworld.wolfram.com/FourierSineSeries.html. So $A_n=\frac{2}{R} \int _0 ^R r T_0 \sin \left ( \frac{n\pi r}{R} \right ) dr$.
I solved that integral by parts. I reach that $A_n=(-1)^{n+1} \frac{2RT_0}{n\pi}$.
Therefore the final answer of the problem would be... $$\tilde T(r,t)=T_0 \left [ 1+ \frac{2R}{\pi r} \sum _{n=1}^\infty \frac{(-1)^n}{n} \sin \left ( \frac{n\pi r}{R} \right ) \right ]$$.
I hope I did not make any typo and more importantly, any mistake.