资源简介
该程序组共包含10个子程序,全部为计算水和水蒸汽性质的子程序,采用的是国际公式化委员会制定的水和水蒸气热力性质(IFC67)公式。各子程序分别是: TSK.m 求某下压力饱和温度。 PSK.m 某温度下饱和压力。 HS.m 已知比焓、比熵,求其它性质。 PX.m 已知压力、干度,求其它性质。 PV.m 已知压力、比熵,求其它性质。 PTG.m 已知压力、温度,求饱和汽、过热蒸汽的性质。 PTF.m 已知压力、温度,求饱和水、过冷水的性质。 PT.m 已知压力、温度,求其它性质。 PS.m 已知压力、比熵,求其它性质。 PH.m 已知压力、比焓,求其它性质 该程序是汽轮机设计和热力系统设计的好帮手,减少了查表的麻烦。
代码片段和文件信息
function out = IAPWS_IF97(funin1in2)
% IAPWS_IF97(funin1in2)
% 102 water functions of water properties based on the International Association on Properties of Water and Steam
% Industrial Formulation 1997 (IAPWS-IF97) IAPWS-IF97-S01 IAPWS-IF97-S03rev IAPWS-IF97-S04 IAPWS-IF97-S05 Revised
% Advisory Note No. 3 Thermodynamic Derivatives from IAPWS Formulations 2008 Release on the IAPWS Formulation 2008
% for the Viscosity of Ordinary Water Substance 2008 Revised Release on the IAPWS Formulation 1985 for the Thermal
% Conductivity of Ordinary Water Substance.
%
% fun is the desired function that may take 1 input in1 or 2 inputs in1 and in2. in1 and in2 should be scalar
% column vector or matrix and in1 and in2 should be the same size. If a row vector is entered it is transposed. If a
% scalar is entered for one input and the other input is a vector or matrix then the scalar is repeated to form a
% vector or matrix of the same size as the other input.
if nargin<2 out = NaN; return end
if ~any(strcmpi(fun{‘k_pT‘‘k_ph‘‘mu_pT‘‘mu_ph‘‘dmudh_ph‘‘dmudp_ph‘‘dhLdp_p‘‘dhVdp_p‘‘dvdp_ph‘‘dvdh_ph‘‘dTdp_ph‘‘cp_ph‘‘h_pT‘‘v_pT‘ ...
‘vL_p‘‘vV_p‘‘hL_p‘‘hV_p‘‘T_ph‘‘v_ph‘‘psat_T‘‘Tsat_p‘‘h1_pT‘‘h2_pT‘‘h3_rhoT‘‘v1_pT‘‘v2_pT‘‘cp1_pT‘ ...
‘cp2_pT‘‘cp3_rhoT‘‘cv3_rhoT‘‘alphav1_pT‘‘alphav2_pT‘‘alphap3_rhoT‘‘betap3_rhoT‘‘kappaT1_pT‘‘kappaT2_pT‘...
‘dgammadtau1_pT‘‘dgammadpi1_pT‘‘dgammadtautau1_pT‘‘dgammadpipi1_pT‘‘dgammadpitau1_pT‘‘dgammadtau2_pT‘ ...
‘dgammadpi2_pT‘‘dgammadtautau2_pT‘‘dgammadpipi2_pT‘‘dgammadpitau2_pT‘‘dphidtau3_rhoT‘‘dphiddelta3_rhoT‘ ...
‘dphidtautau3_rhoT‘‘dphiddeltatau3_rhoT‘‘dphiddeltadelta3_rhoT‘‘dTsatdpsat_p‘‘T1_ph‘‘T2a_ph‘‘T2b_ph‘‘T2c_ph‘ ...
‘T3a_ph‘‘T3b_ph‘‘v3a_ph‘‘v3b_ph‘‘h2bc_p‘‘h3ab_p‘‘TB23_p‘‘pB23_T‘‘p3sat_h‘‘v3a_pT‘‘v3b_pT‘‘v3c_pT‘ ...
‘v3d_pT‘‘v3e_pT‘‘v3f_pT‘‘v3g_pT‘‘v3h_pT‘‘v3i_pT‘‘v3j_pT‘‘v3k_pT‘‘v3l_pT‘‘v3m_pT‘‘v3n_pT‘‘v3o_pT‘ ...
‘v3p_pT‘‘v3q_pT‘‘v3r_pT‘‘v3s_pT‘‘v3t_pT‘‘v3u_pT‘‘v3v_pT‘‘v3w_pT‘‘v3x_pT‘‘v3y_pT‘‘v3z_pT‘‘T3ab_p‘ ...
‘T3cd_p‘‘T3ef_p‘‘T3gh_p‘‘T3ij_p‘‘T3jk_p‘‘T3mn_p‘‘T3op_p‘‘T3qu_p‘‘T3rx_p‘‘T3uv_p‘‘T3wx_p‘}))
out = NaN;return
end
if nargin==2
dim = size(in1);
if length(dim)>2out = NaN;returnend
if dim(1)==1 && dim(2)>1in1 = in1‘;end
out = feval(funin1);
end
if nargin==3
dim1 = size(in1);dim2 = size(in2);
if length(dim1)>2 || length(dim2)>2out = NaN;returnend
if any(dim1~=dim2);
if dim1==ones(12)in1 = in1*ones(dim2);dim1=dim2;
elseif dim2==ones(12)in2 = in2*ones(dim1);
elseif dim1==fliplr(dim2)in1 = in1‘;dim1=dim2;
else out = NaN;return
end
end
if dim1(1)==1 && dim1(2)>1in1 = in1‘;in2 = in2‘;end
out = feval(funin1in2);
end
end
%% stand alone functions
function k = k_pT(pT)
%
- 上一篇:matlab2014中文.txt
- 下一篇:uwb定位算法
评论
共有 条评论