Understanding dummy variable in solution of 1D heat equation

Click For Summary

Discussion Overview

The discussion revolves around the implementation of the 1D heat equation using Fourier Cosine Transform, specifically addressing the role and definition of the dummy variable 'tau' in the context of coding solutions in MATLAB or Python. Participants explore the integration process and the implications of their code on the observed results.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant questions the value of the dummy variable 'tau', noting it is not defined initially and appears during the solution process.
  • Some participants suggest that 'tau' should not be assigned a value but rather integrated from 0 to 't'.
  • A participant shares their MATLAB implementation of the solution, expressing confusion over the increasing amplitude of the observed signal over time.
  • Another participant points out that in the provided function, 'ftau' does not depend on 'tau', raising concerns about the correctness of the implementation.
  • Clarifications are made regarding the function 'f(t)', which is described as the change in 'h' at 'x=0', with assumptions made about its form.
  • Concerns are raised about the assumptions made regarding boundary conditions, specifically that 'h(0,t)' cannot be assumed to have a particular form and that the boundary condition at 'x=0' is a Neumann condition.

Areas of Agreement / Disagreement

Participants express differing views on the implementation details and assumptions regarding the function 'f(t)' and the role of 'tau'. There is no consensus on the correctness of the code or the assumptions made about the boundary conditions.

Contextual Notes

Participants highlight potential limitations in the code, including the dependence of 'ftau' on 'tau' and the assumptions regarding the form of 'h(0,t)'. There are unresolved questions about the mathematical steps involved in the integration process and the implications of the boundary conditions.

Atr cheema
Messages
67
Reaction score
0
The solution of 1D diffusion equation on a half line (semi infinite) can be found with the help of Fourier Cosine Transform. Equation 3 is the https://ibb.co/ctF8Fw figure is the solution of 1D diffusion equation (eq:1). I want to write a code for this equation in MATLAB/Python but I don't understand what value should I give for the dumy variable 'tau' .

This variable is not defined at the start and only appears during solution process.
 
Physics news on Phys.org
You should not give it a value. It should be integrated from 0 to t.
 
  • Like
Likes   Reactions: Atr cheema
Orodruin said:
You should not give it a value. It should be integrated from 0 to t.
Can you please elaborate that how this will be implemented in the form of a code (in MATLAB or any other language). I am sorry I am still confused!.
 
I have implemented it in MATLAB with following code
Code:
p = 100;      % number of steps
ft1 =   sin(linspace(0,45,p));        
D = 100; x = 40;
t = 1:100;                                            
ft2 = ft1*0.5;
ftau = -(ft2-ft1)/10 ;                                                           %   dh/dx
out_of_integral = sqrt(D/pi);
fun = @(tau,ftau,t) ftau./(t-tau).*exp(-x^2./(4*D*(t-tau)));
h = zeros(1,p);
for i = 1:p
    q = integral(@(tau)fun(tau,ftau(i),t(i)),0,t(i));
    h(i) = q*out_of_integral;
end
plot(ft1)
hold on;
plot(ft2,'k')
plot(ftau,'c')
plot(h,'r')
legend('Input','','f( \tau)','Output (observed)')
xlabel('time(sec) at x = 40m')
ylabel('temperature')

But the result is little problematic i:e amplitude of observed signal at x=40 keeps on increasing with time. The input data (f(tau)) is not totally realistic but I am unable to understand this increase in observed amplitude. The result can be seen in this figure.
 
In your function fun, ftau does not depend on tau...
What is the function ##f(t)## that you are trying to use?
 
Orodruin said:
In your function fun, ftau does not depend on tau...
What is the function ##f(t)## that you are trying to use?
If you look at equation 2 in figure attached in question, ##f(t)## is the change in ##h## at ##x=0##. I am assuming ##h(x=0,t)## to be a sine wave and ##f(t)## as change in ##h## with respect to ##x##. In the code ##ft1## represents ##h(x=0,t)##.
 
Atr cheema said:
If you look at equation 2 in figure attached in question, ##f(t)## is the change in ##h## at ##x=0##. I am assuming ##h(x=0,t)## to be a sine wave and ##f(t)## as change in ##h## with respect to ##x##. In the code ##ft1## represents ##h(x=0,t)##.
No it doesn’t. You need to be much more careful with what you put in your script. And still that does not solve the fact that your ftau actually does not depend on tau in your integral.

I suggest going through every line of your code and consider if it is really doing what you want it to do or not.

Also note that you cannot assume ##h(0,t)## to have a particular form. The boundary condition at ##x=0## is a Neumann condition.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K