next up previous contents index
Next:   CALIBRATION Up: The KEYBOARD INTERFACE: Command Previous:   CADD (Constant ADDition)

Subsections



  CALCULATOR

The CALCULATOR command enters the reverse Polish notation calculator sub-menu. The sub-menu commands are mainly the normal calculator arithmetic and function commands. At any time values may be entered which are stored one by one on the ``stack'', or an operator command may be entered to perform an operation on one or more of the values previously entered on the stack. The result replaces the values operated upon. In addition to operator commands such as *, +, -, / stack manipulation and display commands are available. For a full list of the available commands type ?. As always the command EXIT or the command QUIT is used to return to the main menu. The calculator may be used in normal arithmetic mode, but also supports complex arithmetic. To enter complex constants type two values separated by a space and/or a comma.

The complete list of available commands and their function is:

? List of available operators and commands
+ Add top two elements of stack
- Subtract lower element of stack from top element
* Multiple top two elements of stack
/ Divide top element of stack by lower element
1/X Form reciprocal of top of stack
ABSOLUTE Absolute value of top element: Sqrt(r**2 + i**2)
ACOSINE Take Arc Cosine of top element of stack
ARCCOSINE Take Arc Cosine of top element of stack
ARCSINE Take Arc Sine of top element of stack
ARCTANGENT Take Arc Tangent of top element of stack
ASINE Take Arc Sine of top element of stack
ATANGENT Take Arc Tangent of top element of stack
ADDITION Add top two elements of stack
CLEAR Clear stack (remove all elements)
COSINE Take cosine of top element of stack
DIVISION Divide top element of stack by lower element
DUPLICATE Copy top of stack onto stack
ENERGY Convert wavelength (Angstroms) to photon energy (keV)
EXCHANGE Swap top two elements of stack
EXIT Exit fit sub-menu
EXPONENTIAL e to the power of the top element of stack
INTEGER Truncate value to an integer
LN Take natural logarithm of top element
LOGARITHM Take logarithm base 10 of top element
MAXIMUM Greater of top two elements of the stack
MEMORY Output value of memory
MODULUS Remainder when top of stack divided by lower value
MINIMUM Minimum of top two elements of the stack
MULTIPLICATION Multiple top two elements of stack
NEGATION Multiple top element by -1.0
PI Ratio of circumference to diameter of a circle
POP Remove top element from stack
POWER Raise top element to the power of the lower element
PUSH Duplicate top element (adds to stack)
QUIT Exit calculator sub-menu
R1 Place value from register 1 onto stack
R2 Place value from register 2 onto stack
R3 Place value from register 3 onto stack
R4 Place value from register 4 onto stack
QUIT Exit fit sub-menu
RECALL Place value from memory onto stack
RECIPROCAL 1/x, reciprocal of top element
REGISTERS Values of current registers
S1 Store top element in register 1
S2 Store top element in register 2
S3 Store top element in register 3
S4 Store top element in register 4
SINE Take sine of top element of stack
SQUARE ROOT Replace value by its square root
SQRT Replace value by its square root
STACK Shows contents of the stack
STORE Save value of top element in memory
SUBTRACTION Subtract lower element from top element
SYMBOL Store top of stack as a named program variable
TANGENT Take tangent of top element of stack
VARIABLE Store top of stack as a named program variable
WAVELENGTH Photon energy (keV) to wavelength(Angstroms)

Note: Since the commands may be entered in any shortened non-ambiguous form, common forms of naming the functions will work e.g. sin, cos, exp, tan are all understood.

The VARIABLE command allows the value in the top of the stack to be stored as a program variable for later use, and use in macros (see Section 19, Page [*]).

Examples of Calculator Usage

At first a reverse polish notation calculator may seem complicated to use, but with a small amount of practice it is very easy, but of course different 17.

Before any operation, e.g. multiplication of two numbers, can be performed the operands, e.g. the two numbers, must be first entered onto the ``stack''. Operands (numbers) are entered onto the stack simply by typing their value followed by the $<$ RETURN$>$ key. Each new value is placed on the top of the ``stack'', previous values being stored underneath it.

The following example shows the program output produced when multiplying 0.496 and 3.567.

Main menu: ENTER COMMAND [INPUT DATA]:calc
ENTER VALUE OR OPERATOR:0.496
ENTER VALUE OR OPERATOR:3.567
ENTER VALUE OR OPERATOR:*
RESULT:   1.769232      .0000000E+00
ENTER VALUE OR OPERATOR:exit

The following example shows how to calculate $\cos^2(20) + \sin^2(20)$ (note trigonometric functions work in degrees).

ENTER VALUE OR OPERATOR:20
ENTER VALUE OR OPERATOR:cos
RESULT:   .9396926      .0000000E+00
ENTER VALUE OR OPERATOR:2
ENTER VALUE OR OPERATOR:pow
RESULT:   .8830222      .0000000E+00
ENTER VALUE OR OPERATOR:20
ENTER VALUE OR OPERATOR:sin
RESULT:   .3420201      .0000000E+00
ENTER VALUE OR OPERATOR:2
ENTER VALUE OR OPERATOR:pow
RESULT:   .1169778      .0000000E+00
ENTER VALUE OR OPERATOR:+
RESULT:   1.000000      .0000000E+00

The following example shows the entry of complex numbers and their multiplication.

ENTER VALUE OR OPERATOR:1 -1
ENTER VALUE OR OPERATOR:0 -1
ENTER VALUE OR OPERATOR:*
RESULT:  -1.000000     - 1.000000

The following example shows how to find out the photon energy (in keV) corresponding to a wavelength of 1.0Å.

ENTER VALUE OR OPERATOR:1
ENTER VALUE OR OPERATOR:energy
RESULT:   12.39852      .0000000E+00


next up previous contents index
Next:   CALIBRATION Up: The KEYBOARD INTERFACE: Command Previous:   CADD (Constant ADDition)
Andrew Hammersley
2004-01-09