Home > atmlab > h2o > thermodynamics > relative_humidity.m

relative_humidity

PURPOSE ^

RELATIVE_HUMIDITY relative humidity rh

SYNOPSIS ^

function rh = relative_humidity(ew,T,p)

DESCRIPTION ^

 RELATIVE_HUMIDITY     relative humidity rh

 FORMAT    rh = relative_humidity(ew,T,p)
        
 OUT   rh  relative humidity [%]
 IN    ew  water vapor pressure [Pa], a scalar or a vector
       T   air temperature [K], a scalar or a vector
       p   air pressure [Pa], a scalar or a vector

 EXAMPLE:
       rh = relative_humidity(1596, 298, 100000)
       ew = 50.0031

 ACCURACY: RELATIVE_HUMIDITY calculates relative humidity according to
           thermodynamic functions without any assumptions.
           The accuracy is decreased if air pressure is not provided.

 Reference: A short course in cloud physics (Chapter II, water vapor and
             its thermodynamic effects); 1996, By: R. R. Rogers and M. M. Yau
             page: 17, Eq.:2.20

 2009-08-15   Created by Isaac Moradi.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

relative_humidity.m

SOURCE CODE ^

0001 function rh = relative_humidity(ew,T,p)
0002 % RELATIVE_HUMIDITY     relative humidity rh
0003 %
0004 % FORMAT    rh = relative_humidity(ew,T,p)
0005 %
0006 % OUT   rh  relative humidity [%]
0007 % IN    ew  water vapor pressure [Pa], a scalar or a vector
0008 %       T   air temperature [K], a scalar or a vector
0009 %       p   air pressure [Pa], a scalar or a vector
0010 %
0011 % EXAMPLE:
0012 %       rh = relative_humidity(1596, 298, 100000)
0013 %       ew = 50.0031
0014 %
0015 % ACCURACY: RELATIVE_HUMIDITY calculates relative humidity according to
0016 %           thermodynamic functions without any assumptions.
0017 %           The accuracy is decreased if air pressure is not provided.
0018 %
0019 % Reference: A short course in cloud physics (Chapter II, water vapor and
0020 %             its thermodynamic effects); 1996, By: R. R. Rogers and M. M. Yau
0021 %             page: 17, Eq.:2.20
0022 %
0023 % 2009-08-15   Created by Isaac Moradi.
0024 
0025 es = e_eq_water(T);
0026 
0027 % use simply e/es if p isnt given
0028 if nargin < 3
0029     rh = 100 .* ew ./ es;
0030 else
0031     rh = 100 .* ew .* (p - es) ./ (es .* (p -ew));
0032 end
0033 
0034 
0035

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005