Subido por RICARDO HERNANDEZ

Práctica Ley de Newton Enfriamiento/Calentamiento con Octave

Anuncio
UNIVERSIDAD POLITECNICA DEL VALLE DE
MEXICO
RAMIREZ HERNANDEZ RICARDO ULISES
8150301
FERNANDO GOMEZ SALAS
ECUACIONES DIFERENCIALES
La tercera práctica se trataba de utilizar el programa MatLab o en dado caso Octave, debido a que
cuento con un equipo de gama baja, opte por elegir Octave Online, el problema al que yo le di
solución fue el No.16 de Ley de Newton enfriamiento/calentamiento.
16. Dos grandes tanques A y B del mismo tamaño se llenan con fluidos diferentes. Los fluidos en
los tanques A y B se mantienen a 0° C y a 100° C, respectivamente. Una pequeña barra de metal,
cuya temperatura inicial es 100° C, se sumerge dentro del tanque A. Después de 1 minuto la
temperatura de la barra es de 90° C. Después de 2 minutos se saca la barra e inmediatamente se
transfiere al otro tanque.
Después de 1 minuto en el tanque B la temperatura se eleva 10° C. ¿Cuánto tiempo, medido desde
el comienzo de todo el proceso, le tomará a la barra alcanzar los 99.9° C?
El código fue el siguiente:
clear, close all,
Tini=100;
alpha=-0.1;
Tenv=25;
t=0:0.01:60;
K=10;
TEnv=Tenv*ones(size(t));
Trange=40:10:100;
p=7;
KK=zeros(p,1);
TT=zeros(length(t),p);
T=Tenv+K*exp(alpha*t); % The equation .
for n=1:p
KK(n)=Trange(n)-Tenv;
end
for n=1:p
TT(:,n)=Tenv+KK(n)*exp(alpha*t);
end
%-----------------------------FIGURES-------------------------------------figure, plot(t,T,t,TEnv,'r'), grid on, axis([0 60 0 100])
xlabel(' Time in minutes'),ylabel(' Temperature in °C');
title(' Cooling Temperature of glass of water with initial value 100 °C')
legend(' Temperature of the Glass','Temparature of the environement');
figure, surf(TT), shading interp, xlabel('Initial Temperature test number'),
ylabel('Time in Minutes'), zlabel(' Temperature in ° C');
title(' Temperature Profil for different Initial values vs Time')
axis([1 7 0 6000 0 100])
R=Tenv*ones(size(TT));
hold on, surf(R),shading interp, hold off
set(gca,'YTickLabel',linspace(0,60,p))
colorbar,
figure,plot(t,TT);grid on,xlabel(' Time in minutes'),ylabel(' Temperature in °C');
title(' Different initial temperatures with same Proportion constant ');
Después de varios intentos y códigos fallidos, decidí pedir apoyo a los compañeros del salón y a
externos de la universidad que saben más acerca del tema, los resultados fueron exitosos, aunque
llevo más tiempo de lo esperado.
Descargar