You are on page 1of 2

Output:

Length,m Temperature,K heat flux W/m2 error

0.2 727.86 -1.3253e+05 597.58

0.2 729.15 -1.3301e+05 8.7568

0.2 729.17 -1.3301e+05 -0.003645

0.2 729.17 -1.3301e+05 2.2235e-08

0.2 729.17 -1.3301e+05 0

0.2 729.17 -1.3301e+05 0


MATLAB code:

% function file for iterative solution of ODE boundary value

function ff=bvp(x,T,Qx)
K=30*(1+(0.002*T)); % thermal conductivity W/m K
dTdx=-(Qx/K); % temperature gradient
fy=[dTdx];

%run file for iterative solution of ODE boundary value


clc
clear all
tspan=[0 0.2]; % length span
yo=290; % initial temperature in Kelvin
TB=1273; % black body temperature in Kelvin
Qx(1)=-100000;
[t,T]=ode45(@bvp,tspan,yo,[],Qx(1));
f(1)=Qx(1)-(5.676*10^(-8)*((T(end,1)^4)-(TB)^4));
Qx(2)=-150000;
[t,T]=ode45(@raghu,tspan,yo,[],Qx(2));
f(2)=Qx(2)-(5.676*10^(-8)*((T(end,1)^4)-(TB)^4));
for i=2:7
Qx(i+1)=Qx(i)- ( f(i)*(Qx(i)-Qx(i-1))/(f(i)-f(i-1)));
[t,T]=ode45(@raghu,tspan,yo,[],Qx(i+1));
f(i+1)=Qx(i+1)-(5.676*10^(-8)*((T(end,1)^4)-(TB)^4));
format shortg
disp([t(end,1) T(end,1) Qx(i+1) f(i+1)])
plot(t,T)
title(‘length vs temperature’)
xlabel(‘length t’)
ylabel(‘temperature T’)
end

You might also like