Temperature Distribution of Current Carrying Wire in Matlab

Click For Summary
SUMMARY

The forum discussion focuses on solving a nonlinear ordinary differential equation (ODE) related to temperature distribution in a current-carrying wire using the shooting algorithm in MATLAB. The user implements a function, bar_temp, to define the temperature gradient and another function, bar_res, to find the boundary condition at x = L/2. The solution is computed using ode45 for numerical integration, and the temperature profile is plotted. The final temperature at x = L is confirmed to be 300 K, indicating symmetry in the temperature distribution.

PREREQUISITES
  • Proficiency in MATLAB programming
  • Understanding of nonlinear ordinary differential equations (ODEs)
  • Familiarity with numerical methods, specifically the shooting method
  • Knowledge of thermal properties and boundary conditions in heat transfer
NEXT STEPS
  • Explore MATLAB's ode45 function for solving ODEs
  • Research the shooting method for boundary value problems
  • Learn about thermal conductivity and its impact on temperature distribution
  • Investigate advanced numerical methods for solving nonlinear ODEs
USEFUL FOR

This discussion is beneficial for engineers, physicists, and researchers working on thermal analysis, particularly those utilizing MATLAB for solving differential equations in heat transfer applications.

patric44
Messages
308
Reaction score
40
Homework Statement
the temperature distribution of a current carrying wire using Matlab using the shooting method ?
Relevant Equations
in the figure .
hi guys
i was trying to solve this non linear ode using the shooting algorithm in Matlab :
Untitled.jpg

i am not sure how to solve it using the normal shooting algorithm i have , since no other boundary at x = L/2 was given to check the shooting ?!
Matlab:
function dTdx = bar_temp(x,y)
k = 72;
h = 2000;
epsilon = 0.1;
sigma = 5.67e-8;
i = 2;
rho = 32e-8;
Tinf = 300;
D = 7.62e-5;
L = 4e-3;
p = (4*h)/(k*D);
q = (4*epsilon*sigma)/(k*D);
z =-(i^2*rho)/(k*(pi/4*D^2)^2);
dTdx = [y(2);(p*(y(1)-Tinf))+(q*(y(1)^4-(Tinf)^4))+z];
end

Matlab:
function r = bar_res(IC_guess)
T0 = 300;
TL = ??;
L = 4e-3;
[x,y] = ode45(@bar_temp,[0,L/2],[T0 IC_guess]);
r = y(end,1)-TL;
end

Matlab:
L = 4e-3;
T0 = 300;
guess = fzero(@(x)bar_res(x),-50);
[x,y] = ode45(@bar_temp,[0,L/2],[T0 guess]);
plot(x,y(:,1));
xlabel('x')
ylabel('T')
title('Temperature Distribuiton')
 
Physics news on Phys.org
Since the temperature is symmetric with respect to L/2, T = 300 at x = L
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
3K
Replies
5
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
10K
  • · Replies 4 ·
Replies
4
Views
2K