Precise water vapor pressure value calculations

Precise water vapor pressure value calculations

Compur Biof Med Vol. 19. No. 2. pp. 129-130, 1989. Printed m Great Britain. OOIO-4825189 $3.&I+ .oO ,p1989 Pergamon Press plc PRECISE WATER VAPOR PR...

173KB Sizes 1 Downloads 75 Views

Compur Biof Med Vol. 19. No. 2. pp. 129-130, 1989. Printed m Great Britain.

OOIO-4825189 $3.&I+ .oO ,p1989 Pergamon Press plc

PRECISE WATER VAPOR PRESSURE VALUE CALCULATIONS W. K. PRUSACZYK Exercise Physiology Laboratory, Physical Education Building, Rm 102, Umversity of Georgia. Athens. GA 30602. U.S.A. (Received 30 March 1987; received for publication 7 August 1987)

Abstract-Precise values for water vapor pressure in saturated systems may be computed using the Goff-Gratch equation. This equation has been adapted for convenient use on microcomputers. A Microsoft BASIC listing of the programming version of the equation is presented. This BASIC version may be easily translated into other high level programming languages and thus is suitable for use on many computer systems for routine laboratory computations. Water vapor pressure IBM-PC BASIC

Respiratory physiology

Exercise physiology

INTRODUCTION

many clinical and experimental investigations of respiratory and metabolic function, such as those required in exercise physiology, it is convenient to perform repeated calculations with a computer. In performing these calculations, it is frequently necessary to have accurate water vapor pressure (WVP) values. WVP tables are available, but for simplicity these tables have often been greatly abbreviated. More complete tables provide accurate values but are time consuming to use when many calculations must be made at different system temperatures. An additional drawback of these look-up tables is that precise WVP values are limited to those listed in the table and other values must be interpolated from the listed values. Computer users are thus faced with the dilemma of how best to obtain the required WVP values. Users may apply a single WVP value over the entire temperature range ofinterest, but with varying system temperatures this will unavoidably introduce error. Users may consult look-up tables repeatedly, but such an approach is tedious and is subject to error both in obtaining the value from the table and in entering the value into the computer. Complete WVP tables for the temperature range of interest may be stored in the computer and referenced as necessary, but as the temperature range increases the amount of memory required may become large. Additionally, this solution retains the problem of requiring interpolation for unlisted values. Fortunately, over the range of system temperatures from 0 to 100% WVP for saturated systems is accurately described by a logarithmic function. Goff and Gratch [l] developed an equation for precise calculation of WVP within this temperature range. The Goff-Gratch equation for WVP is:

In

PH20 = alog[-7.90298(T,/T_ 1 3816 X lo-7 +8.1328

x

lo-3

l)+ 5.02808 log(TJT) x

([email protected]

7’r5))

x

(f0(~349149x1~5/~-~)1_

_

1) I)]

In the equation, alog is the antilogarithm (base lo), T, is 373.16”C, T is the temperature of the system (“C) and log is the logarithm (base 10). The equation provides the precise WVP for a system at T degrees Kelvin in atmospheres of pressure.

W. K. PRUSACZYK

130

COMPUTATIONAL

ROUTINE

Presented below is a form of the Goff-Gratch equation written in Microsoft BASIC for an IBM-PC microcomputer. The listing utilizes modularization of the equation and expresses log functions as base 10. This process allows compaction of the equation to fit on a single program line and corrects for computer computation of log functions in base e. 10 T=T+273.16: TS=373.16: XPl= 11.344*(1 -T-IS): XP2= - 3.49149*(TS/T- 1) 20 WVP = (IO-( - 7.90298*(TS/T - 1) +(5.02802*(LOG(TS/T)/LOG(lO))) -(1.3816*10~-7*(10-XP1-1))+(8.1328*10~-3*(10-XP2-1))))*760 In this listing Tis input as the system temperature in degrees Celsius, then is converted in line 10 to degrees Kelvin, TS is the temperature 373.16 K, XPl and XP2 are the complex exponents of the Goff-Gratch equation. The water vapor pressure is returned as WVP. Line 10 allows compaction of the full equation by substituting constants for the complex exponents. In line 20, log values are converted from base e to base 10 and the computation is performed. In this listing, WVP values are computed in mmHg. For other units of measurement the final term in line 20 (760 in the above equation) should be replaced by the appropriate conversion term as described by Hall and Brouillard [2] and listed below: kilopascals (kPa) pounds per square inch (psi) inches of mercury (inHg) centimeters of water (cmH20) millibars (mb)

101.3; 14.696; 29.9213; 1033.26; 1013.25. SUMMARY

The two program lines described may be conveniently added to existing metabolic or respiratory computation programs as a subroutine requiring only the input of the system temperature in degrees Celsius. This short routine avoids the problems inherent in the use of look-up tables (whether performed manually or by the computer) while giving precise WVP values for system temperatures ranging from 0 to 100 C. These two lines occupy only 185 bytes of programming memory on an IBM-PC, thus they are a highly cost-effective routine in terms of precision and in computational time and memory space. Use of this routine is indicated any time highly accurate WVP values are required for systems with temperatures varying within the specified range.

REFERENCES 1. J. A. Goff and S. Gratch. Low-pressure properties of water from -160 to 212 F, Trans. Am. Sot. Neat. Vent. Engrs 52, 955122 (1946). 2. J. R. Hall and R. G. Brouillard, Water vapor pressure calculation, .I. oppl. Physiol. 58, 2090 (1985). About the Author - WM KEITH PRUSACZYK received his B.S. degree with honors in psychology from Southern Illinois University in 1972 and his MS. degree in experimental/physiological psychology from Washington State University in 1981. Mr Prusaczyk is currently completing his doctorate in exercise physiology at the University of Georgia at Athens, where his studies have centered on the perception of effort during exercise and computer applications in data acquisition and analysis in the field of exercise physiology. Mr Prusaczyk is a member of the Phi Kappa Phi National Honors Society, the American Association for the Advancement of the Sciences, the Association for Computing Machinery, the American College of Sports Medicine and the Midwestern Psychological Association.