Está en la página 1de 1

%Ejemplo 12.

4 Capacidad calorifica de un gas


%Defina los daots medidos
T=[250:50:800,900,1000,1500];
Cp=[0.791, 0.846, 0.895, 0.939, 0.978, 1.204, 1.046, 1.075, 1.102, 1.126, 1.148,
1.169, 1.204, 1.234, 1.328];
%Defina un arreglo mas fino de temperaturas
new_T=250:10:1500;
%Calcule nuevos valores de capacidad caloroififca usando
%cuatro diferentes modelos polinomiales
Cp1=polyval(polyfit(T,Cp,1), new_T);
Cp2=polyval(polyfit(T,Cp,2), new_T);
Cp3=polyval(polyfit(T,Cp,3), new_T);
Cp4=polyval(polyfit(T,Cp,4), new_T);
%Grafique los resultados
subplot(2,2,1)
plot(T,Cp,'o', new_T,Cp1)
axis([0,1700,0.6,1.6])
subplot(2,2,2)
plot(T,Cp,'o', new_T,Cp2)
axis([0,1700,0.6,1.6])
subplot(2,2,3)
plot(T,Cp,'o', new_T,Cp3)
axis([0,1700,0.6,1.6])
subplot(2,2,4)
plot(T,Cp,'o', new_T,Cp4)
axis([0,1700,0.6,1.6])

%Ejemplo 12.2
%Termodinamica
clear, clc
T=[100, 150 200,250,300,400,500]';
v=[1.6958, 1.9364 2.172,2.406 ,2.639 ,3.103 , 3.565]';
u=[2506.7, 2582.8, 2658.1, 2733.7, 2810.4, 2967.9, 3131.6]';
h=[2676.2, 2776.4, 2875.3, 2974.3, 3074.3 3278.2 3488.1]';
props=[v,u,h];
newT=[100:25:500]';
newprop=interpl(T,props,newT);
disp('Porpiedades de vapor a 0.1 MPa')
disp('Temp Specific Volume Internal Energy Enthalpy')
disp('C m^3/kg kJ/kg kJ/kg')
fprintf('%6.0f %10.4f %8.1f %8.1f \n' ,[newT,newprop]')

También podría gustarte