BEGIN_DOC Psychro.doc version 1.2, Jan 14, 1997 (c) James Weisbin. Psychro for the HP48 SX/GX series calculators, (c)'93-'97 James Weisbin, is a program for doing psychrometric calculations. Both SI and English units are supported, in a manner consistent with the HP48 Equation Library. The program is written entirely in System-RPL, for speed. Psychro 1.2 is distributed as a library with ID number 1766, approximate size 8 Kbytes. Psychro is "shareware", $15.00 U.S. to register. Send check to James Weisbin, 115 West Broadway #3, New York City, NY 10013, USA e-mail: jweisbin@compuserve.com phone: 212-615-3798 Changes from version 1.1: 1. Fixed slight inaccuracy in dew point calculation. 2. If the wet bulb temperature input is greater than the dry bulb input, the program will adjust the wet bulb temperature to equal the dry bulb temperature. 3. When calculating values at very low temperatures (ice regime), if vapor pressure or humidity ratio go below zero, make them equal to zero. 4. Changed formulas to agree with latest ASHRAE data. WARNING AND DISCLAIMER: No claims or guarantees of accuracy or completeness are in any way made or implied by this author. USE AT YOUR OWN RISK. This program can be copied and distributed provided that this document accompanies it, and no modifications are done without the author's permission. PLEASE BACK UP YOUR CALCULATOR'S MEMORY BEFORE USING THIS SOFTWARE. I am in no way responsible for any loss of data through the use or misuse of this program. (Etc..!) Psychro v1.2 is distributed as an auto-attaching library, ID number 1766, size 8206.5 Bytes, checksum # 4151h. To install the library, first transfer the binary file PSYCH12.LIB to your machine using Kermit in Binary transfer mode on both the HP48 and the host machine. Then put the library on the stack, by pressing the menu key that shows up labeled PSYCH12.LIB (only PSYCH will appear in the menu). You should then see this on the stack: Library 1766: PSY... Decide which port you want to store the library in. Note that port 0 doesn't get backed up when you use the Archive command, so you might want to use port 1 or 2 if you have a battery backed card in one of those. Enter the number of the port (e.g.: 1) and then press STO. Then turn your machine off and on again. The screen will flash off and back on again when the '48 reconfigures itself. Now press the LIBRARY key, (right shift 2 on the HP48/GX) and keep pressing NXT until you see PSYCH on the menu. If you don't see it, it hasn't been installed properly - try again. To uninstall the program, go to the MEMORY menu on the HP48/SX, or left shift LIBRARY on the HP48/GX. Enter 1766 on the stack and press DETACH, then PURGE the library by doing :n:1766 PURGE where n is th port number 0, 1, or 2. To run the program, make sure that you have switched to the directory where you wish to keep your data. Note: Psychro "auto-attaches" at start-up, and is therefore available in any directory, including the home directory. If you've managed to install Psychro correctly, then go to the directory that you wish to run Psychro from. Now press PSYCH from the library menu to start the program. You will now see a display with the title PSYCHRO, and the following items: Dry Bulb & Wet Bulb Dry Bulb & Rel Humid Dry Bulb & Dew Point Dry Bulb & Hum Ratio Dry Bulb & Vap Press. Mixture Calculation The top item will be highlighted (not the title). Press the arrow keys to select the set of known variables that you want to use. If you keep pressing the arrow keys, you will get to the next "page", which has only the one item: Change Pressure. The menu keys allow you to select either SI units (flag 60 clear) or ENGlish units (flag 60 set). HELP brings up 2 pages of help. VARS allows you to look at the results of your calculations (with units attached) and copy them to the stack if desired (see VARS instructions below). GO is the same as ENTER and means "do this calculation now". EXIT quits the program. More details follow: GO Carry out the selected calculation. You will be prompted for the data in either SI or ENG units. PSYCHRO does all of its computations internally with real numbers and then appends either SI or ENGlish units when in VARS mode. Note: You can append units at the prompt, but they will be ignored - only the number part will be used. This is also true even if you use the interactive stack to echo a previous result into the command line. So, for example, when in SI mode, entering '75_psi' at the temperature prompt will be interpreted as 75 degrees C. When the calculation is done, you will automatically be placed in the VARS menu/display, and you can scroll around with the arrow keys to select the data. Press ENTER or ->STK to copy the data to the stack, and answer when prompted "copy what data" (one or all). Press VIEW to see the selected data if not all of it is visible. Press MAIN to exit VARS mode. NOTE: If you change the pressure, and then use VARS without first doing any calculations, all the results will be your old data with the new pressure and will therefore not be correct. REMEMBER TO RECALCULATE. Mixture calcs: These are the same as above, but you will be prompted for two sets of data (State 1 and State 2) and the volume at each state. NOTE: Volume flow rates at each state are converted to a mass AT THAT CONDITION (ie using the density at that state) and then added together for the total mass, which is then converted back to the volume flow rate at the final mixture condition. That's why the final volume flow rate will usually differ from the sum of the 2 volume flow rates given initially. EXIT quit the program. EXIT can also be initiated by pressing the backspace key or ON (ATTN). The following key presses are supported: right-arrow, down-arrow next item (with repeat) up-arrow, left arrow previous item (with repeat) left-shift right-arrow, left-shift down-arr, nextnext 6th item. left-shift left-arrow, left-shift up-arr, prev prev 6th item. right-shift right-arrow, rt-shift down-arr go to last item. right-shift left-arrow right-shift up-arr go to first (top) item. right-shift OFF pauses program and turns the machine off. The 48 will beep when restarted, and resume the operation of Psychro. Psychro creates a global variable (library object) named psyPAR, to which it saves the last results of your calculations. The variable is written and read using utilities provided as part of Raymond Hellstern's LIB library generator/decompiler (thanks to Raymond and Detlef Mueller for RPL48). NOTE:The library ID (1766) is encoded in psyPAR, and therefore can't be changed by simply decompiling the library and editing $ROMID. If you need to have a different number, I'll send you a recompiled lib with the number of your choice (registered users only). Use this program to start Psychro if you always want your data saved to the same directory (eg mydir): %%HP: T(3)A(D)F(.); \<< PATH \-> p \<< HOME mydir PSYCHRO p EVAL \>> \>> The program checks for data within the following ranges: dry bulb, wet bulb, and dewpt temp: -60 to +70 degrees C, wb cant be higher than db Pressure: 25 kpa (>+10,000 feet) to 200 kpa (< approx -2000 feet below sea level). Relative Humidity: 0 to 100% (see note 1 below). Humidity Ratio: 0 to .28 kg/kgda (see note 1 below). Vapor Pressure: 0 to 32 kpa Volume rate: 0 litres/second to MAXREAL. The program may be innacurate or produce errors at extremes approaching the values given above. NOTE 1: Most psychrometric programs will not allow 0 to be input for vapor pressure, humidity ratio, or relative humidity, since, for perfectly dry air, "dew point temperature" is not defined. Instead, I have allowed this input, and set the dew point temperature to absolute zero. DO NOT INTERPRET A DEW POINT TEMPERATURE AT ABSOLUTE ZERO TO BE VALID DATA. Use your common sense, and throw out data which does not make any sense. NOTE 2: The psychrometric "chart" is inherently inaccurate at low temperatures, and will not agree with this program at extremely low or high temperatures or pressures. NOTE 3: Psychro converts all input to SI and does its calculations internally in SI, then converts back to imperial units if necessary. Therefore, if you input a temperature, for example, of 70 deg F, you might find that it has been changed to 69.999999 degrees on output. References: ASHRAE "Book of Fundamentals" 1993, SI edition. Psychro has been tested on rev "B" (HP48/SX) and rev "M" (HP48/GX) calculators and should run on all models. Only supported entry points are used, but please, PLEASE, please remember to back up your data BEFORE running Psychro, just in case. Worked examples: Reference: "Modern Heating, Ventilating, and Air Conditioning", George Clifford, Prentice Hall, 1990. Note: answers will differ from those found with a printed psychrometric chart. This is primarily due to the inaccuracy of the chart, as well as the difficulty of reading it accurately. Set mode FIX 4 for these examples: Example 1 ( see illustrative problem 4-8): Determine the psychrometric properties of moist air existing at 70 degree F. DB and 60 degrees F. WB and 29.92 in. Hg barometric pressure. Convert all the properties to SI units as well: Go to the HP's native units menu (right-shift-unit on HP48/GX) and select the PRESSURE menu. Key in 29.92, then press inHg from the menu to append inHg units. You should see 29.92_inHg in stack level 1. Now press left-shift-psi to convert to psi, and see 14.6953_psi on the stack. Now invoke PSYCHRO. From the main menu, select ENG units, and then scroll to the second page and select "Change Pressure", and press ENTER or GO. Press ON once to clear the command line of the previous value, and then press ^stk from the edit menu. You should see the pressure value from above. Now press ECHO to copy it into the command line, then press ON again to get back to the command line, and finally press ENTER again. You have now changed the pressure default to 14.6953 psi - this setting will be saved in psyPAR until you change it. (Note that the appended units are actually ignored - see the documentation above). You will be returned to the main menu. Now scroll up to "Dry Bulb & Wet Bulb" and press GO or ENTER. When prompted for the Dry Bulb, key in 70, and 60 for the Wet Bulb. If you make a mistake, press ON once to clear the command line, or once again to go back to the main menu to start again. After a brief pause, the results should be displayed as follows. (Use the arrow keys to scroll between the first and second pages). Note: some symbols will appear differently on the HP display, such as "deg", which will display as a small circle: 1st screen: 2nd page: PSYCHRO PSYCHRO tdb: 70.0000_degF v: 13.5422_ft^3/lb twb: 60.0000_degF P: 14.6953_psi tdp: 53.7213_degF vP: 0.2039_psi W: 0.0088_lb/lbda u: 0.5551 RH(%): 56.1316 vol: 0.0000_ft^3/min h: 26.3580_Btu/lb To convert to SI units, press MAIN to get back to the main menu, and then select SI units. Now press VARS and see the following: 1st screen: 2nd page: PSYCHRO PSYCHRO tdb: 21.1111_degC v: 0.8454_m^3/kg twb: 15.5556_degC P: 101.3207_kPa tdp: 12.0674_degC vP: 1.4059_kPa W: 0.0088_kg/kgda u: 0.5551 RH(%): 56.1316 vol: 0.0000_l/s h: 43.4602_kJ/kg Some things to note: the volume flow rate is always set to zero unless you have selected "Mixture Calculations" and supplied a value for the volume flow rate. Also, don't try to convert enthalpy (h) using a straight unit conversion outside of the Psychro program, because this will yield wrong results. This is due to the fact that the SI system uses 0 degrees C as a basis, while the English (Imperial or "Customary" units) uses 0 degrees F as the basis. Example 2 (illustrative problem 5-1): How much heat is required to heat 3000 cfm of moist air at 45 degrees F DB and 35 degrees F WB to a final temperature of 90 degrees F DB without change of humidity? Change back to English units. Select "Dry Bulb & Wet Bulb" from the main menu, and press GO or ENTER. Key in 45 for the DB and 35 for the WB and see the results. Scroll down to the value for v (specific volume - on second page screen) and press ->stk or ENTER. You will be prompted "Copy what data?" Select ONE to copy the value of 12.7654_ft^3/lb to the stack. Scroll down to vol (volume flow rate) and use the same method to put that on the stack (the value is 0.0000_ft^3/min - don't worry for now). Now scroll back up and copy the value 12.9917_Btu/lb for h (enthalpy) to the stack. Now press MAIN and go back to the main menu and select "Dry Bulb & Humid Ratio", and press GO or ENTER. Key in 90 for the DB. When prompted for the humidity ratio, just press enter to use the previously calculated value of 0.0020_lb/lbda (remember that the problem stated that the moisture content has not changed.) You should see (briefly) "Solving for Wet Bulb Temp..." and then get the new results. As before, put the new value for h (23.8019_Btu/lb) on the stack. Now quit the program (press MAIN then EXIT). You now have 4 unit objects on the stack. Press SWAP, then - , to subtract the enthalpies and get the delta h of 10.8102_Btu/lb. Now press SWAP again to get the volume flow rate units in stack level 1. Now key in 3000, go to the shifted units menu (left shift units on the GX) and press SWAP ->UNIT. This will append the units of ft^3/min to the value of 3000. Press * to multiply 3000_ft^3/min by 10.8102_Btu/lb, then SWAP, then / to divide 32430.6000_Btu*ft^3/(lb*min) by 12.7654_ft^3/lb. The result is now 2540.5079_Btu/min. Go to the units menu and key in 1_Btu/h, then CONV, for the final answer of 152430.4761_Btu/h. Example 3 (Illustrative example 5-3): 300 cfm of air at 35 degrees F DB and 100% RH are mixed with 600 cfm of air at 85 degrees F DB and 50 % RH. What will be the DB temperature, humidity ratio (in grains per lb of dry air), and enthalpy of the mixture? Go to the main menu and select "Mixture Calculation" and then press GO or ENTER. The next screen will say "Select knowns: State 1" at the top. Select "Dry Bulb & Relative Humidity" and press GO or ENTER, then key in the values of 35 for the DB, 100 for the percent relative humidity, and 300 for the volume flow rate (cfm). Now you will see the screen which says "Select knowns: State 2" at the top. Repeat the procedure and key in the values of 85, 50, and 600 respectively. You will briefly see "Solving for Wet Bulb Temp...", and then the results. Read the DB (tdb) of 67.0900 degrees F. (Note that, by direct calculation of the mixture, using the masses and specific volumes at each condition, the temperature should be 67.08 degrees F, however, a small error is introduced because PSYCHRO does its calculations in SI units and then converts back to English units.) Now read the enthalpy as 26.7860 Btu/lb. Finally, put the humidity ratio (W) of .0098_lb/lbda on the stack and exit the program. Now convert that value to grains. Note: "lbda" is not a valid HP48 unit. It is used to identify the value as a ratio, because lb/lb is not allowable. To convert to grains, first edit off the "lbda" to leave .0098_lb, and then convert to 68.6_grains. Tips: To save all the data at once, answer ALL at the prompt "Copy what data? Then exit the program. There will be at least eleven tagged unit objects on the stack. Go to the PRG OBJ menu (PRG LIST on the GX), key in 11, and then press ->LIST to put all eleven items in one list. You can then store that into a variable for future use. For example, you could store it in a list of lists for later browsing with my Roldx program. (Also shareware and available where you downloaded Psychro from). To reverse the process, put the list on the stack and press EVAL. There is a minor bug in the revision M HP48/GX which is as follows: If you put the relative humidity on the stack, and then press EVAL, you will get a binary integer, the evaluated number, and an External object. This happens whenever you EVAL an object which is tagged with a string containing certain characters such as a left or right bracket. For PSYCHRO, this is only the relative humidity. The bug is fixed in rev P and later. Don't EVAL the external! Just drop the bad objects from the stack, and continue as normal. END_DOC