first publish 6/28/05.

Note: all programs offered here are published under the Q Public License V1.0. Please read and proceed only if you do aggree.

Some Programs for the HP41

and few for the HP-42S. (See also: more HP-41 programs, HP-41 emulators. and HP-42S programs and emulator.)
Mollier's h,X program for water-humidified air
no need for tables and diagrams anymore, from -20 up to 100 degree centigrade accurate enough for everyday use in air condition technology
Normal Distribution
"The HP-32E provides two important functions for problems dealing with normal distributions." Now available on the HP41 too, even more...
More ASAP
I do my best

Mollier's h,X Program for Water-Humidified Air

This is the only program I ever sold for money, only once to my Prof. He had no HP-41 but was just interested in the manual as I always was the first with results — with correct results.

The manual (PDF, 656kB) contains a description, examples, used formulas, program listing, and bar codes. It is a revision from 1999, alas in German, so the most essential here:

Prerequisites:
This program requires an HP-41CX, or an HP-41CV apparelled with Extended Function Module, or an HP-41C equipped with Quad-RAM and Extended Function Module. Optionally an HP82143A printer. Alternatively you may use an emulator that offers the a. m. features.
For installation only you need in addition a Bar-Code Reader (see a. m. manual) — or an emulator that reads the offered RAW files. Do not use an emulated HP-42S or any other emulator that does no «synthetics».

Installation:
To install the program you need 194 free registers in main memory (see GTO.. in PRGM mode). For easy access to the local labels there should be no key assignments for A-E, H-J, and a-e. To get all results as accurate as possible you need 59 free registers in extended memory (see EMROOM or EMDIR) to install the vapour pressure table. If calculations with approximated water vapour pressure is sufficiently omit steps 1-3 of following recipe.

  1. load and execute IPS (file mhxips.raw), it will write — or overwrite(!) — a PS file in X-Mem
  2. load and execute P (file mhxpps.raw), it displays or also prints the water vapour pressure table installed in step 1, check with the copy in the manual
  3. discard programs IPS and P from memory
  4. load program SV and do GTO.. to add an END to it. SV (=Solve) is the root finder from the PPC-ROM, of cause you may use this instead of loading SV to main memory. There is no RAW file in the ZIP for this one, COPY it from the PPC-ROM you get at HP41.org
  5. switch to USER mode and load the main program (file mhx21.raw), that way the assignment of the global label to the shifted J key is adopted as stored on the media (or RAW file, I hoped, otherwise use PASN to do so). Finish with GTO..

Functionality:
The program is of the 'interchangeable solution' type: enter a number and hit the corresponding key to store a value or hit a key without entry to calculate that value. You are prompted for missing data what you may acknowledge by entering that data and R/S or just R/S to calculate that value from other relations. If you are asked twice for the same value — »hard chese!« — you have not enough data (or my program is not foreseen to calculate that way).
The keys and their meaning:

KeyValueUnitDisplayReg.Note
AEnthalpykJ/kgdry airH1+X01 
BLoadkgwater/kgdry airX02 
CRelative Humiditybarpd/barpsPHI03 
DTemperature°CCT041
EMass of dry airkgML05 
FMerge active with stored state   2, 3
GStore active state   3, 4
HTotal pressurebarP085
ISaturation pressurebarPS096
JVolumem3V10 
aWater cooling limit°CTK 2, 6
bState before wet cooling   2, 6
cPartial vapour pressurebarPd 7
dDew point temperature°CTTAU 6, 7
eMass of water vapourkgMD 7
    Notes:
  1. Entry or calculation of a temperature differing from the previous value will void the saturation pressure.
  2. The result is used as active state.
  3. Taking into account that some users assign to keys F and G the indicated command X<>Y and RDN respectively (in order to get fast access to this stack manipulating functions under any circumstances) R/S (after the program ended normaly displaying a result) acts as a toggle between XEQ G (store state) and XEQ F (merge states).
  4. Stored are enthalpy in R11, load in R12, and mass of dry air in R13. Active state cleared.
  5. No calculation, to store value only. Additionally toggles flag 0 (see note 6).
  6. With flag 0 set (default) approximation only.
  7. For display of result only, not for entry. Value neither stored nor used in other calculations.

Used formulas:
See chapter 8 in the manual. If you are interested in this subject there is probably no need to translate the formulas.
Just one word about the approximation of pS: For fast solutions the water vapour pressure is «estimated» and then «confirmed» using the values of the stored table. I derived the approximating formula of pS by simplification of an other one given in the Handbook of Chemistry&Physics (if I remember correctly — have to find that source again). It turned out to be the best formula I know regarding the relation of program size and accuracy of the approximation in the range from -20 to nearly 100 degree centigrade.
As such I allow me to claim the intellectual property of the approximation formula and its coefficients. Use it free of charge excluding for military whatsoever and nuclear engineering.

approx. dew point °C with
and k = 19,86 if pd <= p0
or k = 22,3 if pd > p0
where p0 = 6.107·10-3 bar
valid range:
1·10-3 bar < pd < 1.0 bar
approximation formula with p0 = 6.107·10-3 bar
and k = 19,86 if J >= 0°C
or k = 22,3 for J < 0°C
valid range:
-20 °C < J < 100 °C
Just this formula only for the HP-42S here.

Normal Distribution

There are two rumours about the Gaussian Normal Distribution: natural scientist think mathematician proved the formula to be universal and mathematicians believe natural scientist observed it as a law of nature. Fact is (fact = special case of illusion), there are virtual more than one distribution functions, balanced, inclinated, lopsided, oblique, two-peeked, and so on. You must have good reasons to use just this one for your problem.

My first girlfriend's HP-32E had a Q and Q-1 function. Well, I suppose others had it too, alas not my HP-41C. After some tests with approximations here my final version. For the integration I educed the Tailor series of the Gaussian Normal Distribution, integrated it partially and - after a polynomal division - came to the recursive notation (see lines 86...95) that is iterated up to a limit of your choyce (line 96...98). The inverse function is set up as root finding process (lines 51...57) entered with a quite good estimate (lines 21...50) after invalid input is sorted out (lines 2...21).

Listing:

 01*LBL "SNN"    25 ENTER^       49 FS?C 18      73*LBL 09       97 X#0?
 02 X<0?         26 ENTER^       50 CHS          74 RCLFLAG      98 GTO 01
 03 LOG          27 STO O        51 "GI"         75 STO 10       99 RCL 10
 04 1            28 1308 E-6     52 ASTO 06      76 7FIX        100 STOFLAG
 05 +            29 *            53  E-3         77 LASTX       101 RCL N
 06 2            30 ,189269      54 X<>Y         78 ENTER^      102 2
 07 /            31 +            55 SF 10        79 X^2         103 /
 08*LBL "SN"     32 *            56 XROM "SV"    80 STO N       104 CHS
 09 X<=0?        33 1,432788     57 CF 10        81 SIGN        105 E^X
 10 LOG          34 +            58 RTN          82 STO O       106 PI
 11 STO 11       35 *            59*LBL "GII"    83 X<>Y        107 ST+ X
 12 ,5           36 1            60 ABS          84 STO M       108 SQRT
 13 X>Y?         37 +            61 SF 18        85 ABS         109 /
 14 SF 18        38 X<> O        62*LBL "GI"     86*LBL 01      110 RCL M
 15 SIGN         39 ,010328      63 ABS          87 LASTX       111 *
 16 X<>Y         40 *            64 6            88 RCL N       112 ENTER^
 17 X>Y?         41 ,802853      65 X>Y?         89 RCL O       113 FC?C 18
 18 SIGN         42 +            66 GTO 09       90 2           114 ,5
 19 FC? 18       43 *            67 LASTX        91 +           115 +
 20 -            44 2,515517     68 SIGN         92 STO O       116 FC? 10
 21 1/X          45 +            69 X<0?         93 /           117 RTN
 22 X^2          46 RCL O        70 CLX          94 *           118 RCL 11
 23 LN           47 /            71 CF 18        95 ST+ M       119 -
 24 SQRT         48 -            72 RTN          96 RND         120 END

Prerequisites:

an HP-41C or CV equipped with Extended Function Module, or an HP-41CX
and a facility to enter «synthetics» (alternatively you may use normal registers instead of the display registers M, N, and O)
or an emulator like V41
or any other that reads the SNSNN.RAW file in here and does «synthetics»
the PPC-ROM
for the SOLVE root finder called in line 56
a Card-Reader
just for the change of the display mode in line 76 what determines the behaviour of RND in line 96

Usage:

  1. set numbers of decimals of display mode according to the requested accuracy
  2. be sure flag 18 is clear
  3. input in X
  4. execute function:
    GI (like Q on the HP-32E)
    computes the area under the standard normal distribution curve from minus infinity up to X
    GII
    computes the area under the standard normal distribution curve from minus X up to X
    SN (like Q-1 on the HP-32E)
    the inverse function of GI, the upper bound to given area in X
    SNN
    the inverse function of GII, the symmetric bounds to given area in X
  5. result in X (except for the case of input error)

The program uses flags 10 and 18, registers 6...11, stack and alpha as scratch. Runtime depends on input and number of display mode digits. Accuracy questionable for areas close to 0 or 1 and bounds > |5|.

Normal Distribution on HP-42S: The file SNSNN42.RAW in here is for HP-42S emulators or simulators like Free42. All the same as above except registers 8...11 and flag 18 used only, sets display mode to FIX 6.

Here an example of computing the upper bound for the area 0.999 with Q-1 on an HP-32E simulated with Nonpareil, SN on an HP-41 emulated with V41, and the same on an HP-42S emulated with Emu42.
strong reduced in colors to minimize file size



Soon more... still unfinished
This cartoon looks funny but has some relation to reality: a friend of mine once tried hard to get some results late at night and — shortly falling asleep — smashed the space bar of his iMac.

Read the legal stuff for this page.