0 functions and arguments in a calculation – MTS Fracture Analyzer User Manual

Page 78

Advertising
background image

However, some operators like the Not (!), Ones Complement (~), and Subtraction when used as a Negate
(-), operate on only one argument to the right.

Functions requiring arguments

In general syntax, functions that require arguments are written as a function name followed immediately by
the required arguments enclosed in parenthesis. For example: cos(number) – where “cos” is the function
identifier and “(number)” is the required argument.

7.5.5.0 Functions and Arguments in a Calculation

The Calculation Editor contains functions that can be inserted into the Calculation panel from the Functions
panel. When an insertion occurs, the function is represented by an identifier, followed immediately by a
parenthetical representation of the expected argument or arguments. If multiple arguments are required, their
representatives are separated within the parenthesis using delimiters, such as commas or semicolons,
depending on the local language. The representative arguments are placeholders for an expected type of
data.

Argument types

The types of arguments that can be passed to a function are:

Number

String

Array

Signal or test input

In all cases, the argument type that is shown in the Calculation window must be replaced by a meaningful
value. The meaningful value can be an actual value, a variable that contains a value that is of the correct
type for the argument, or another function that produces a result that is of the correct type for the argument.

For example, if the function cos(number) is added to the Calculation panel, the message, “The variable,
number, was not found” is shown in the Error panel. The argument “number” must be replaced with a value,
a variable of the correct type, or a function that evaluates to the correct type. In this case the number 30, the
variable CycleCount, or the function cos(sin(30)) validates the calculation. The Error panel message reads,
“Equation is OK” when one of these replacements is used.

Argument syntax

When replacing a representative number or string argument type with an actual number value or a string
value, you must use the correct syntax for the value.

A string value must be enclosed between double-quotes. For example: the function ToLower(string), can
be replaced by ToLower(“This is a short sentence.”), but not by ToLower(This is a short sentence.).

A numeric value is typed without quotes. For example: the function cos(number) can be replaced by
cos(30), but not by cos(“30”).

Arguments can also be replaced with variables of the correct type.

Unique functions

There are unique functions available in the Calculation Editor that do not accept arguments.

The function e() represents the natural logarithmic base, e.

78 MTS TestSuite™ Fracture Analyzer User Guide

7.0 Variable Analysis

Advertising