Data Calculator

The Data Calculator can be used to perform mathematical operations with data sets to create new data sets. The Data Calculator is accessed by selecting the Data Calculator command from the Data menu. The components of the Data Calculator are as follows:

Expression Field

The most important part of the Data Calculator is the Expression field. This is where the mathematical expression is entered. The expression should be formulated using the same rules that are used in formulating equations in a spreadsheet. Parentheses should be used to clearly indicate the preferred order of evaluation. There is no limit on the length of the expression. The operators in the expression should be limited to the operators shown in the middle of the Data Calculator. The operands in the expression should consist of user-defined constants (e.g., 3.14159), or data sets.

List of Data Sets

All of the data sets associated with the active object (TIN, Grid, Mesh, or Scatter Point Set) are listed at the top of the Data Calculator. If a transient data set is highlighted, the time steps are listed on the right side of the Data Calculator. When a data set is used in an expression, the name of the data set should NOT be used. Rather, the letter associated with the data set should be used. For example, if a data set is listed as "b. head1", the data set is referenced in the expression simply as "b"

When a transient data set is used in an expression, either a single time step or the entire sequence of time steps may be used. For example, the expression "abs(d:100)" creates a single (steady state) data set representing the absolute value of the data set at time = 100.0. However, the expression "abs(d:all)" creates a transient data set representing the absolute value of each of the time steps in the original data set.

Result Name

When an expression is evaluated, a new data set is created and the name of the new data set is designated in the Result field.

Operators

The allowable operators are listed in the middle of the dialog. Selecting one of the operator buttons adds the selected operator to the end of the expression. However, the operators can also be typed directly in the expression field. The function of each of the operators is as follows:

Operator

Function

+

Add

-

Subtract

*

Multiply

/

Divide

(

Left parenthesis

)

Right parenthesis

log(x)

The base 10 logarithm of a data set

ln(x)

The natural logarithm of a data set

x^a

(x) raised to the (a) power. (x) and (a) can be any mixture of constants and data sets

abs(x)

The absolute value of a data set

sqrt(x)

The square root of a data set

ave(x,y)

The average of two data sets

min(x,y)

The minimum of two data sets

max(x,y)

The maximum of two data sets

trunc(x,a,b)

Truncates a data set (x) so that all values are >= a and <= b

Compute Button

Once an expression is formulated and a name for the resulting data set has been specified, the expression can be evaluated by selecting the Compute button. At this point, the name of the new data set should appear in the list of data sets. The data set is added to the GMS Data Sets solution.

Related Links:
Data Sets