A routine for interactive operations among values of components in geochemical data has been established. The most striking merit of this program is that polynominal operations incluing logarithmic and exponential ones are easily performed without any modificaton of the program segments. All the user has to do is input the arithmetic expression of components in the form of string data. He can get the result soon even if he has no idea on programming for the computation. The operation-code method thought out by the writer is applied to this program. A given arithmetic expression will be translated into an operation code. It is a simplified form of the arithmetic expression. In the operation code all variables and constants are expressed as ‘X’ common and natural logarithmic functions ‘L’, and ‘N’, respectedly. Operators are written as they are. For example:
2LOG (MgO/T.FeO)
will lead an operation code to
X*L (X/ (X+X) ) .
This case shows several unique functions of the routine: The abbreviated multiplication signs are automatically inserted between terms of the code. Since T.FeO is defined in this program as total FeO, and T.Fe
2O
3 as total Fe
2O
3, they are divided into two variables, Fe
2O
3 and FeO. A pair of parentheses are added in the operation code. In this manner the values of Fe
2O
3 and FeO take part in operations as if they were one component after being recalculated into total Fe
2O
3, or total FeO.
The operation code written in a string variable is read character by character in the course of performing operations. Each character of it controls computation on exponentiation, logarithms, multiplication, division, addition, and subtraction, in accordance with the procedures for the computation defined by the characters. A simple calculation can be done in a moment because the operation code is short, while complicated operations are also easily performed.
The method is so simple that the program is only 3.4 kilobytes long including the steps for creating and checking the operation code. Therefore even small personal computers can load this routine. It is capable of maximum 10 terms and up to fivefold parentheses in a polynominal expression. These restrictions, however, depend only on the dimensions of related variable arrays so that they can be increased, if necessary, without any modification of other program steps.
The routine would play the important part of studies on geochemical data analyses with trial and errors if it is built in a program system.
View full abstract