This routine lets you write a mathematical expression,
enter numeric values for the expression variables, and have the computer
solve it for X and (optionally) Y values obtained from file channels. The program parses the expression into components and performs
The expression evaluator understands the following
symbols (upper or lower case entries are OK):
- Simple operators: + - * / ^ ( )
- Complex operators: EXP, LOG or
LN, LOG10, SIN, COS, TAN, ATN or ATAN, ABS, INT, SQR (square), SQRT (square
- Two special variables (i.e., channels) named "X" and
"Y", chosen with push-buttons (see image below)
- PI (or the equivalent Greek letter)
- Numbers (such as 5, -3.1889, and
- You can add a comment at the end of your expression, delineated
with the " ` " character.
Some general considerations:
- The 'Check expression' button does a preliminary parsing of
the expression and indicates if there are any syntax errors (in the above
example, this button has been clicked).
- The 'Run Transform' button processes the channel data according to
the expression in the upper left window. The transformed data are re-written
to the main plot area. If any errors are found (see below), a warming message
NOTE: This routine will only 'catch'
errors in the basic numeric expression. It may
not detect invalid or meaningless math operations that may be attempted
when data are processed, such as division by zero, or taking the
log or a non-integer exponent of a negative number. If such situations
occur, results may be unpredictable. The algorithm does find most such
errors during processing, however.
|The underlying code for the expression evaluator
was developed by the late, great Robert
Purves (recently deceased and greatly missed). I 'borrowed' it -- with his permission -- and
made some modifications for LabAnalyst.
But Robert P. deserves all the credit.|