Heat Equation confusion.

Hacp

Lifer
Jun 8, 2005
13,923
2
81
I need to understand the heat equation for a group project. This class has almost no relation to heat transfer. Given time a t, I need the temperature distribution of a cylindrical object with a cold sink on one end and a hot sink on the other.

After scouring the internet for a few hours(because I don't have a textbook to refer to) I think I finally found what I wanted. However, I still have a few major questions.Here is the document.

http://online.redwoods.cc.ca.us/instruct/darnold/deproj/sp02/AbeRichards/paper.pdf

In section 5 of the pdf, the example section, the two gentlemen had the equality:
Equation1.GIF


You plug that into
equation2.GIF

However, when the gentlemen plugged lambda in, they got this equation.
equation3.GIF

What happened to L squared? Wasn't it supposed to be L^2 under k*t or am I missing a step?

Finally, there is the temperature distribution graph in the PDF. I am a little confused about this. When you plug in T=0, the temperature at almost all the points is zero.
equation4.GIF


Does this example assume that the temperature distribution at time=0 is zero degrees? How would you increase that? Thank you for your time.
 

ElementalK

Junior Member
Mar 27, 2010
1
0
0
Actually registered for this site since I've used it multiple times for computer info and saw something that I actually know a little about.

In section 5 of the pdf, the example section, the two gentlemen had the equality:
Equation1.GIF

You plug that into
equation2.GIF

Stop there. You're plugging lambda (an eigenvalue) for X(x) into the solution for T(t). Each eigenfunction has different eigenvalues. First they show the solution for T(t) then for X(x) then multiply the two to get the product solution.

If you haven't already worked through some fundamental heat transfer this problem is a bit tough to get started on -- but you can do it. Use your math books to refresh your memory on the eigenvalue/eigenfunction approach (I always forget.) Since you don't have access to text books see if you can get on Amazon and work the page preview system to find a similar problem worked by a different author (Anthony Mills or Incropera and DeWitt, several other standard intro heat transfer textbooks) I don't find the text you found very forgiving -- he just assumes you know all the math cold.

Finally, there is the temperature distribution graph in the PDF. ...
Does this example assume that the temperature distribution at time=0 is zero degrees? How would you increase that? Thank you for your time.

Yes, but the eventual solution is just additive to whatever the starting temperature is presuming the boundary conditions are defined consistent with that. I.e., when you find the temperature distribution as a function of time, just add a constant to it representing the starting temperature.

One final note -- I don't know what your original problem statement was but perhaps its simpler than the example you found?

I've seen similar queries get many answers on some physics forum -- can't remember the web address at present, sorry.

Good luck.

-K
 

Hacp

Lifer
Jun 8, 2005
13,923
2
81
Actually registered for this site since I've used it multiple times for computer info and saw something that I actually know a little about.



Stop there. You're plugging lambda (an eigenvalue) for X(x) into the solution for T(t). Each eigenfunction has different eigenvalues. First they show the solution for T(t) then for X(x) then multiply the two to get the product solution.

If you haven't already worked through some fundamental heat transfer this problem is a bit tough to get started on -- but you can do it. Use your math books to refresh your memory on the eigenvalue/eigenfunction approach (I always forget.) Since you don't have access to text books see if you can get on Amazon and work the page preview system to find a similar problem worked by a different author (Anthony Mills or Incropera and DeWitt, several other standard intro heat transfer textbooks) I don't find the text you found very forgiving -- he just assumes you know all the math cold.



Yes, but the eventual solution is just additive to whatever the starting temperature is presuming the boundary conditions are defined consistent with that. I.e., when you find the temperature distribution as a function of time, just add a constant to it representing the starting temperature.

One final note -- I don't know what your original problem statement was but perhaps its simpler than the example you found?

I've seen similar queries get many answers on some physics forum -- can't remember the web address at present, sorry.

Good luck.

-K

Don't they show that the eigenvalues of both functions T(t) and X(t) need to be equal to each other? Just the general solutions are different.

The only other time I've run into second order partial differential equations is through fick's second law, which is very similar to the heat equation. However, sadly(or gladly for my grade :p), they never went on to derive the equation fully. We started with the error function and worked from there.
 
Last edited:

DanDaManJC

Senior member
Oct 31, 2004
776
0
76
Well they're using a combination of the eigenvalue and eigenfunction problem in addition to using a separation of variables approach for solving the two variable differential equation... so you have the time equation and location equation.

for example, in physics, when you solve the Schrodinger equation for the 1d case with time, and assume an energy eigenstate, the time eigenstates are simply complex exponentials... and the position eigenstates are something else. the point being that eventually you formulate the relationship between position and momentum and it turns out to be a fourier transform... The schrodinger equation is an equation that is of the same form of the heat equation... so if you're familiar with the schrodinger equation's solution you could apply that knowledge to the heat equation

although i dont have my book's name handy, id suggest looking up any textbook on elementary diff eqs --- most will have a section on the basics of partial diff equations, and in most books the nitty-gritty solution of the heat equation is the one of the first problems many books go through. i also know i was able to find a copy of my book's pdf online via torrents and such.
 

Hacp

Lifer
Jun 8, 2005
13,923
2
81
Well they're using a combination of the eigenvalue and eigenfunction problem in addition to using a separation of variables approach for solving the two variable differential equation... so you have the time equation and location equation.

for example, in physics, when you solve the Schrodinger equation for the 1d case with time, and assume an energy eigenstate, the time eigenstates are simply complex exponentials... and the position eigenstates are something else. the point being that eventually you formulate the relationship between position and momentum and it turns out to be a fourier transform... The schrodinger equation is an equation that is of the same form of the heat equation... so if you're familiar with the schrodinger equation's solution you could apply that knowledge to the heat equation

although i dont have my book's name handy, id suggest looking up any textbook on elementary diff eqs --- most will have a section on the basics of partial diff equations, and in most books the nitty-gritty solution of the heat equation is the one of the first problems many books go through. i also know i was able to find a copy of my book's pdf online via torrents and such.
Yes, I know what they're doing. They explained it in the PDF. Could you tell me why there is a discrepancy in the lambdas?
 

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
The solution assumes that the initial temperature was uniform and equal to the temperature at the colder boundary. The solution you've presented is nondimensionalized, with u=(y_1-y)/(y_1-y_0), where y is the temperature, y_1 is the hot boundary temperature, and y_0 is the cold boundary (and initial) temperatuure. If you substitute this into the solution you have for u, it will become very obvious how you can adjust the temperature.
 

silverpig

Lifer
Jul 29, 2001
27,703
12
81
You're actually missing a lot of steps. It wasn't a simple "plug-in" to get that equation for v(x,t). They solved a Sturm-Liouville problem to get that solution.
 

Hacp

Lifer
Jun 8, 2005
13,923
2
81
You're actually missing a lot of steps. It wasn't a simple "plug-in" to get that equation for v(x,t). They solved a Sturm-Liouville problem to get that solution.

I don't see where I'm missing any steps. No, I don't understand why they set their boundaries to get their separation of variables method, but everything else is what they teach you in differential equations. But do you have any insight about the L? Thanks.
 

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
I don't see where I'm missing any steps. No, I don't understand why they set their boundaries to get their separation of variables method, but everything else is what they teach you in differential equations. But do you have any insight about the L? Thanks.
I'm not exactly sure what you mean by the first part, so let me know if this doesn't address it. Separation of variables requires homogeneous boundary conditions and a non-homogeneous initial condition. As for the reason L is not squared, it has to do with the role of the eigenvalue (lambda). When you separate variables for this particular problem, the eigenvalue must be real and positive for a meaningful solution. Therefore, when the variables are separated, it is common to write that X(x)=T(t)=constant. When you work it out, you'll find that the quantity within the argument of the sin() and cos() is the square root of the constant. Since they defined the constant as lambda (rather than lambda^2, which is how I would probably have written it), that's how it ends up here.
 

Hacp

Lifer
Jun 8, 2005
13,923
2
81
I'm not exactly sure what you mean by the first part, so let me know if this doesn't address it. Separation of variables requires homogeneous boundary conditions and a non-homogeneous initial condition. As for the reason L is not squared, it has to do with the role of the eigenvalue (lambda). When you separate variables for this particular problem, the eigenvalue must be real and positive for a meaningful solution. Therefore, when the variables are separated, it is common to write that X(x)=T(t)=constant. When you work it out, you'll find that the quantity within the argument of the sin() and cos() is the square root of the constant. Since they defined the constant as lambda (rather than lambda^2, which is how I would probably have written it), that's how it ends up here.

In my first post, the first equation they had lambda= n^2*pi^2/L^2. In the 3rd equation, they were supposed to plug in lambda into T(t). They ended up with e^-n^2*pi^2/L. Somehow, the L^2 transformed into an L. That does not make sense. Here is a scan illustrating what I'm saying.


http://pics.bbzzdd.com/users/hacp/Problem12.GIF
Problem12.GIF
 
Last edited:

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
In my first post, the first equation they had lambda= n^2*pi^2/L^2. In the 3rd equation, they were supposed to plug in lambda into T(t). They ended up with e^-n^2*pi^2/L. Somehow, the L^2 transformed into an L. That does not make sense. Here is a scan illustrating what I'm saying.
Ah, now I see. That's definitely a mistake - it should be L^2. I thought you were asking about why the argument of the sine was just L.
 

Hacp

Lifer
Jun 8, 2005
13,923
2
81
I managed to finally solve it using finite differences. Fuck analytical methods! I originally tried to do it using the same explicit method 5 months back but for some reason, I put the time step loop inside the space loop and that messed up the answer. Got back to the problem after I needed to solve it for another class. Here is the matlab code for people who randomly googled this. Cheers.
Code:
alpha=.2;
dx=.25;
dt=0.05;
C=alpha*dt/(dx*dx);%C is coefficient
%Creates the position Vector
for i=1:5;
    x(i)=(i-1)*dx;
end
%Sets the initial Condition
for i=2:4;
    U(i,1)=20+40*(i-1)*dx;
end
%Main Program to solve heat equation
for n=1:21    
U(1,n)=20*exp((n-1)*dt*-1);
U(5,n)=60*exp(-2*(n-1)*dt);
for i=2:4
U(i,n+1)=C*U(i+1,n)+(1-2*C)*U(i,n)+C*U(i-1,n);
end
end
plot(x,[U(:,21),U(:,16),U(:,11),U(:,6),U(:,1)])%plots at time=[0,.25,.5,.75,1] Temperature vs Position
xlabel('Position)');
ylabel('Temperature');
TITLE('Temperature vs Position');
legend('time=1','time=.75','time=.5','time=.25','time=0','Location','NorthOutside');
 
Last edited:

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
I managed to finally solve it using finite differences. Fuck analytical methods! I originally tried to do it using the same explicit method 5 months back but for some reason, I put the time step loop inside the space loop and that messed up the answer. Got back to the problem after I needed to solve it for another class. Here is the matlab code for people who randomly googled this. Cheers.
Code:
alpha=.2;
dx=.25;
dt=0.05;
C=alpha*dt/(dx*dx);%C is coefficient
%Creates the position Vector
for i=1:5;
    x(i)=(i-1)*dx;
end
%Sets the initial Condition
for i=2:4;
    U(i,1)=20+40*(i-1)*dx;
end
%Main Program to solve heat equation
for n=1:21    
U(1,n)=20*exp((n-1)*dt*-1);
U(5,n)=60*exp(-2*(n-1)*dt);
for i=2:4
U(i,n+1)=C*U(i+1,n)+(1-2*C)*U(i,n)+C*U(i-1,n);
end
end
plot(x,[U(:,21),U(:,16),U(:,11),U(:,6),U(:,1)])%plots at time=[0,.25,.5,.75,1] Temperature vs Position
xlabel('Position)');
ylabel('Temperature');
TITLE('Temperature vs Position');
legend('time=1','time=.75','time=.5','time=.25','time=0','Location','NorthOutside');
Solving this PDE is pretty fundamental if you'll ever need to know how to solve heat/mass/momentum/electromagnetic field equations over a finite domain, so you might want to learn how to do it. If you're going to solve it numerically in MATLAB, you should look at the pdepe function. I can walk you through both the analytical solution and using pdepe if you need more help - I just gave a lecture on this exact topic on Wednesday.
 

Hacp

Lifer
Jun 8, 2005
13,923
2
81
Solving this PDE is pretty fundamental if you'll ever need to know how to solve heat/mass/momentum/electromagnetic field equations over a finite domain, so you might want to learn how to do it. If you're going to solve it numerically in MATLAB, you should look at the pdepe function. I can walk you through both the analytical solution and using pdepe if you need more help - I just gave a lecture on this exact topic on Wednesday.

Well, I pretty much understand how they solved it. A lot of the techniques they use to solve this problem I was exposed to when learning the time independent Schrodingers.Only part I had trouble understanding was some of the notation they used for the boundry conditions and also what the hell a half range sine expansion is.