# "What PDE is obeyed by the following function..."

1. Mar 9, 2016

### sa1988

1. The problem statement, all variables and given/known data

Part (a) below:

2. Relevant equations

3. The attempt at a solution

There's more to this question but I'm only stuck on this first part so far.

I have no idea what specific PDE the equation, θ(x,t) = T(x,t) - T0x/L , obeys

In this module (mathematics) we've covered the wave equation, diffusion equation and Schrodinger equation as examples of PDEs in physics. We've done separation of variables and are now onto using Fourier series to solve PDEs.

In answer to the question, am I supposed to say a straight-forward, "This PDE obeys the wave/diffusion/Schrodinger equation", or does it simply obey some general PDE that I need to figure out for myself? Either way, I can't really see what I'm looking for. Or at least I can't see anything of value which can then take me on to solving the rest of the problem. I presume it should somehow take me back around to the diffusion equation..?

Thanks

2. Mar 9, 2016

### LCKurtz

What happens if you calculate $\Theta_{xx},~\Theta_{tt}$ and compare with your thermal diffusion equation?

3. Mar 9, 2016

### vela

Staff Emeritus
Or solve for T in terms of $\Theta$.

4. Mar 10, 2016

### sa1988

I would get:
$\frac{\partial^2 Θ}{\partial x^2} = \frac{\partial^2 T}{\partial x^2}$
and
$\frac{\partial^2 Θ}{\partial t^2} = \frac{\partial^2 T}{\partial t^2}$

but I can't see how it relates to the diffusion equation?

Unless...

If I do this and then take relevant derivatives, I can turn it into:

$T(x,t) = Θ(x,t) + \frac{T_{0}x}{L}$

Then:
$\frac{\partial T}{\partial t} = \frac{\partial Θ}{\partial t}$
and
$D\frac{\partial^2 T}{\partial x^2} = D\frac{\partial^2 Θ}{\partial x^2}$

which could then be combined to form a diffusion equation, on the assumption that $\frac{\partial Θ}{\partial t} = D\frac{\partial^2 Θ}{\partial x^2}$

But then couldn't I take very similar steps to form a wave equation too? Specially seeing as LCKurtz suggested I take second partial derivatives of both, which is even closer to wave equation territory!

Or am I still missing some glaring important point here?

Thanks.

5. Mar 10, 2016

### LCKurtz

I misread your original equation as having $T_{tt}$ in it, so I meant to suggest calculating $\Theta_t$, not $\Theta_{tt}$. So, as you noted, you do get $\frac{\partial Θ}{\partial t} = D\frac{\partial^2 Θ}{\partial x^2}$. But the important point you are missing is that you haven't answered what boundary conditions $\Theta(x,t)$ satsfies. Your original function satisfies $T(0,t)=0,~T(L,t)=T_0$.

So, I repeat, what boundary conditions does $\Theta$ satisfy? Is there any reason to prefer trying separation of variables on one or the other of the boundary value problem for $T$ or $\Theta$?

6. Mar 10, 2016

### sa1988

Hmm, I think I'm beginning to get it. Because of the boundary conditions on $T(x,t)$, it would mean the boundary conditions:

$Θ(0,t)=0$
and
$Θ(L,t)=0$.

are apparent.

Using separation of variables is presumably easier in solving for $Θ(x,t)$ because of the neater boundary conditions

But I don't understand how I'm supposed to prove that it obeys the diffusion equation in the first place - it seems to be something of a blind leap to take $Θ_{xx}$ and $Θ_t$, separately, then just equate them with a scaling factor of D.

7. Mar 10, 2016

### LCKurtz

Just think of $T(x,t) = Θ(x,t) + \frac{T_{0}x}{L}$ as a change of variable in your initial problem. Substitute it in and you get a new BVP with homogeneous boundary conditions, which you can solve. With the $T_0$ on the one boundary condition, after you try separation of variables you will wind up with something like $X(L)T_1(t)=T_0$ which won't even get you to $X(L)=0$ and the eigenvalues.

The point is, after you solve the $\Theta$ problem, you just substitute back for the solution to the $T$ problem. This exercise teaches you how to handle non-homogeneous BC's.

[Edited for better explanation]

Last edited: Mar 10, 2016
8. Mar 10, 2016

### sa1988

Dammit, posted when I wasn't ready to post. Wait.

9. Mar 10, 2016

### sa1988

Christ I'm still totally stuck here.

Been looking at it for hours and hours.

I'm using the general solution for the diffusion equation to get:

$Θ(x,t) = T_0 +\sum_{n=1}^{\infty} A_n$ $e^{D(\frac{nπ}{L})^2 t} cos(\frac{nπx}{L})$

But the boundary conditions,
$Θ(0,t) = 0$
and
$Θ(L,t) = 0$

are just leading me round in circles. Totally lost here...

I don't know if it helps or not but in this assignment the previous question gave us a function T(x) with boundary conditions almost exactly the same as those given at the start of this question here, which was solved as a Fourier representation.

So the idea is that we're actually supposed to already know what T(x,t) looks like at T=0, and this question is then aimed at describing how it changes with time if it's to obey the diffusion equation.

I'm honestly completely lost now though.

10. Mar 10, 2016

### vela

Staff Emeritus
There's no assuming required here. You know that T satisfies the diffusion equation. Since the derivatives are the same, $\Theta$ satisfies it also.

11. Mar 10, 2016

### LCKurtz

@sa1988: Can you show us how you would solve$$\Theta_t(x,t)=D\Theta_{xx}(x,t) = 0$$ $$\Theta(0,t) = 0,~\Theta(L,t)=0$$by yourself without using the general formula? In the process I think you will find that your "general formula" has errors in it and I think seeing that work will help me clear up some of your confusion. Don't worry about the initial condition for now.

12. Mar 14, 2016

### sa1988

Alright, as a standalone problem I would do the following

I'd use separation of variables, with:

$Θ(x,t) = X(x)T(t)$

So, in the diffusion equation

$\frac{dT(t)}{dt}X(x) = D\frac{d^2X(x)}{dx^2}T(t)$

Which rearranges to give:

$\frac{dT(t)}{dt}\frac{1}{T(t)} - D\frac{d^2X(x)}{dx^2}\frac{1}{X(x)} = 0$

Allowing for the two variables to be treated separately and sold for some constant $k$ such that:

$\frac{dT(t)}{dt} = T(t)k$
$\frac{d^2X(x)}{dx^2} = - X(x) \frac{k}{D}$

This gives:
$T(t) = Ae^{kt}+Be^{-kt}$
$X(x) = Ce^{i\frac{k}{D}x}+De^{-i\frac{k}{D}x}$

So finally:

$Θ(x,t) = (Ae^{kt}+Be^{-kt})(Ce^{i\frac{k}{D}x}+De^{-i\frac{k}{D}x})$

Then, given conditions:
$\Theta(0,t) = 0,~\Theta(L,t)=0$

$Θ(0,t) = (Ae^{kt}+Be^{-kt})(C+D) = 0$

hence
$C=-D$

then
$Θ(L,t) = (Ae^{kt}+Be^{-kt})C(e^{i\frac{k}{D}L}-e^{-i\frac{k}{D}L}) = 0$

only true for
$k = \frac{nπD}{L}$

This gives:
$Θ(x,t) = (Ae^{\frac{nπD}{L}t}+Be^{-\frac{nπD}{L}t})C(e^{i\frac{nπ}{L}x}-e^{-i\frac{nπ}{L}x})$

Expanding the right hand exponential terms to give:
$Θ(x,t) = (Ae^{\frac{nπD}{L}t}+Be^{-\frac{nπD}{L}t})2iC sin(\frac{nπ}{L}x)$

Returning to given conditions:
$\Theta_t(x,t)=D\Theta_{xx}(x,t) = 0$

Firstly:
$(\frac{nπD}{L}Ae^{\frac{nπD}{L}t}-\frac{nπD}{L}Be^{-\frac{nπD}{L}t})2iC sin(\frac{nπ}{L}x) = 0$
True for $A=B$

Then
$A(e^{\frac{nπD}{L}t}+e^{-\frac{nπD}{L}t})(-D2iC)(\frac{nπ}{L})^2 sin(\frac{nπ}{L}x) = 0$

Only true for $AC=0$

And now I'm stuck!

This seems to veer quite far away from the case involving Fourier series, though.

To get to the 'general formula' result involving a Fourier representation I went on the basis that Θ(x,t) = T0 + ΣAn(t) sin(nπx/L) , for some coefficient An(t) which allows the solution to vary with time, and plugged Θ(x,t) into the diffusion equation and solved for An(t) to get

$A_n(t) = e^{-D)\frac{nπ}{L}^2t}$

This general formula result is written in my lecture notes too, which is why I used it that way.

13. Mar 14, 2016

### LCKurtz

After you have done a few of these you will realize that it is best to keep the D with the t variable as in$$\frac{T'(t)}{DT(t)} = \frac{X''(x)}{X(x)}$$

The above suggestion would have kept the D out of the complex exponential. Also, you are now using D for two different things.

You complicate the issue by not applying the initial conditions to the separated variable X(x) before combining with the T(t) factor. This also hides the step where, when your your original problem has non-homogeneous boundary conditions, the process fails.

We have discussed this at length before. Look again at this:

It is the wave equation instead of the diffusion equation but the same idea.

I'm afraid this thread may have gotten hopelessly tangled up, possibly beyond repair.

14. Mar 14, 2016

### sa1988

I noticed the similarities to the previous discussion as I started working through that solution, though I didn't think it was so directly linked. Thanks for pointing it out!

Well I have four days left to figure this out. The points you've made here, particularly in relating it to the previous version of the problem with the wave equation, are very useful as I never saw it that way before. The thing throwing me here is that the problem I'm doing now is primarily focussed on solving PDEs with Fourier series, and that the lecture notes in class, including worked examples, don't relate it so strongly to the previous problem in the way you've pointed out here.

If you're curious, the notes from which I'm basing my 'understanding' (or lack thereof) are here - https://drive.google.com/file/d/0B8VhHMaC9ZQuNFdjR2F6UFFPbFE/view?usp=sharing - PDF page 31. Section 5.2.2 Diffusion of particles in a 1-dimensional box. And also the section above it, which involves standing waves on a string.

Thanks for the help so far, it's much appreciated. Relating it to that previous thread was something I never saw before, so it should help a lot.

15. Mar 14, 2016

### LCKurtz

The last thing I want to add for you is an explanation of why the non-homogeneous boundary conditions are a problem. To keep it simple, think about the simpler equation$$u_t(x,t) = u_{xx}(x,t)$$with boundary conditions$$u(0,t) = u(L,t) = 0$$versus the boundary conditions$$u(0,t) = 0,~u(L,t)= T_0$$Substituting $u(x,t) = X(x)T(t)$ into the DE gives $X(x)T'(t) = X''(t)T(t)$, which, as you know, is typically written$$\frac{X''(x)}{X(x)} = \frac {T'(t)}{T(t)}$$The first pair of boundary conditions $u(0,t) = u(L,t) = 0$ give, with that substitution$$X(0)T(t) = 0,~X(L)T(t) = 0$$This is what gives the nice boundary conditions $X(0)=0,~X(L) = 0$. So when you go through the steps solving for $X(x)$ you get $X_n(x) = \sin(\frac {n\pi x}{L})$.

The problem with the second pair of boundary conditions is that when you substitute $u(x,t) = X(x)T(t)$ into $u(0,t) = 0,~u(L,t)= T_0$ you get $X(0)T(t) = 0,~X(L)T(t) = T_0$. The first one gives you $X(0)= 0$, but the second doesn't help at all. You certainly can't conclude $X(L) = 0$.

That is why you need to do some substitution first in the nonhomogeneous case to make separation of variables work.

16. Mar 15, 2016

### sa1988

Thanks for that. It makes sense; I'll go over the problem again with that process now.

I think now also is a good time for me to reveal this problem in its entirety. It may help explain why I've jumped straight to the 'general solution' answer which had the Fourier series bunged in there.

For reference, the function f(x) in part b looks like:

$\sum_{n=1}^{\infty} \frac{2}{L}\bigg(\frac{L}{nπ}(1+\frac{a-L}{L-a})cos(\frac{nπa}{L})-(\frac{L}{nπ})^2(\frac{1}{a}+\frac{1}{L-a})sin(\frac{nπa}{L})\bigg) sin(\frac{nπk}{L})$

which only needs a bit of tweaking to make it represent the situation outlined for T(x) below.

In part c, I suppose I'm confused because it's telling me to express Θ(x,t) as a Fourier series with time-dependent coefficients. There's no mention of me needing to go through the process of solving the entire diffusion equation on its own. Maybe I took it too literally and should have thought 'out of the box' a bit more..? I suppose in hindsight it's fairly obvious since the diffusion equation is spelled out in the wording of the question, heh.

17. Mar 15, 2016

### LCKurtz

OK, let's recap and start over. You started with a pipe on $[0,L]$ whose temperature at $t=0$ is given as$$T(x,0)=\left\{ \begin{array}{l,l} 0, & 0\le x \le a \\ T_0\left(\frac{x-a}{L-a}\right),& a\le x\le L \end{array}\right.$$I will call that function $F(x)$.

Now, at $t=0$ the ice is removed and the ends of the pipe are held at $0$ and $T_0$, respectively. So you are given the diffusion boundary value problem (let's use k instead of D because D can be confused with differentiation):$$T_t(x,t) = kT_{xx}(x,t)$$ $$T(0,t)=0,~T(L,t)=T_0$$ $$T(x,0) = F(x)$$Notice that one of the end point conditions is non-homogeneous.

Now you are asked to make the change of variable $\Theta(x,t) = T(x,t) - \frac{T_0x} L$. I would like to see the steps showing how you got the answers for part (b).

18. Mar 16, 2016

### sa1988

@LCKurtz

Success, heh! Turned out the deadline was today at 12:00. Funny how a sudden panic can push things to happen.

I've identified the two parts that confused me.

First of all, I was under the impression that as $t → ∞$ the function $T(x,t)$ should tend to a flat average value since any real life thermal situation should generally involve a final equilibrium temperature which is uniform across the object. It then occurred to me that the given problem has fixed temperatures at each end, $T(0,t) = 0$ and $T(L,t) = T_0$, so of course it won't result in some flat line. I was entering all sorts into Mathematica 'Manipulate' functions and watching it result in some line $\frac{x}{L}$ as I let $t → ∞$ . It suddenly occurred to me that this should be the case, heh, so I moved on to working out what the correct maths should be.

First I discovered this: http://tutorial.math.lamar.edu/Classes/DE/HeatEqnNonZero.aspx#ZEqnNum497179 , a page explaining the thermal diffusion equation for non-homogeneous conditions, which I stared at and looked over for a very long time before realising the very, very obvious thing I was missing : $Θ(x,0)$ is a Fourier series with coefficients defined by $f(x)-\frac{T_0x}{L}$

So, for closure (and if you're interested), here's what I did.

Since $Θ(x,t)$ obeyed the diffusion equation, I used the solution

$Θ(x,t)=A_0 + \sum\limits_{n=1}^∞ A(t)sin(\frac{nπx}{L})$

which I plugged into the diffusion equation and solved for $A(t)$ to give

$Θ(x,t)=A_0 + \sum\limits_{n=1}^∞ A_ne^{-D(\frac{nπ}{L})^2t}sin(\frac{nπx}{L})$

Boundary conditions meant that $A_0 = 0$

And, the real 'Eureka' moment...

When $t=0$ it was already shown that

$Θ(x,0) = f(x) + \frac{T_0x}{L}$

where $f(x)$ is the temperature distribution at $t=0$ and looked very similar to a previous problem in the assignment.

Now $Θ(x,t)$ had just been found as $Θ(x,t) = \sum\limits_{n=1}^∞ A_ne^{-D(\frac{nπ}{L})^2t}sin(\frac{nπx}{L})$

which means

$\sum\limits_{n=1}^∞ A_ne^{-D(\frac{nπ}{L})^2t}sin(\frac{nπx}{L}) = f(x) + \frac{T_0x}{L}$

and this is nothing other than a basic Fourier series situation with coefficient:

$A_n = \int_0^L \! \Big(f(x) + \frac{T_0x}{L}\Big)sin(\frac{nπx}{L}) \, \mathrm{d}x$

$f(x)$ is the temperature distribution at $t=0$ which is defined as:

$0$ for $0<x<a$

$T_0\frac{x-a}{L-a}$ for $a<x<L$

which mirrored a problem I had previously tackled with a relatively ugly solution so I shan't show it here.

Then all that needed to be done was the integral for $A_n$ which again looked ugly but consisted primarily of $sin^2(x)$ and $x sin(x)$ parts which are not too hard to manage, if not a little finicky with all those constants and variables bunged in.

The final answer then came to:

$T(x,t) = Θ(x,t) +\frac{T_0x}{L}$

$T(x,t) = \frac{T_0x}{L} + \sum\limits_{n=1}^∞ \Bigg[\Bigg(\frac{2}{L}\bigg(\frac{-L}{nπ}cos(nπ) - (\frac{L}{nπ})^2\frac{1}{L-a}sin(\frac{nπa}{L})\bigg) + \frac{2}{nπ}cos(nπ)\Bigg)sin(\frac{nπx}{L})e^{-D(\frac{nπ}{L})^2t}\Bigg]$

There may be typos along the way here but overall the main solution was one that shows the distribution described above for $t=0$ which tends to a straight line of the form $\frac{T_0x}{L}$ as $t → ∞$

For the ultimate check, the following Mathematica code will give a manipulable plot to demonstrate it:

An = 2/L (-L/(n Pi) Cos[n Pi] - (L/(n Pi))^2 1/(L - a) Sin[n Pi a/L]);
Bn = AAAn + 2/(n Pi) Cos[n Pi];
a = 1; L = 5;
Manipulate[Plot[x/L + \!$$\*UnderoverscriptBox[\(\[Sum]$$, $$n = 1$$, $$20$$]$$Bn\ Sin[n\ Pi\ \*FractionBox[\(x$$, $$L$$]]
\*SuperscriptBox[$$E$$, $$\(- \*SuperscriptBox[\((n\ \*FractionBox[\(Pi$$, $$L$$])\), $$2$$]\) t\)]\)\), {x, 0, 5}], {t, 0,
5}]

I just hope I didn't go disastrously wrong with my logic here...

Last edited: Mar 16, 2016
19. Mar 16, 2016

### LCKurtz

OK, that's good. It looks like you figured it out. I didn't check every little detail but it looks right. You could simplify the Fourier coefficients by noting that $\cos(n\pi) = (-1)^n$. If you don't mind I am going to mark this thread as solved and call it a day.

20. Mar 16, 2016

### sa1988

Ah yeah, I was aware of the $(-1)^n$ thing but didn't 'notice' it until the majority of my working was in the form of $cos(n\pi)$. Time was very much against me so it stayed as it was.

Thanks for the help with this, very much appreciated. Looks like it wasn't unsalvageable after all!

Sure, mark it as solved.