Nonlinear conduction,where thermal conductivity depends on temparature

In summary, the programmer is trying to solve a nonlinear differential equation that depends on temperature. The equation is given in terms of k, a matrix that has values that are estimated from the last iteration. The program is running slow and not giving precise results. The user is trying to solve the equation using a while loop, but is confused about the equation and what k is.
  • #1
annie.1991
5
0
Hi everyone,
i am trying to solve and program a non linear differential equation in MATLAB where thermal conductivity depends on temparature.I am trying it to solve by explicit finite difference method.
the given equation is ∂2t/∂x2+∂2t/∂y2 *k(t)= -q (x,y)

i have solved the equation taking k(t)= a-b*t,and when i further solved the equation it gave an quadratic equation. where temparature is the root of the equation.but unfortunately my program is running slow and not giving me precize results can anybody help me out in this.

n = 5;
x = linspace(0,1,n);
dx = x(2)-x(1);
y = x;
dy = dx;

Q =80;


M= zeros(n,n);
if (mod(n,2)==0)
M(n/2,n/2)=Q;
else
p = (n+1)/2 ;
M(p,p)= Q;
end


t = ones(n);

t(1,1:n) = 0;
t(n,1:n) = 0;
t(1:n,1) = 0;
t(1:n,n) = 0;
a = 1;
b = 0;
tic
error = 1; z = 0;

while error > 0.0000001
z = z+1;

tnew = t;

for i = 2:n-1
for j = 2:n-1

d = -((b*(tnew(i+1,j)+tnew(i-1,j)+ tnew(i,j+1)+tnew(i,j-1))) + (4*a));

e = ( a*(tnew(i+1,j)+tnew(i-1,j)+ tnew(i,j+1)+tnew(i,j-1))) + (M(i,j)* dx^2);

f = b*4;

answer=roots([f,d,e]);
t(i,j)= max(max(abs(answer)));
end
end
error = max(max(abs(tnew-t)));

end
toc
 
Last edited:
Physics news on Phys.org
  • #2
Ummmm. I'm not sure, but since you're using a while loop, the tic and toc lines are probably unnecessary? Here's how I would handle it:

T i,j = [(Q i,j/k i,j)*dx^2 + T i+1,j + T i-1,j + T i,j+1 + T i,j-1]/4

Q i,j is the Q matrix you set up.

k i,j would be a matrix with values of k estimated from the last iteration, it would be convenient to store this in a matrix as well.

T i,j is the temperature at point i,j, and the others are offset from i,j by one in the + or - x or y directions (similar to what you already have).

As for the root finding lines that you threw in there, they are completely and totally unnecessary. As long as you update the values of k for each index of the matrix in each loop, the values will converge on their own over time. Your calculation of the error should work okay, but I don't think the number you chose for the error limit needs to be that small. 0.0000001 is extremely small, and it could take a long time to get it that low. Try something larger first, like 0.001. Then solve it down to 0.0001 and see if that changes anything, likely it won't make much of a difference to the final answer you get.
 
  • #3
Thanks for your reply and your sujjestion,
Probably What i can undestand from your sujjestion is the linear heat conduction,but i am trying to do a non linear heat conduction where thermal conductivity (K) depends on Temparature (T).If you would have any better idea of solving this kind of equation please share with me

I didnt undestand what you are saying about K(i,j),,what exactly is this K(i,j) ?
 
  • #4
So, K (conductivity) has it's own matrix, where i and j are the indices (for any of the mentioned variables). Even if K is non-linear as a function of temperature, typically you can still use the same method and get convergence of your array.

I'm a little bit confused, above you have written k = a-b*t, which is linear. What is the equation that describes k as a function of temperature? True, the differential equation becomes non-linear after using a temperature dependent conductivity, but the conductivity itself appears to be linear.

Even if it isn't, as long as you have a function for conductivity versus temperature, it should converge (unless it's a really weird relationship in terms of conductivity going to zero or negative numbers).
 
  • #5
i understood about k(i,j).if i take initial values of k as ones matrix and run the program with your given sujjestion then there will be no influence or no change in values of martix K.

in my code I have considerd K(T) = a - b*T where a>>b a and b are variables. i just taught i can see the variations of temperature depending on the values of a and b.I just wanted to write down in the equation where tempearture is changing with some other variables.

So If you feel like my idea doesn't works (or) my idea is wrong with the physics,then please share any other ideas which you have to solve this equation where i can see the conductivity changing with temperature.
 
  • #6
You formulation for the case of temperature-dependent thermal conductivity is incorrect. You should not have factored out the thermal conductivity from the derivatives. It should be:

[tex]\frac{∂}{∂x}\left(k\frac{∂T}{∂x}\right)+\frac{∂}{∂y}\left(k\frac{∂T}{∂y}\right)=-q[/tex]
or equivalently
[tex]\frac{1}{k}\frac{∂}{∂x}\left(k\frac{∂T}{∂x}\right)+\frac{1}{k}\frac{∂}{∂y}\left(k\frac{∂T}{∂y}\right)=-\frac{q}{k}[/tex]
or equivalently
[tex]\frac{∂^2T}{∂x^2}+\frac{∂^2T}{∂y^2}+\frac{∂lnk}{∂x}\frac{∂T}{∂x}+\frac{∂lnk}{∂y}\frac{∂T}{∂y}=-\frac{q}{k}[/tex]

Chet
 
  • #7
Chestermiller said:
You formulation for the case of temperature-dependent thermal conductivity is incorrect. You should not have factored out the thermal conductivity from the derivatives.

Ummmmm, I could be wrong, but Chet's derivation assumes k is a function of x and/or y? This is not the case you've laid out here, where k is only a function of temperature. True, temperature is also a function of the location, but that's why you calculate a new value for k at each iteration and location. (The derivation is not wrong, just unneccesary from what I've always seen done for a numerical method.) Given the conditions described, a>>b, it should have no trouble converging. Because you're solving the equation one element at a time, you can pull k out of it so long as k at each element gets calculated and is updated each iteration.
 
Last edited:
  • #8
jlefevre76 said:
Ummmmm, I could be wrong, but Chet's derivation assumes k is a function of x and/or y?
Not exactly. k is a function of temperature, and temperature is a function of x and y, so k is a function of x and y. In evaluating the derivatives involving lnk in the equation, you get k(T) at each of the grid points, and then use a central difference approximation to get the derivatives at the grid point under consideration. If you omit those derivatives of lnk, you will get the wrong answer to the problem. I have a lot of industrial experience in solving problems like this in the real world.

Another form of the equation that works is:

[tex]\frac{∂^2T}{∂x^2}+\frac{∂^2T}{∂y^2}+\frac{∂lnk}{∂T}\left[\left(\frac{∂T}{∂x}\right)^2+\left(\frac{∂T}{∂y}\right)^2\right]=-\frac{q}{k}[/tex]

where ∂lnk/∂T is evaluated at the grid point under consideration.

Chet
 
Last edited:

1. What is nonlinear conduction?

Nonlinear conduction is a phenomenon in which the thermal conductivity of a material is dependent on the temperature gradient. This means that the rate at which heat is transferred through the material changes as the temperature changes.

2. How does nonlinear conduction differ from linear conduction?

Linear conduction is when the thermal conductivity of a material is constant and does not change with temperature. Nonlinear conduction, on the other hand, results in a nonlinear relationship between temperature gradient and heat transfer, which can lead to unexpected and complex thermal behavior.

3. What factors can affect nonlinear conduction?

Nonlinear conduction is influenced by various factors such as the material's molecular structure, composition, and temperature. Changes in these factors can lead to changes in the material's thermal conductivity, resulting in nonlinear conduction.

4. How is nonlinear conduction measured?

The thermal conductivity of a material can be measured using specialized equipment such as a heat flow meter or a thermal conductivity analyzer. These instruments measure the amount of heat transferred through a material at different temperatures and can be used to determine the material's thermal conductivity and its dependence on temperature.

5. What are some practical applications of nonlinear conduction?

Nonlinear conduction is commonly observed in materials such as ceramics, polymers, and composite materials. It has various applications in industries such as electronics, aerospace, and energy, where materials with specific thermal properties are required. Understanding nonlinear conduction is also crucial in designing efficient thermal insulation and heat transfer systems.

Similar threads

  • Differential Equations
Replies
3
Views
1K
  • Introductory Physics Homework Help
Replies
3
Views
1K
  • Differential Equations
Replies
1
Views
1K
  • Differential Equations
Replies
2
Views
1K
  • Differential Equations
Replies
7
Views
332
  • Differential Equations
Replies
1
Views
716
Replies
1
Views
1K
  • Differential Equations
Replies
1
Views
706
  • Differential Equations
Replies
1
Views
2K
  • Differential Equations
Replies
8
Views
3K
Back
Top