System-Supplied Functions

The Function Builder gives you access to over two hundred system-supplied, design-time functions. In addition, you can create your own user-written functions.
Design-time functions are evaluated only during the modeling process, not during a simulation. Note that although some design-time functions have the same names as certain run-time functions, they work with the model definition only, not with the model at an analysis-time step. Adams View does, however, evaluate design-time functions during design studies and optimization.
The Function Builder categorizes all system-supplied functions based on their functionality. For example, a category might include all math functions or all database functions. A category named All Functions lists all the functions in alphabetical order. You can use and access the system-supplied design-time functions from the Function Builder, as outlined in Working in Expression Mode.
The following sections introduce the system-supplied function categories as they appear in the Function Builder:

Math Functions

Math functions apply to scalar numbers or matrixes. If you input a scalar, Adams returns scalar. If you input a matrix, Adams returns a matrix.
Where to Find the Math Functions
The following table lists the names and definitions for the math functions:
 
This function:
Returns:
The absolute value of an expression that represents a numerical value.
The arc cosine of an expression that represents a numerical value.
The nearest integer whose magnitude is not larger than the integer value of a specified expression that represents a numerical value.
The nearest integer whose magnitude is not larger than the real value of an expression that represents a numerical value
The arc sine of an expression that represents a numerical value.
The arc tangent of an expression that represents a numerical value.
The arc tangent of two expressions, each representing a numerical value.
The smallest integer greater than x.
The cosine of an expression that represents a numerical value.
The hyperbolic cosine of an expression that represents a numerical value.
The positive difference of the instantaneous values of two expressions, each representing a numerical value.
Returns the exponential for each element of x.
The largest integer that is less than x.
The nearest value whose magnitude is not larger than x.
The natural logarithm of an expression that represents a numerical value.
Log to base 10 of an expression that represents a numerical value.
The magnitude of a vector.
The remainder of one expression, representing a numerical value, divided by another expression representing a numerical value.
The whole number nearest to the input value.
A pseudo-random value on the closed interval [0.0, 1.0], from a uniform distribution.
An integer representation of the input value, where the input value is a real number.
A numerical value which takes its sign from one argument and its magnitude from another.
The sine of an expression that represents a numerical value.
The hyperbolic sine of an expression that represents a numerical value.
The square root of an expression that represents a numerical value.
The tangent of an expression that represents a numerical value.
The hyperbolic tangent of an expression that represents a numerical value.

Location/Orientation Functions

You can use location/orientation functions to compute one or more locations or orientations from a variety of input parameters.
Where to Find the Location/Orientation Functions
The following table lists the names and definitions for the location/orientation functions:
 
This function:
Returns:
An array of three numbers defining a location expressed in the global coordinate system.
The location as a three-dimensional vector of a node on a flexible body.
An array of three numbers, that are the Cartesian coordinates (x, y, z) for a point, equivalent to the cylindrical coordinates (r, , z) for the same point.
An array of three numbers representing a location in the global coordinate system, which mirrors another location across a plane of a coordinate system object.
An array of three numbers representing the global coordinates of a location obtained from transforming the local coordinates by a specified location.
An array of three numbers representing the transformation and normalization of coordinates for a location you specified.
An array of three numbers representing the transformation of coordinates location in a new coordinate system object.
An array of three numbers representing a location obtained by transforming a location expressed in the global coordinate system, to a new local coordinate system object.
An array of three numbers representing a location in the global coordinate system, which mirrors another location across a plane of a coordinate system object.
An array of three numbers representing a location, expressed in the global coordinate system, obtained from translating a certain distance along a specified axis of a coordinate system object.
An array of three numbers representing the global coordinates of a location along a line defined by two points.
A location normal to a plane, one unit away from the first point in the plane.
An array of three numbers representing a location expressed in the global coordinate system of a location mirrored across the specified plane.
An array of three numbers, representing a location, by transforming a specified location that is relative to a coordinate system object.
Cartesian coordinates (x, y, z) that are equivalent to spherical coordinates ( , , ).
LOC_TO_FLEXBODY_NODEID
The node ID of the flexible body that is closest to the specified location
A normal vector defining the x-axis of a coordinate system object in the global coordinate system.
A normal vector defining the y-axis of a coordinate system object in the global coordinate system.
A normal vector defining the z-axis of a coordinate system object in the global coordinate system.
An orientation that aligns one axis of a coordinate system object with an axis of another.
An orientation that aligns one axis of a coordinate system object with an axis of another.
A body-fixed 313 Euler sequence describing an orientation in which the first axis of a coordinate system object is parallel to, and co-directed with, a line defined by the first two points in a plane, and its second axis is parallel to the plane.
The alignment of a specified axis from one coordinate system object to another.
An orientation that has the specified axes mirrored about a plane within a coordinate system object.
An angle expressed in a coordinate system object to the global coordinate system.
An orientation by directing one of the axes and defining one of the planes within a coordinate system object.
An orientation, expressed in the global frame, in the local frame of the coordinate system object.
An orientation by performing a mirroring of the given orientations that reflect the specified axes.
A body-fixed 313 Euler rotation sequence expressed in the global coordinate system when given a line that is parallel to, and co-directed with, a specified axis.
An orientation that represents the same orientation as expressed in the local frame of one coordinate system object to the local frame of another coordinate system object.
A sequence of body-fixed 313 Euler rotations by performing a mirroring of orientations.
An orientation of a coordinate system object as specified by an angle.

Modeling Functions

Kinematic modeling functions return a requested displacement measurement between markers or parts. Although these functions have the same names as certain run-time functions, they only compute an instantaneous value in the context of a design-time function. These functions work with the model definition only, not with a model at an analysis-time step.
Modeling functions' arguments use any coordinate system entity (marker, part), any entity implying a coordinate system (model, geometry) or zero (0). If an argument uses a coordinate system entity or any entity implying a coordinate system, it is referred to as a coordinate system object. If the argument is zero, Adams defaults to the global coordinate system.
Where to Find the Modeling Functions
The following table lists the names and definitions for the modeling functions:
 
This function:
Returns:
The angular displacement from one coordinate system object to another.
The angular displacement from one coordinate system object to another.
The angular displacement from one coordinate system object to another.
The magnitude of the translational displacement from one coordinate system object to another.
An x component of translational displacement from one coordinate system object to another.
A y component of translational displacement from one coordinate system object to another.
A z component of translational displacement from one coordinate system object to another.
The third angle associated with a body-fixed 313 rotation sequence from one coordinate system object to another.
The negative value of the second angle associated with a body-fixed 321 rotation sequence from one coordinate system object to another.
The first angle associated with a body-fixed 313 rotation sequence from one coordinate system object to another.
The third angle associated with a body-fixed 321 rotation sequence from one coordinate system object to another.
The second angle associated with a body-fixed 313 rotation sequence from one coordinate system object to another.
The first angle associated with a body-fixed 321 rotation sequence from one coordinate system object to another.

Matrix/Array Functions

Matrix/array functions allow you to easily perform common matrix operations.
Where to Find the Matrix/Array Functions
The following table lists the names and definitions for the matrix/array functions:
 
This function:
Returns:
An interpolated curve created from input points with a specified number of values.
An Akima-spline fit of the dependent values.
Shifts values in an array to start at a particular value (often used to shift a curve so that the value at its starting point is 0--aligning along the curve to 0)
The logical product of the elements of a matrix.
A 3x1 matrix containing angles from the transformation matrix in D.
The logical sum of the elements of a matrix.
The rows of one matrix appended to the rows of another matrix.
A similarity transformation T such that B = T/A*T has, as nearly as possible, approximately equal row and column norms.
The new array when the Bartlett window is applied to the input array.
The new array when the Blackman window is applied to the input array.
Returns gain and/or phase values for the frequency response function for a linear system specified by ABCD linear state matrices.
Returns output gain and/or phase values for the frequency response function for an Adams View linear state equation element.
Computes the Bode response for a given set of A, B, C, and D matrices.
Returns the gain and/or phase values calculated from two sequences of time-based values describing the input and output of a linear system.
Returns the gain and/or phase values for the frequency response function of a transfer function specified by its numerators and denominators.
Returns the gain and/or phase values for the frequency response function of an Adams transfer function element.
Calculates the denominator coefficients for the Butterworth filter.
Filter a curve with the butterworth filter specified by the order and cutoff frequency.
Calculates the numerator coefficients for the butterworth filter.
Calculates the cutoff frequency for the butterworth filter.
Calculates the order for the butterworth filter.
A non-statistical mean of the values in an array.
An MxNumvals matrix of values extracted from an MxN matrix.
The number of columns in a given matrix.
An array consisting of the non-empty values in the input array.
Returns the condition number of a matrix.
A body-fixed 313 sequence converted into a user-specified sequence.
The cross-product of two matrixes.
An interpolated curve created from input points with a specified number of values.
An interpolated curve created from input points with a specified number of values.
The determinant of a square matrix.
A 1xN array of detrended data computed by subtracting the linear least squares fit from the input data stream.
A 1xN array of approximations to the derivatives at the points in the input data.
The derivative at each input point on curve C.
A square matrix with the elements of M along the diagonal, and zero elsewhere.
Returns a matrix of DOE experiments, a row from that matrix or the count of rows from that matrix.
Returns the number of terms in the polynomial produced by the OPTIMIZE FIT_RESPONSE_SURFACE command.
The dot product of two matrixes.
Returns a vector of the imaginary components of the generalized eigen vectors of matrices A and B.
Returns a vector of the real components of the generalized eigen vectors of matrices A and B.
Returns a vector of the imaginary components of the generalized eigen vectors of matrices A and B.
Returns a vector of the real components of the generalized eigen vectors of matrices A and B.
Returns a vector of the imaginary components of the generalized eigen vectors of matrices A and B.
Returns a vector of real components of the generalized eigen vectors of matrices A and B.
Text that indicates if a real value is an element of an array.
An array with a specified value excluded from it.
A 1xN array of magnitudes calculated by applying the FFT function to input values.
A 1xN array of phase values calculated by applying the FFT function to input values.
A 1xN array of filtered input values, where N is the number of input values.
Zero phase digital filtering.
The first element in an array if an element exists; otherwise, returns a 0.
The first N elements of an array.
The FFT frequencies of an array of time values.
A real array of Zi values corresponding to the ordered pairs in Xi, and Yi.
A 1xN array of values after applying the HAMMING window function.
A 1xN array of values after applying the HANNING window function.
An interpolated curve created from input points with a specified number of values.
A value included into an array if the value is not already there.
The integral produced at each input point on curve C.
A curve of integrals produced from an input curve.
The Yi values corresponding to the Xi values
The Zi values corresponding to the Xi and Yi points.
An array of Y values nY long if given the x array and integer value nY.
The inverse matrix of a square matrix.
The last element of an array if an element exists; otherwise, returns a 0.
The last N element of an array.
An interpolated curve created from input points with a specified number of values.
The value of the largest element of a matrix.
The index of the largest element of a matrix.
The mean of a matrix.
The X or Y grid coordinates.
The value of the smallest element of a matrix.
The index of the smallest element of a matrix.
Scalar representing the norm of a matrix.
The square root of the sum of the squares of the elements of a matrix.
The normalized elements of a matrix.
An interpolated curve created from input points with a specified number of values.
The 1xN array of values after applying the PARZEN window function.
Returns the coefficients of a polynomial fitted to the supplied function data.
The product of the elements of a matrix by performing a matrix reduction using multiplication.
The power spectral density computed from the complex Fourier coefficients.
Estimate the power spectral density (PSD) of a signal using Welch's method.
The 1xN array of values after applying the RECTANGULAR window function.
A curve resampled over a new interval with the spline algorithm you specified.
A new matrix created from an existing matrix with dimensions you specified in the shape-descriptor array.
A reversed one-dimensional input array.
The root mean square of the values.
The number of rows in a matrix.
An array it generated based on a start value, a number of increments, and an array length.
An increment it calculated based on start and end values and a given number of increments.
The dimensions of a matrix.
The simulation time for the last step of the default simulation.
A matrix sorted in the direction you specified.
An array sorted by another array in the direction you specified.
The indexes of a matrix sorted in the direction you specified.
An interpolated curve created from the input points with the number of points you specified.
The sum of the squares of the elements of a matrix.
The concatenation of two matrixes with the same number of columns.
An array of y values, on a step curve, corresponding to the x values.
The sum of the elements of a matrix by performing a matrix reduction using addition.
The TILDE function of an array.
A 3x3 transformation matrix using the values in the orientation sequence you specified.
Returns a 3x3 transformation matrix using the values in the orientation sequence you specify.
The transpose of a matrix.
Apply the triangular window to the input array and return the new array.
An array from which it deleted all duplicate elements.
Unwraps phase angles in degree by changing absolute jumps greater than 180 degree to their 360 degree complement.
An array element nearest to the number you specified.
A number from an array located at the same position as a number found in another array.
The index of the element in an array nearest to the number you specified.
A 1xN array of values after applying the WELCH window function.

String Functions

String functions allow you to manipulate character strings.
Where to Find the String Functions
The following table lists the names and definitions for the string functions:
 
This function:
Returns:
A text string to all status bars.
A string from an input string that has been modified according to an integer value.
A character whose ASCII value is mapped to an input integer.
A numeric value indicating the relative alphabetical ordering of two strings.
A string containing the current time and/or date information according to a format string.
A string that results from deleting a specified number of characters starting from a specified location on an input string.
The starting location of the first occurrence of a string within another string.
The number of occurrences of a string found within another string.
Returns the index into the array if the string is found, zero if not found.
The numerical position of a character in a string found within another string.
A string constructed by inserting a string into another string at a specified insertion point.
A boolean truth value indicating that the input character string argument represents a valid real number.
A 1 (true) if a string is empty; otherwise, returns 0 (false).
A numerical value corresponding to the length of a string.
A 1 (true) if a specified string is found within another string; otherwise, returns 0 (false).
A string it writes into the aview.log file.
A string that is the result of removing all leading and trailing spaces (blank spaces, tab spaces) from the input string.
Returns a string constructed by replacing all the occurrences of the sub string in an input string with another string.
An array of strings built from substrings, which are separated from each other with a specified character, and are located within another string.
A character string constructed by formatting the array of values in the format string.
A substring with a designated number of characters starting at a specified point within a string.
The current date and time in the default format.
A new string formed by replacing all occurrences of one or more characters found within the input string, with an equal number of characters.
Some of the functions in the Miscellaneous Functions category are related to the functions in this category. Those functions are:
ON_OFF
STOI
STOO
STOR

Database Functions

Database functions facilitate your access to the database.
Where to Find the Database Functions
The following table lists the names and definitions for the database functions:
 
This function:
Returns:
A Boolean value indicating that the object will or will not take part in simulations.
Returns the first ancestor of an object of the type you specify.
A 1 if an element in the database has changed; returns a 0 if there was no change.
An array of objects of a given type that are children of the object you specified.
The number of values in a given field of the object you specified.
The default object of a given type.
Returns the name for the given object based on the state of the default for formatting names.
Returns the name for the given object based on the state of the default for formatting names.
An array of objects that are dependents of the object you specified.
An array of all the parametric expressions that depend on the object you specified.
A constant integer value of zero, and deletes all the parametric expressions that depend on the object you specified.
An array of all objects of a given type that are dependents of the object you specified.
Lists a complete chain of dependents (of the specified type) for a given object. That is immediate dependents, dependents of dependents and so on.
Returns the objects of a given type, activity, and number of levels beneath the parent.
A 1 if the object you specified exists; returns a 0 if it doesn't.
An array, from a given array of field names, containing a subset of the original array.
A string that describes the type of data in a field beneath the object type you specified.
An array of objects whose names match the filter parameters you specified.
An array of objects whose types match the filter parameters you specified.
Returns the full name for the named object of the specified type.
An array of strings for the names of the fields (including aliases) for the object you specified.
An array of all objects that are immediate children of the object you specified.
The number of object names in the array of database objects you specified.
Returns a logical value indicating whether the specified object exists as an immediate child of the parent object.
Returns a boolean value indicating whether the object specified exists or not.
Returns the object of a given name and type.
A 1 if an object is a member of a given class; returns a 0 if it is not.
Returns a 1 if an object with the name and type you specified exits; returns a 0 if it does not exist.
Returns the most distant ancestor of an object of the type specified.
An array of objects of a given type that are referenced by the object you specified.
Lists a complete chain of the objects (of the specified type) referred to by a given object. That is immediate referents, referents of referents and so on.
Returns the shortest unique name for the given object.
An array of objects that have two-way associativity with the object you specified.
A string representing an object type.
An array of strings for the names of the fields (excluding aliases) for the object type you specified.
Some of the functions in the Miscellaneous Functions category are related to the functions in this category. Those functions are:
 

Miscellaneous Functions

To further assist you, we've divided the miscellaneous functions into four groups, as listed below.
Database Functions Group
The following table lists the names and definitions for the functions in the database functions group:
 
This function:
Returns:
A 1 if an expression exists in a given field of an object that you specify; returns a 0 if it does not.
A string containing the name of the reference to the expression.
 
 
A text string containing an expression in a given field of an object that you specify.
A parameter's values as they appear in an Adams command file.
A text string containing a unique full name for the type of object you specified.
Returns an adams_id unique for objects of the specified type.
Returns a name of the form BASE_1, where "BASE" is a prefix that you supply and the number ("1" in this case) is computed by the function.
A text string that is a unique database name.
A text string that is a unique database name, taking into account the inherent hierarchy in the given input
A character string containing a unique object name.
Returns the numeric conversion factor from the given unit value to the current default units.
A text string containing a units string associated with another string.
Returns the character string value of the given unit type using the provided integer value.
Returns the character string value of the given unit type using the default units settings.
A text string containing a value in the Object Field.
GUI Functions Group
The following table lists the names and definitions for the functions in the GUI (graphical user interface) functions group:
 
This function:
Returns:
Aggregate mass information.
An alert box using the labels you specify.
Displays the contents of the variable on separate lines and presents an OK button. It always returns 1.
Displays the contents of the variable on separate lines and presents an alert window with up to three buttons containing specified labels.
An integer representing the command button you selected after Adams View displayed the Alert dialog box.
KEY of the macro using the specified commands.
An integer node ID associated with the node of the flexible body closest to a specified marker.
Array containing node IDs (integers) of number of nodes on the flexible body closest to the specified marker.
Array containing node IDs for all nodes on the flexible body, which reside inside the volume of a specified geometry object.
Returns one or zero to indicate whether the specified node of a flexible body is an interface node.
Array of node IDs associated with all the
nodes of the flexible body within a radius
of a specified marker.
Returns an integer node id associated with a node of the flexible body, o_new_flex, closest to node, nodeId, on the flexible body o_old_flex.
KEY of the selected object.
Returns a one or zero depending on whether or not the product name is properly licensed.
Returns the name of the directory you selected from the directory browser
A selected field as a string.
A file name you selected.
An array of strings you selected.
A selected object, using the Database Navigator to provide you with selections.
An array of selected objects, using the Database Navigator to provide you with selections.
An array of integers representing the selected IDs.
The string you selected.
A selection list of object types.
An array of integers representing the 1-based row numbers of selected cells within a specified column in a table.
An array of strings representing the contents of the cells within the specified row/column range.
An integer representing the number of rows or columns in a table or the number of cells in a row or column.
Returns an array of reals representing the contents of the cells within the specified row/column range.
Returns the column numbers for the columns in a data table that are currently selected. A column is considered as 'selected' if at least one of its cells is selected
Returns the row numbers for the rows in a data table that are currently selected. A row is considered as 'selected' if at least one of its cells is selected.
Either starts or ends a timer for measuring the accumulated time in CPU seconds used since the beginning of the process execution
Either starts or ends a timer for measuring the elapsed time in seconds.
String Functions Group
The following table lists the names and definitions for the functions in the string functions group:
 
This function:
Returns:
The character string on or off, depending on the state of the argument.
An integer STOI has converted from a string.
A database object STOO has converted from a character string.
A real number STOR has converted from a string.
System Functions Group
The following table lists the names and definitions for the functions in the system functions group:
 
This function:
Returns:
A backup of a specified file.
Copies a file to the specified location. Returns 1 if successful.
A 1 if CHDIR succeeded in changing to the directory you specified, or a 0 if it failed.
A numerical value indicating whether EXECUTE_VIEW_COMMAND succeeded or failed in executing an Adams View command.
A directory name from the file specification.
A 1 if a file exists, and a 0 if it doesn't.
The file name with its extension removed.
A string that has a non-existent temporary file name.
The current working directory as a character string.
Text string containing the value of the environment variable you specified.
Returns the local name of a file when given a name that may contain the directory specifications.
A numerical value indicating whether MKDIR succeeded in creating a user-specified directory.
An array of integer status codes corresponding to the given search tag.
The string value that PUTENV assigned to an environment variable.
A 0 if successful in deleting a file; otherwise, it returns a nonzero value.
A specified file.
This will replace delimiter in string path and returns replaced delimiter string.
A 1 if successful in removing the directory; otherwise, it returns 0.
An array of simulation status codes corresponding to the tag: ALVSIM:STATUS.
A character string containing information about the system.
An array of simulation status codes corresponding to the tags: A3TERM:STATUS and TERM:STATUS.
A string that is the name of a non-existent file.