Temperature Distribution of Current Carrying Wire in Matlab

Click For Summary
The 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 is uncertain about implementing the shooting method due to the absence of a boundary condition at x = L/2. The provided MATLAB code defines functions for calculating temperature changes and residuals, but it requires a boundary condition at the other end of the wire. The user attempts to use the fzero function to find an initial guess for the temperature at the wire's end. The symmetry of the temperature distribution is noted, indicating that the temperature is 300 K at x = L.
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
 
The book claims the answer is that all the magnitudes are the same because "the gravitational force on the penguin is the same". I'm having trouble understanding this. I thought the buoyant force was equal to the weight of the fluid displaced. Weight depends on mass which depends on density. Therefore, due to the differing densities the buoyant force will be different in each case? Is this incorrect?

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
2K
  • · 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