Built-in Functions
GoldSim provides a wide variety of built-in functions that can be used in expressions. These functions can be typed in directly, or inserted using the context menu of an input field:
The functions are divided into eight categories (two of the categories only appear under certain circumstances):
- Trigonometry functions, such as sine and cosine;
- Math functions, such as square root and logarithm;
- Special functions, such as the Bessel function and "if,then,else";
- Financial functions, such as present value and future value;
- Date functions, which are specialized functions for manipulating variables that represent dates and times (e.g., extracting the day of the month from a date, determining if the simulated year is a leap year);
- Table functions, which are specialized functions for operating on Lookup Table elements (this category only exists if at least one Lookup Table element A type of input element that allows you to define your input in terms of a lookup table (i.e., a response surface). exists in the model);
- Time Series functions, which are specialized functions for operating on Time Series elements (this category only exists if at least one Time Series element A type of input element that provide a very flexible and powerful way to input external time histories of data. exists in the model); and
- Array A collection of variables that share common output attributes and can be manipulated in GoldSim elements or input expressions. functions, which are specialized functions that operate only on vectors and matrices.
An example of the use of a built-in function is shown below:
In this example, the “max” function returns the maximum of a list of arguments (in this case, a and b).
The arguments to a built-in function are enclosed in parentheses, and if there are multiple arguments, they are separated by commas. The arguments to the built-in functions can be links, constants or expressions, but typically must meet certain requirements (e.g., the arguments to a “max” must all share the same dimensions An output attribute for an element that defines the dimensionality (in terms of Length, Time and other fundamental dimensions) of the output.).