Understanding dummy variable in solution of 1D heat equation

In summary, 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 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' .
  • #1
Atr cheema
69
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
  • #2
You should not give it a value. It should be integrated from 0 to t.
 
  • Like
Likes Atr cheema
  • #3
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!.
 
  • #4
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.
 
  • #5
In your function fun, ftau does not depend on tau...
What is the function ##f(t)## that you are trying to use?
 
  • #6
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)##.
 
  • #7
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.
 

1. What is a dummy variable in the solution of 1D heat equation?

A dummy variable is a variable that is introduced in the solution of the 1D heat equation to simplify the mathematical calculations. It does not have any physical meaning and is used to represent a specific parameter or condition in the equation.

2. How is a dummy variable used in the solution of 1D heat equation?

In the solution of 1D heat equation, a dummy variable is typically used in the integration process. It is substituted in place of a variable that is difficult to integrate, allowing for easier and more efficient calculations.

3. Can multiple dummy variables be used in the solution of 1D heat equation?

Yes, multiple dummy variables can be used in the solution of 1D heat equation. This is often necessary when dealing with complex boundary conditions or non-homogeneous coefficients in the equation.

4. How do dummy variables affect the accuracy of the solution to the 1D heat equation?

Dummy variables have no effect on the accuracy of the solution to the 1D heat equation. They are simply a mathematical tool used to simplify the integration process and do not alter the physical properties or behavior of the system.

5. Are dummy variables commonly used in other scientific equations?

Yes, dummy variables are commonly used in various scientific equations to simplify calculations and make them more manageable. They are particularly useful in integral calculus and differential equations.

Similar threads

Replies
4
Views
1K
Replies
8
Views
2K
  • Differential Equations
Replies
7
Views
3K
  • Calculus and Beyond Homework Help
Replies
7
Views
849
Replies
0
Views
462
Replies
7
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
3K
  • Programming and Computer Science
Replies
4
Views
4K
  • Differential Equations
Replies
1
Views
2K
  • Differential Equations
Replies
2
Views
2K
Back
Top