HP 50g User Manual Page 673

Graphing calculator.

`. The result is 49887.06_J/m^3. The units of J/m^3 are equivalent to
Pascals (Pa), the preferred pressure unit in the S.I. system.
Note: because we deliberately included units in the function definition, the
input values must have units attach to them in input to produce the proper result.
Input string program for three input values
The input string program for three input values, say a ,b, and c, looks as
follows:
"Enter a, b and c: " {"
«
This program can be easily created by modifying the contents of INPT2 to make
it look like shown immediately above. The resulting program can then be stored
in a variable called INPT3. With this program we complete the collection of
input string programs that will allow us to enter one, two, or three data values.
Keep these programs as a reference and copy and modify them to fulfill the
requirements of new programs you write.
Application
: evaluating a function of three variables
Suppose that we want to program the ideal gas law including the number of
moles, n, as an additional variable, i.e., we want to define the function
and modify it to include the three-variable input string. The procedure to put
together this function is very similar to that used earlier in defining the function
p(V,T). The resulting program will look like this:
"Enter V, T, and n:" {"
«
OBJ
V T n
Store this result back into the variable @@@p@@@.To run the program, press @@@p@@@.
:a:
OBJ
p
(
V
,
T
,
n
)
(
. 8
'(8.31451_J/(K*mol))*(n*T/V) ' "
:c: " {2 0} V } INPUT
:b:
"
J
n
31451
_
)
K
:V:
:T:
:n:" {2 0} V } INPUT
T
,
V
Page 21-26