Nothing Special   »   [go: up one dir, main page]

ADAMS/View Function Builder: Run-Time Functions

Download as pdf or txt
Download as pdf or txt
You are on page 1of 185

ADAMS/View Function Builder

Run-Time Functions

©2005 by MSC.Software Corporation. All rights reserved. Printed in the United States of America.
All product names are trademarks of their respective companies.
Run-time functions

ABS

Returns the absolute value of an expression that represents a numerical value.

Format

ABS (x)

Argument

x Any valid expression that evaluates to a real number.

Examples

The following function returns the absolute instantaneous value of the expression (-
10*TIME+15*TIME**2), where TIME is the current simulation time:

ABS(-10*TIME+15*TIME**2)

The following use of the ABS function will prevent instances where the argument of the
square root function becomes negative:

SQRT(ABS(10-DX()))

Learn more about math functions.

1
Printed Documentation

Run-time functions

Acceleration Along X (ACCX)

Returns an x component of the difference between the acceleration vectors of two


coordinate system markers.

Format

ACCX (To Marker, From Marker, Along Marker, Reference Frame)

Arguments

To Marker (Required) The coordinate system marker whose


acceleration is being measured.
From Marker (Optional) The coordinate system marker whose
acceleration is subtracted off. If you don't specify this
argument, it defaults to the global origin.
Along (Optional) The coordinate system marker along
Marker whose x-axis the acceleration is measured. If you
don't specify this argument, it defaults to the global
x-axis.
Reference (Optional) The coordinate system marker in which
Frame time-derivatives are calculated. If you don't specify
this argument, it defaults to the ground reference
frame.

Equation

Mathematically, ACCX is calculated as follows:

where,

 is the position vector from the global origin to the To Marker, T.

 is the second time-derivative of with respect to the Reference Frame,


R.
 is the position vector from the global origin to the From Marker, F.
2
Functions: A - M

 is the second time-derivative of with respect to the Reference Frame,


R.
 is the unit vector along the x-axis of the Along Marker, A.

Example

The following function returns the x component of the acceleration vector of marker_T
with respect to marker_F. The vector is expressed in the coordinate system of marker_A.
All time-derivatives are taken in the ground reference frame, since the Reference Frame,
R, is not specified.

ACCX(marker_T, marker_F, marker_A)=

Learn more about acceleration functions.

3
Printed Documentation

Run-time functions

Acceleration Along Y (ACCY)

Returns a y component of the difference between the acceleration vectors of two


coordinate system markers.

Format

ACCY (To Marker, From Marker, Along Marker, Reference Frame)

Arguments

To Marker (Required) The coordinate system marker whose


acceleration is being measured.
From Marker (Optional) The coordinate system marker whose
acceleration is subtracted off. If you don't
specify this argument, it defaults to the global
origin.
Along Marker (Optional) The coordinate system marker along
whose y-axis the acceleration is measured. If
you don't specify this argument, it defaults to
the global y-axis.
Reference Frame (Optional) The coordinate system marker in
which time-derivatives are calculated. If you
don't specify this argument, it defaults to the
ground reference frame.

Equation

Mathematically, ACCY is calculated as follows:

where,

 is the position vector from the global origin to the To Marker, T.

4
Functions: A - M

 is the second time-derivative of with respect to the Reference Frame,


R.
 is the position vector from the global origin to the From Marker, F.

 is the second time-derivative of with respect to the Reference Frame,


R.
 is the unit vector along the y-axis of the Along Marker, A.

Example

The following function returns the y component of the acceleration vector of marker_T
with respect to marker_F. The vector is expressed in the coordinate system of marker_A.
All time-derivatives are taken in the ground reference frame, since the Reference Frame,
R, is not specified.

ACCY(marker_T, marker_F, marker_A)

Learn more about acceleration functions.

5
Printed Documentation

Run-time functions

Acceleration Along Z (ACCZ)

Returns a z component of the difference between the acceleration vectors of two


coordinate system markers.

Format

ACCZ (To Marker, From Marker, Along Marker, Reference Frame)

Arguments

To Marker (Required) The coordinate system marker whose


acceleration is being measured.
From Marker (Optional) The coordinate system marker whose
acceleration is subtracted off. If you don't specify
this argument, it defaults to the global origin.
Along Marker (Optional) The coordinate system marker along
whose z-axis the acceleration is measured. If you
don't specify this argument, it defaults to the
global z-axis.
Reference (Optional) The coordinate system marker in which
Frame time-derivatives are calculated. If you don't
specify this argument, it defaults to the ground
reference frame.

Equation

Mathematically, ACCZ is calculated as follows:

where,

 is the position vector from the global origin to the To Marker, T.

 is the second time-derivative of with respect to the Reference Frame,


R.

6
Functions: A - M

 is the position vector from the global origin to the From Marker, F.

 is the second time-derivative of with respect to the Reference Frame,


R.
 is the unit vector along the z-axis of the Along Marker, A.

Example

The following function returns the z component of the acceleration vector of marker_T
with respect to marker_F. The vector is expressed in the coordinate system of marker_A.
All time-derivatives are taken in the ground reference frame, since the Reference Frame,
R, is not specified.

ACCZ(marker_T, marker_F, marker_A)

Learn more about acceleration functions.

7
Printed Documentation

Run-time functions

Acceleration Magnitude (ACCM)

Returns the magnitude of the second time-derivative of the displacement vector to one
coordinate system marker from another coordinate system marker.

Format

ACCM (To Marker, From Marker, Reference Frame)

Arguments

To Marker (Required) The coordinate system marker whose


acceleration is being measured.
From Marker (Optional) The coordinate system marker whose
acceleration is being subtracted off. If you don't
specify this argument, it defaults to the global
origin.
Reference (Optional) The coordinate system marker in which
Frame time-derivatives are calculated. If you don't specify
this argument, it defaults to the ground reference
frame.

Equation

Mathematically, ACCM is calculated as follows:

where,

 is the position vector from the global origin to the To Marker, T.

 is the second time-derivative of with respect to the Reference Frame,


R.
 is the position vector from the global origin to the From Marker, F.

8
Functions: A - M

 is the second time-derivative of with respect to the Reference Frame,


R.

Example

The following function returns the magnitude of the translational acceleration of


marker_T with respect to marker_F. All vector time-derivatives are taken in the reference
frame of marker_R.

ACCM(marker_T, marker_F, marker_R)

Learn more about acceleration functions.

9
Printed Documentation

Run-time functions

AINT

Returns the nearest integer whose magnitude is not larger than the integer value of a
specified expression that represents a numerical value:

AINT(x) = 0 if ABS(x)< 1
AINT(x)= int(x) if ABS(x)> 1

The value of int(x) is equal to x if x is an integer. If x is not an integer, then int(x) is equal
to the integer nearest to x, whose magnitude is not greater than the magnitude of x. Thus,

int(-7.0) = -7, int(-4.8) = -4, and int(4.8) = 4.

Note: AINT is not a differentiable function. Be careful when using this


function in an expression that defines a force or motion input to the
system.

Format

AINT (x)

Argument

x Any valid expression that evaluates to a real number.

Examples

The following functions show how AINT truncates results towards 0:

Function AINT(0.85)
Result 0

Function AINT(-0.5)
Result 0

10
Functions: A - M

Function AINT(4.6)
Result 4

Function AINT(-6.8)
Result -6

Learn more about math functions.

11
Printed Documentation

Run-time functions

ACOS

Returns the arc cosine of an expression that represents a numerical value. The evaluated
expression must return a value whose absolute value is 1. The value returned by ACOS
lies in the range [0, ], that is, 0 < ACOS(x) < .

Format

ACOS (x)

Argument

X Any valid expression that evaluates to a real number.

Example

The following function calculates the angle (in radians) between the line from marker_11
to marker_21 and the line from marker_41 to marker_31:

ACOS((DX(marker_21, marker_11) * DX(marker_31, marker_41) +


DY(marker_21, marker_11) *
DY(marker_31,marker_41) +
DZ(marker_21, marker_11) * DZ(marker_31,
marker_41)) /
(DM(marker_21, marker_11) * DM(marker_31,
marker_41))

Learn more about math functions.

12
Functions: A - M

Run-time functions

Algebraic Variable Value (VARVAL)

Returns the current value of the variable defined by the specified state variable modeling
entity.

Format

VARVAL(Algebraic Variable Name)

Argument

Algebraic Variable Name of an existing state variable


Name modeling entity; defined by an object
name.

Example

The following example illustrates the use of the VARVAL function:

VARVAL(variable_37)

Learn more about data element access.

13
Printed Documentation

Run-time functions

Akima Fitting Method (AKISPL)

Returns either a derivative of a curve or an interpolated value from a curve or surface.


The curve is fit exactly through a set of discrete data points using an Akima spline fitting
method.

Format

AKISPL (First Independent Variable, Second Independent Variable, Spline Name,


Derivative Order)

Arguments

First (Required) Real variable that represents the first


Independent independent variable in the spline.
Variable
Second (Optional) Real variable that represents the second
Independent independent variable in the spline.
Varialble
Spline Name (Required) The name of the existing data element
spline modeling entity that defines the set of
discrete data points to be used for the interpolation.
Derivative (Optional) The order of the derivative to be taken at
Order the interpolated point (integer).

The legal values are:

 0 - returns the curve coordinate value


 1 - returns the first derivative
 2 - returns the second derivative

Note: Derivative Order may not be specified when interpolating


on a surface; that is, when the Second Independent Variable =
0.

Example

A spline, spline_1, is defined with discrete data as shown in the following table. The data
is then used to generate the interpolation function using the Akima spline fitting method.

14
Functions: A - M

Since the spline defines a curve rather than a surface, the Second Independent Variable
must be set to 0.

In the following example, given the tabular data and a value for the independent variable,
the AKISPL returns the interpolated value for the dependent variable:

f = AKISPL(DX(marker_1, marker_2, marker_2), 0, spline_1)

Independent variable (x): Dependent variable (y):

-4.0 -3.6

-3.0 -2.5

-2.0 -1.2

-1.0 -0.4

0.0 0.0

1 0.4

2 1.2

3 2.5

4 3.6

Spline Defined Based on Tabular Data

15
Printed Documentation

Learn more about spline functions.

16
Functions: A - M

Run-time functions

Angle About X (AX)

Returns the rotational displacement (in radians) of one coordinate system marker about
the x-axis of another.

Format

AX (To Marker, From Marker)

Arguments

To (Required) The coordinate system marker whose rotation


Marker is being measured.
From (Optional) The coordinate system marker with respect to
Marker which the rotation is being measured. If you don't
specify this argument, it defaults to the global coordinate
system.

Equation

Mathematically, AX is calculated as follows:

where,

 is the y-axis of the To Marker, T.


 is the y-axis of the From Marker, F.
 is the z-axis of the From Marker, F.

Example

The following function returns the angle between the y-axes of marker_T and marker_F:

Function AX(marker_T, marker_F)

Result 0.5235 or /6

17
Printed Documentation

Learn more about displacement functions.

18
Functions: A - M

Run-time functions

Angle About Y (AY)

Returns the rotational displacement (in radians) of one coordinate system marker about
the y-axis of another.

Format

AY (To Marker, From Marker)

Arguments

To Marker (Required) The coordinate system marker whose


rotation is being measured.
From (Optional) The coordinate system marker with respect
Marker to which the rotation is being measured. If not
specified, this argument defaults to the global
coordinate system.

Equation

Mathematically, AY is calculated as follows:

where,

 is the z-axis of To Marker.


 is the z-axis of From Marker.
 is the x-axis of From Marker.

Example

The following function returns the angle between the x-axes of marker_T and marker_F:

Function AY(marker_T, marker_F)

Result 0.5235 or /6

19
Printed Documentation

Learn more about displacement functions.

20
Functions: A - M

Run-time functions

Angular Acceleration About X (WDTX)

Returns an x component of the difference between the angular acceleration vectors of two
coordinate system markers.

Format

WDTX (To Marker, From Marker, About Marker, Reference Frame)

Arguments

To Marker (Required) The coordinate system marker whose


angular acceleration is being measured.
From Marker (Optional) The coordinate system marker whose
angular acceleration is subtracted off. If you don't
specify this argument, it defaults to the global
origin.
About Marker (Optional) The coordinate system marker about
whose x-axis acceleration is measured. If you don't
specify this argument, it defaults to the global
coordinate axis.
Reference (Optional) The coordinate system marker in which
Frame time-derivatives are calculated. If you don't specify
this argument, it defaults to the ground reference
frame.

Equation

Mathematically, WDTX is calculated as follows:

where,

 is the angular velocity vector of the To Marker, T, with respect to the ground
reference frame.

 is the time-derivative of with respect to the Reference Frame, R.


 is the angular velocity vector of the From Marker, F, with respect to the ground
reference frame.

21
Printed Documentation

 is the time-derivative of with respect to the Reference Frame, R.


 is the unit vector along the x-axis of the About Marker, A.

Example

The following example returns the x component of the angular acceleration vector of
marker_T, with respect to marker_F, as seen in the global coordinate system of marker_A
and measured in the reference frame of marker_R:

WDTX(marker_T, marker_F, marker_A, marker_R)

Learn more about acceleration functions.

22
Functions: A - M

Run-time functions

Angle About Z (AZ)

Returns the rotational displacement (in radians) of one coordinate system marker about
the z-axis of another.

Format

AZ (To Marker, From Marker)

Arguments

To Marker (Required) The coordinate system marker whose


rotation is being measured.
From (Optional) The coordinate system marker with respect
Marker to which the rotation is being measured. If not
specified, this argument defaults to the global
coordinate system.

Equation

Mathematically, AZ is calculated as follows:

where,

 is the x-axis of To Marker.


 is the x-axis of From Marker.
 is the y-axis of From Marker.

Example

The following function returns the angle between the x-axes of marker_T and marker_F:

Function AZ(marker_T, marker_F)

Result 0.6109 or /5.1428

23
Printed Documentation

Learn more about displacement functions.

24
Functions: A - M

Run-time functions

Angular Acceleration About Y (WDTY)

Returns a y component of the difference between the angular acceleration vectors of two
coordinate system markers.

Format

WDTY (To Marker, From Marker, About Marker, Reference Frame)

Arguments

To Marker (Required) The coordinate system marker whose


angular acceleration is being measured.
From Marker (Optional) The coordinate system marker whose
angular acceleration is subtracted off. If you don't
specify this argument, it defaults to the global
origin.
About Marker (Optional) The coordinate system marker about
whose x-axis acceleration is measured. If you don't
specify this argument, it defaults to the global
coordinate axis.
Reference (Optional) The coordinate system marker in which
Frame time-derivatives are calculated. If you don't specify
this argument, it defaults to the ground reference
frame.

Equation

Mathematically, WDTY is calculated as follows:

where,

 is the angular velocity vector of the To Marker, T, with respect to the ground
reference frame.

 is the time-derivative of with respect to the Reference Frame, R.


 is the angular velocity vector of the From Marker, F, with respect to the ground
reference frame.
25
Printed Documentation

 is the time-derivative of with respect to the Reference Frame, R.


 is the unit vector along the y-axis of the About Marker, A.

Example

The following example returns the y component of the angular acceleration vector of
marker_T, with respect to marker_F, as seen in the global coordinate system of marker_A
and measured in the reference frame of marker_R:

WDTY(marker_T, marker_F, marker_A, marker_R)

Learn more about acceleration functions.

26
Functions: A - M

Run-time functions

Angular Acceleration About Z (WDTZ)

Returns a z component of the difference between the angular acceleration vectors of two
coordinate system markers.

Format

WDTZ (To Marker, From Marker, About Marker, Reference Frame)

Arguments

To Marker (Required) The coordinate system marker whose


angular acceleration is being measured.
From Marker (Optional) The coordinate system marker whose
angular acceleration is subtracted off. If you don't
specify this argument, it defaults to the global
origin.
About Marker (Optional) The coordinate system marker about
whose x-axis acceleration is measured. If you don't
specify this argument, it defaults to the global
coordinate axis.
Reference (Optional) The coordinate system marker in which
Frame time-derivatives are calculated. If you don't specify
this argument, it defaults to the ground reference
frame.

Equation

Mathematically, WDTZ is calculated as follows:

where,

 is the angular velocity vector of the To Marker, T, with respect to the ground
reference frame.

 is the time-derivative of with respect to the Reference Frame, R.


 is the angular velocity vector of the From Marker, F, with respect to the ground
reference frame.

27
Printed Documentation

 is the time-derivative of with respect to the Reference Frame, R.


 is the unit vector along the z-axis of the About Marker, A.

Example

The following example returns the z component of the angular acceleration vector of
marker_T, with respect to marker_F, as seen in the global coordinate system of marker_A
and measured in the reference frame of marker_R:

WDTZ(marker_T, marker_F, marker_A, marker_R)

Learn more about acceleration functions.

28
Functions: A - M

Run-time functions

Angular Acceleration Magnitude (WDTM)

Returns the magnitude of the difference between the angular acceleration vectors of two
coordinate system markers.

Format

WDTM (To Marker, From Marker, Reference Frame)

Arguments

To Marker (Required) The coordinate system marker whose


angular acceleration is being measured.
From Marker (Optional) The coordinate system marker whose
angular acceleration is subtracted off. If you don't
specify this argument, it defaults to the global
origin.
Reference (Optional) The coordinate system marker in which
Frame time-derivatives are calculated. If you don't specify
this argument, it defaults to the ground reference
frame.

Equation

Mathematically, WDTM is calculated as follows:

where,

 is the angular velocity vector of the To Marker, T, with respect to the ground
reference frame.

 is the time-derivative of with respect to the Reference Frame, R.


 is the angular velocity vector of the From Marker, F, with respect to the ground
reference frame.

 is the time-derivative of with respect to the Reference Frame, R.

Example

29
Printed Documentation

The following example returns the magnitude of the angular acceleration vector of
marker_T, with respect to marker_F, as seen in the global coordinate system of marker_A
and measured in the reference frame of marker_R:

WDTM(marker_T, marker_F)

Learn more about acceleration functions.

30
Functions: A - M

Run-time functions

Angular Velocity About X (WX)

Returns an x component of the difference between the angular velocity vectors of two
coordinate system markers.

Format

WX (To Marker, From Marker, About Marker)

Arguments

To Marker (Required) The coordinate system marker whose


angular velocity is being measured.
From (Optional) The coordinate system marker whose
Marker angular velocity is subtracted off. If you don't specify
this argument, it defaults to the global coordinate
system.
About (Optional) The coordinate system marker about
Marker whose x-axis the angular velocity is measured. If you
don't specify this argument, it defaults to the global x-
axis.

Equation

Mathematically, WX is calculated as follows:

where,

 is the angular velocity vector of the To Marker, T, with respect to the


ground reference frame, G.

 is the angular velocity vector of the From Marker, F, with respect to the
ground reference frame, G.
 is the unit vector along the x-axis of the About Marker, A.

Example

31
Printed Documentation

The following function returns the x component of the angular velocity between
marker_T and marker_F, as measured in the coordinate system of marker_A:

WX(marker_T, marker_F, marker_A)

Learn more about velocity functions.

32
Functions: A - M

Run-time functions

Angular Velocity About Y (WY)

Returns a y component of the difference between the angular velocity vectors of two
coordinate system markers.

Format

WY (To Marker, From Marker, About Marker)

Arguments

To Marker (Required) The coordinate system marker whose


angular velocity is being measured.
From (Optional) The coordinate system marker whose
Marker angular velocity is subtracted off. If you don't specify
this argument, it defaults to the global coordinate
system.
About (Optional) The coordinate system marker about
Marker whose y-axis the angular velocity is measured. If you
don't specify this argument, it defaults to the global y-
axis.

Equation

Mathematically, WY is calculated as follows:

where,

 is the angular velocity vector of the To Marker, T, with respect to the


ground reference frame, G.

 is the angular velocity vector of the From Marker, F, with respect to the
ground reference frame, G.
 is the unit vector along the y-axis of the About Marker, A.

Example

The following function returns the y component of the angular velocity between
marker_T and marker_F, as measured in the coordinate system of marker_A:
33
Printed Documentation

WY(marker_T, marker_F, marker_A)

Learn more about velocity functions.

34
Functions: A - M

Run-time functions

Angular Velocity About Z (WZ)

Returns a z component of the difference between the angular velocity vectors of two
coordinate system markers.

Format

WZ (To Marker, From Marker, About Marker)

Arguments

To Marker (Required) The coordinate system marker whose


angular velocity is being measured.
From (Optional) The coordinate system marker whose
Marker angular velocity is subtracted off. If you don't specify
this argument, it defaults to the global coordinate
system.
About (Optional) The coordinate system marker about
Marker whose z-axis the angular velocity is measured. If you
don't specify this argument, it defaults to the global z-
axis.

Equation

Mathematically, WZ is calculated as follows:

where,

 is the angular velocity vector of the To Marker, T, with respect to the


ground reference frame, G.

 is the angular velocity vector of the From Marker, F, with respect to the
ground reference frame, G.
 is the unit vector along the z-axis of the About Marker, A.

Example

The following function returns the z component of the angular velocity between
marker_T and marker_F, as measured in the coordinate system of marker_A:

35
Printed Documentation

WZ(marker_T, marker_F, marker_A)

Learn more about velocity functions.

36
Functions: A - M

Run-time functions

Angular Velocity Magnitude (WM)

Returns the magnitude of the difference between the angular velocity vectors of two
coordinate system markers.

Format

WM (To Marker, From Marker)

Arguments

To Marker (Required) The coordinate system marker whose


angular velocity is being measured.
From Marker (Optional) The coordinate system marker whose
angular velocity is subtracted off. If not specified,
this argument defaults to the global coordinate
system.

Equation

Mathematically, WM is calculated as follows:

where,

 is the angular velocity vector of the To Marker, T, with respect to the


ground reference frame, G.

 is the angular velocity vector of the From Marker, F, with respect to the
ground reference frame, G.

Example

The following example returns the magnitude of the angular velocity vector between
marker_T and marker_F:

WM(marker_T, marker_F)

37
Printed Documentation

Learn more about velocity functions.

38
Functions: A - M

Run-time functions

ANINT

Returns the nearest integer whose magnitude is not larger than the real value of an
expression that represents a numerical value:

ANINT(x) = INT(x + 0.5) if x > 0


ANINT(x) = INT(x - 0.5) if x < 0

The value of the mathematical function INT of a variable x is equal to x if x is an integer.


If x is not an integer, then INT(x) is equal to the nearest integer to x, whose magnitude is
not greater than the magnitude of x. Thus,

INT(-7.0) = -7, INT(-4.8) = -4, and INT(4.8) = 4.

Format

ANINT (x)

Argument

x Any valid expression that evaluates to a real number.

Examples

The following functions show how ANINT rounds the results to the nearest integer:

Function ANINT(-0.9)

Result -1

Function ANINT(0.33)

Result 0

39
Printed Documentation

Function ANINT(-4.6)

Result -5

Function AINT(4.6)

Result 5

Learn more about math functions.

40
Functions: A - M

Run-time functions

Array Element Value (ARYVAL)

Returns the value of the specified element of the specified array modeling entity.

Format

ARYVAL(Array Name, Element Number)

Arguments

Array Name Name of an existing array modeling entity; defined


by an object name.
Element The number of the element within the array whose
Number value you want to get.

Example

The following example illustrates the use of the ARYVAL function:

ARYVAL(array_45,3)

Learn more about data element access.

41
Printed Documentation

Run-time functions

ASIN

Returns the arc sine of an expression that represents a numerical value. ASIN is defined
only when the absolute value of the expression is <1 . The range of ASIN is
(that is, ).

Format

ASIN(x)

Argument

x Any valid expression that evaluates to a real number.

Example

The following function calculates the value of the expression:

DX(marker_21, marker_11) / DM(marker_21, marker_11)

and then applies the ASIN function to the result and returns its arc sine in radians:

ASIN(DX(marker_21, marker_11) / DM(marker_21, marker_11))

42
Functions: A - M

Run-time functions

ATAN

Returns the arc tangent of an expression that represents a numerical value. The range of
ATAN is [-90o, 90o] (that is, -90o < ATAN(x) < 90o).

Format

ATAN(x)

Argument

x Any valid expression that evaluates to a real number.

Examples

The arc tangent (in radians) of the expression a/b where a is the x component of the
distance between marker_2 and marker_3 and b is the y component of the distance
between marker_2 and marker_3.

ATAN(DX(marker_2, marker_3)/ DY(marker_2, marker_3))

The figure below shows angle (in radians) between the line joining marker_3 and
marker_4 and the global x-axis:

ATAN(DY(marker_4, marker_3)/ DX(marker_4, marker_3))

Learn more about math functions.

43
Printed Documentation

44
Functions: A - M

Run-time functions

ATAN2

Returns the arc tangent of two expressions, each representing a numerical value. x1 and
x2 themselves may be expressions.

< ATAN2(x1, x2) <


ATAN2(x1, x2) > 0 if x1 > 0
ATAN2(x1, x2) = 0 if x1 = 0, x2 > 0
ATAN2(x1, x2) = if x1 = 0, x2 if x2 = 0
ATAN2(x1, x2) undefined if x1 = 0, and x2 = 0

Format

ATAN2(x1, x2)

Arguments

x1 Any valid expression that evaluates to a real number.


x2 Any valid expression that evaluates to a real number.

Example

The following function shows arc tangent (in radians) of the expression a/b where a is the
x component of the distance between marker_2 and marker_3 and b is the y component
of the distance between marker_2 and marker_3:

ATAN2(DX(marker_2, marker_3), DY(marker_2, marker_3))

Learn more about math functions.

45
Printed Documentation

Run-time functions

B-Spline Fitting Method (CURVE)

Returns a B-spline or a user-written curve created by a CURVE data element.

Format

CURVE (Independent Variable, Derivative Order, Direction, Curve Name)

Arguments

Independent Real variable that represents the independent variable at


Variable which the curve will be evaluated (function).

If the curve is a B-spline, the Independent Variable must be in


the range: - 1 Independent Variable 1. If the curve is user-
written (computed by a CURSUB), the Independent Variable
must be in the range: Min_Parameter Independent Variable
Max_Parameter where Min_Parameter and Max_Parameter
are specified on the CURVE data element.

Derivative Order Order of the derivative that you want returned from
the curve.

The legal values are:

 0 - returns the curve coordinate value


 1 - returns the first derivative
 2 - returns the second derivative

Direction Direction in which you want the curve evaluated.

The legal values are:

 1 - returns the x coordinate or derivative


 2 - returns the y coordinate or derivative
 3 - returns the z coordinate or derivative

Curve Name Name of the curve to reference (curve object).

Example

The following function returns the x direction evaluated value of curve_1 at point TIME,
where TIME is the current simulation time:

46
Functions: A - M

CURVE(TIME, 0, 1, curve_1)

Learn more about spline functions.

47
Printed Documentation

Run-time functions

B313 Sequence: 1st Rotation (PSI)

Returns the first angle of rotation (in radians) associated with a body-fixed 313 rotation
sequence from one coordinate system marker to another. This first rotation is referred to
as the psi, , angle, and is used in association with the theta, , (2nd rotation) and phi,
, (3rd rotation) angles.

Positive angular displacement is determined by the right-hand rule.

Format

PSI (To Marker, From Marker)

Arguments

To Marker (Required) The coordinate system marker whose


rotation is being measured.
From Marker (Optional) The coordinate system marker with
respect to which the rotation is being measured. If
you don't specify this argument, it defaults to the
global coordinate system.

Example

The following example returns all the angles of rotation associated with a body-fixed 313
rotation sequence:

48
Functions: A - M

There are always at least two equivalent sets of rotation angles that yield the same final
orientation. Using the above example, the same final orientation is achieved by using
either of the following sets of rotation angles:

49
Printed Documentation

PSI (marker_T, marker_F) = +90o -90o

THETA (marker_T, marker_F) = -90o or +90o

PHI (marker_T, marker_F) = +90o -90o

Learn more about displacement functions.

50
Functions: A - M

Run-time functions

B313 Sequence: 3rd Rotation (PHI)

Returns the third angle of rotation (in radians) associated with a Body 313 rotation
sequence from one coordinate system marker to another. This third rotation is referred to
as the phi, , angle, and is used in association with the psi, , (1st rotation) and theta,
, (2nd rotation) angles.

Positive angular displacement is determined by the right-hand rule.

Format

PHI (To Marker, From Marker)

Arguments

To (Required) The coordinate system marker whose rotation is


Marker being measured.
From (Optional) The coordinate system marker with respect to
Marker which the rotation is being measured. If not specified, this
argument defaults to the global coordinate system.

Example

The following example illustrates the use of the PHI function:

PHI(marker_T, marker_F)

See the illustration for B313 Sequence: 1st Rotation (PSI).

Learn more about displacement functions.

51
Printed Documentation

Run-time functions

B313 Sequence: 2nd Rotation (THETA)

Returns the second angle of rotation (in radians) associated with a Body 313 rotation
sequence from one coordinate system marker to another. This second rotation is referred
to as the theta, , angle, and is used in association with the psi, , (1st rotation) and phi,
, (3rd rotation) angles.

Positive angular displacement is determined by the right-hand rule.

Format

THETA (To Marker, From Marker)

Arguments

To Marker (Required) The coordinate system marker whose


rotation is being measured.
From (Optional) The coordinate system marker with respect
Marker to which the rotation is being measured. If not
specified, this argument defaults to the global
coordinate system.

Example

The following example illustrates the use of the THETA function:

THETA(marker_T, marker_F)

See the illustration for B313 Sequence: 1st Rotation (PSI).

Learn more about displacement functions.

52
Functions: A - M

Run-time functions

B321 Sequence: 1st Rotation (YAW)

Returns the first angle of rotation (in radians) associated with a body-fixed 321 rotation
sequence from one coordinate system marker to another. This angle is referred to as the
yaw angle, and is used in association with the pitch (2nd rotation) and roll (3rd rotation)
angles.

Positive angular displacement is determined by the right-hand rule.

Format

YAW (To Marker, From Marker)

Arguments

To Marker (Required) The coordinate system marker whose


rotation is being measured.
From (Optional) The coordinate system marker with respect
Marker to which the rotation is being measured. If you don't
specify this argument, it defaults to the global
coordinate system.

Example

The following example returns all the angles of rotation associated with a body-fixed 321
rotation sequence:

53
Printed Documentation

54
Functions: A - M

There are always at least two equivalent sets of rotation angles that yield the same final
orientation. Using the above example, the same final orientation can be achieved by using
any of the following sets of rotation angles.

Learn more about displacement functions

55
Printed Documentation

Run-time functions

B321 Sequence: 2nd Rotation (PITCH)

Returns the negative of the second angle of rotation (in radians) associated with a body-
fixed 321 rotation sequence from one coordinate system marker to another. This angle is
referred to as the pitch angle, and is used in association with the yaw (1st rotation) and
roll (3rd rotation) angles.

Note: Opposite from convention, this function calculates the negative


of the second body-fixed 321 angle.

Format

PITCH (To Marker, From Marker)

Arguments

To Marker (Required) The coordinate system marker whose


rotation is being measured.
From (Optional) The coordinate system marker with respect
Marker to which the rotation is being measured. If not
specified, this argument defaults to the global
coordinate system.

Example

The following example illustrates the use of the PITCH function:

PITCH(marker_T, marker_F)

See the illustration for B321 Sequence: 1st Rotation (YAW).

Learn more about displacement functions.

56
Functions: A - M

Run-time functions

B321 Sequence: 3rd Rotation (ROLL)

Returns the third angle of rotation (in radians) associated with a Body 321 rotation
sequence from one coordinate system marker to another. This angle is referred to as the
roll angle, and is used in association with the yaw (1st rotation) and pitch (2nd rotation)
angles.

Positive angular displacement is determined by the right-hand rule.

Format

ROLL (To Marker, From Marker)

Arguments

To Marker (Required) The coordinate system marker whose


rotation is being measured.
From (Optional) The coordinate system marker with respect
Marker to which the rotation is being measured. If not
specified, this argument defaults to the global
coordinate system.

Example

The following example illustrates the use of the ROLL function:

ROLL(marker_T, marker_F)

See the illustration for B321 Sequence: 1st Rotation (YAW).

Learn more about displacement functions.

57
Printed Documentation

Run-time functions

Beam Force (BEAM)

Returns a force or torque applied by a specified beam force on one or two bodies directly
affected by the beam force.

Format

BEAM (Beam Force Name, On This Body, Force Component, Along/About Axes)

Arguments

Beam Force (Required) Beam force for which the force is


Name measured.
On This Body (Required) Body on which the force is measured.

The legal values are:

 0 = forces and torques on the first body, at


the I marker
 1 = forces and torques on the second body,
at the J marker

Force (Required) Force or torque component you want to


Component measure.

The legal values are:

 Fm = 1 = force magnitude
 Fx = 2 = x component of the force
 Fy = 3 = y component of the force
 Fz = 4 = z component of the force
 Tm = 5 = torque magnitude
 Tx = 6 = x component of the torque
 Ty = 7 = y component of the torque
 Tz = 8 = z component of the torque

58
Functions: A - M

Along/About (Optional) Coordinate system marker in which the


Axes results are measured.

To have your results measured in the global coordinate


system, do one of the following:

 If you're entering your function through the


Assist dialog box, leave the Along/About Axes
text box empty.
 If you're entering your function directly in the
function text box, enter a 0.

Example

The following function returns the z component of the force vector acting on the first
body (at the I marker) of .model_2.beam_1, measured along the z-axis of the global
coordinate system:

BEAM(.model_2.beam_1, 0, 4, 0)

Learn more about force in object functions.

59
Printed Documentation

Run-time functions

Bushing Force (BUSH)

Returns a force or torque applied by a specified bushing force on one or two bodies
directly affected by the bushing force.

Format

BUSH (Bushing Force Name, On This Body, Force Component, Along/About Axes)

Arguments

Bushing Force (Required) Bushing force for which the force is


Name measured.
On This Body (Required) Body on which the force is measured.

The legal values are:

 0 = forces and torques on the first body, at


the I marker
 1 = forces and torques on the second
body, at the J marker

Force (Required) Force or torque component you want


Component to measure.

The legal values are:

 Fm = 1 = force magnitude
 Fx = 2 = x component of the force
 Fy = 3 = y component of the force
 Fz = 4 = z component of the force
 Tm = 5 = torque magnitude
 Tx = 6 = x component of the torque
 Ty = 7 = y component of the torque
 Tz = 8 = z component of the torque

60
Functions: A - M

Along/About (Optional) Coordinate system marker in which


Axes the results are measured.

To have your results measured in the global coordinate


system, do one of the following:

 If you're entering your function through the


Assist dialog box, leave the Along/About
Axes text box empty.
 If you're entering your function directly in
the function text box, enter a 0.

Example

The following function returns the y component of the torque vector acting on the first
body (at the I marker) of .model_2.bushing_1, measured along the y-axis of the global
coordinate system:

BUSH(.model_2.bushing_1, 0, 7, 0)

Learn more about force in object functions.

61
Printed Documentation

Run-time functions

Chebyshev Polynomial (CHEBY)

Evaluates a Chebyshev polynomial at a user-specified numerical value.

Format

CHEBY (x, Shift, Coefficients)

Arguments

x Real variable that specifies the independent variable.


Shift Real variable that specifies a shift in the Chebyshev
polynomial.
Coefficients Real variables that define as many as thirty-one
coefficients for the Chebyshev polynomial.

Example

The following example illustrates the use of the CHEBY function:

CHEBY(TIME, 1, 1, 0, -1)

The above function defines the following quadratic Chebyshev polynomial (where TIME
is the current simulation time):

CHEBY = 1 + 0 * (TIME-1) - 1 * [2 (TIME-1)2 - 1]


= -2*TIME2 + 4*TIME

Learn more about math functions.

62
Functions: A - M

Run-time functions

CONTACT

The CONTACT function returns the component comp of the force in CONTACT/id in
the coordinate system of marker rm. If jflag is set to zero, ADAMS/Solver (FORTRAN)
returns the value of the force/torque that acts on the I marker of CONTACT. If jflag is set
to 1, ADAMS/Solver (FORTRAN) returns the value that acts on the J marker. To obtain
results in the global coordinate system, you can specify rm as zero.

Format

CONTACT (id, jflag, comp, rm)

Arguments

id An integer specifying the identification number of the CONTACT.


jflag An integer flag specifying the CONTACT connectivity marker at which
the forces and torques are computed.

 0 = forces and moments at the I marker


 1 = forces and moment at the J marker

comp An integer value that specifies the component of the CONTACT to be


returned.

 1 - magnitude of the force applied by all incidents


of contact id
 2 - x-component of the force applied by all
incidents of contact id
 3 - y-component of the force applied by all
incidents of contact id
 4 - z-component of the force applied by all
incidents of contact id
 5 - magnitude of the torque applied by all incidents
of contact id
 6 - x-component of the torque applied by all
incidents of contact id
 7 - y-component of the torque applied by all
incidents of contact id
 8 - z-component of the torque applied by all
incidents of contact id

rm The coordinate system in which the results are

63
Printed Documentation

expressed. To return the results in the global coordinate


system, set rm = 0.

Examples

REQUEST/1
, F2= CONTACT(11,0,2,0)\
, F3= CONTACT(11,0,3,0)\
, F4= CONTACT(11,0,4,0)\
, F6= CONTACT(11,0,6,0)\
, F7= CONTACT(11,0,7,0)\
, F8= CONTACT(11,0,8,0)

This REQUEST statement outputs the x-, y- and z-components of the force and torque at
the I marker of CONTACT/11. Since rm is specified as zero, all vectors are expressed in
the global coordinate system.

64
Functions: A - M

Run-time functions

COS

Returns the cosine of an expression that represents a numerical value.

Format

COS (x)

Argument

x Any valid expression that evaluates to a real number.

Example

The following function returns the cosine of 2* *TIME, where TIME is the current
simulation time:

COS(2* *TIME)

Learn more about math functions.

65
Printed Documentation

Run-time functions

COSH

Returns the hyperbolic cosine of an expression that represents a numerical value.

COSH(x) = (ex + e-x)/2.0

Format

COSH(x)

Argument

x Any valid expression that evaluates to a real number.

Example

The following function returns the hyperbolic cosine of the z component of the
displacement of marker_2 with respect to marker_1. The result is computed in the
coordinate system of marker_1.

COSH(DZ(marker_2, marker_1, marker_1))

Learn more about math functions.

66
Functions: A - M

Run-time functions

Cubic Fitting Method (CUBSPL)

Returns either a derivative of a curve or an interpolated value from a curve or surface.


The curve is fit exactly through a set of discrete data points using a standard cubic spline
fitting method.

Format

CUBSPL (First Independent Variable, Second Independent Variable, Spline Name,


Derivative Order)

Arguments

First (Required) A real variable that represents the first


Independent independent variable of the spline.
Variable
Second (Optional) A real variable that represents the
Independent second independent variable of the spline.
Variable
Spline Name (Required) The name of the existing data element
spline modeling entity that defines the set of
discrete data points to be used for the
interpolation.
Derivative Order (Optional) The order of the derivative to be taken
at the interpolated point (integer).

The legal values are:

 0 - returns the curve coordinate value


 1 - returns the first derivative
 2 - returns the second derivative

Note: Derivative Order may not be specified when


interpolating on a surface; that is, when the Second
Independent Variable 0.

Example

A spline, spline_1, is defined with discrete data as shown in the following table. The data
is then used to generate the interpolation function using the Cubic spline fitting method.

67
Printed Documentation

Since the spline defines a curve rather than a surface, the Second Independent Variable
must be set to 0.

The following example returns the interpolated value of the spline of displacement over
time, to define a motion function:

Motion = CUBSPL(TIME, 0, spline_1)


Independent variable (Time) Dependent variable (Displacement)

0 100

1 125
2 130
3 80
4 40
5 20

Spline Defined Based on Tabular Data

Learn more about spline functions.

68
Functions: A - M

Run-time functions

Curve-to-Curve Force (CVCV)

Returns a force or torque induced by a specified curve-to-curve object on one of the two
bodies connected by the curve-to-curve object.

Note: CVCV can only be used for output purposes. Therefore, it can be
used only with output request and sensor objects.

Format

CVCV (Curve-to-curve Name, On This Body, Force Component, Along/About Axes)

Arguments

Curve-to-curve (Required) Curve-to-curve for which the force is


Name measured.
On This Body (Required) Body on which the force is
measured.

The legal values are:

 0 = forces and torques on the first body,


at the I marker
 1 = forces and torques on the second
body, at the J marker

Force Component (Required) Force or torque component you


want to measure.

The legal values are:

 Fm = 1 = force magnitude
 Fx = 2 = x component of the force
 Fy = 3 = y component of the force
 Fz = 4 = z component of the force
 Tm = 5 = torque magnitude
 Tx = 6 = x component of the torque

69
Printed Documentation

 Ty = 7 = y component of the torque


 Tz = 8 = z component of the torque

Along/About (Optional) Coordinate system marker in which


Axes the results are measured.

To have your results measured in the global


coordinate system, do one of the following:

 If you're entering your function through


the Assist dialog box, leave the
Along/About Axes text box empty.
 If you're entering your function directly in
the function text box, enter a 0.

Example

The following function returns the y component of the force vector acting on the first
body (at the I marker) of .model_1.cvcv_31, measured along the y-axis of the global
coordinate system:

CVCV(.model_1.cvcv_31, 0, 3, 0)

Learn more about force in object functions.

70
Functions: A - M

Run-time functions

Differential Variable Integrated Value (DIF)

Returns the integrated value of the variable defined by the specified differential equation
modeling entity.

Format

DIF(Differential Variable Name)

Argument

Differential Name of an existing differential equation


Variable Name modeling entity; defined by an object name.

Example

The following example illustrates the use of the DIF function:

DIF(diffeq_6)

Learn more about data element access.

71
Printed Documentation

Run-time functions

Differential Variable Value (DIF1)

Returns the value of the variable defined by the specified differential equation modeling
entity.

Format

DIF1(Differential Variable Name)

Argument

Differential Name of an existing differential equation


Variable Name modeling entity; defined by an object name.

Example

The following example illustrates the use of the DIF1 function:

DIF1(.diffeq_4)

Learn more about data element access.

72
Functions: A - M

Run-time functions

DIM

Returns the positive difference of the instantaneous values of two expressions, each
representing a numerical value.

DIM(x1, x2) = 0 if x1 x2
DIM(x1, x2) =x1-x2 if x1 > x2
Note: DIM is a discontinuous function and must be used with caution.

Format

DIM(x1,x2)

Arguments

x1 Any valid expression that evaluates to a real number.


x2 Any valid expression that evaluates to a real number.

Example

The following function returns 0 as long as TIME 5, and TIME - 5 for TIME > 5.
TIME is the current simulation time.

DIM(TIME,5)
Learn more about math functions.

73
Printed Documentation

Run-time functions

Distance Along X (DX)

Returns an x component of the translational displacement vector from one coordinate


system marker to another.

Format

DX (To Marker, From Marker, Along Marker)

Arguments

To Marker (Required) Coordinate system marker to which the


distance is measured.
From (Optional) Coordinate system marker from which the
Marker distance is measured.
Along (Optional) Coordinate system marker along whose x-axis the distance
Marker is measured.

Note: If not specified, optional arguments default to global coordinate


system.

Equation

Mathematically, DX is calculated as follows:

where,

 is the position vector from the global origin to the To Marker, T.


 is the position vector from the global origin to the From Marker, F.
 is the unit vector along the x-axis of the Along Marker, A.

Example

The following function returns the x component of the displacement vector from
marker_F to marker_T, along the x-axis of marker_A:

Function DX(marker_T, marker_F, marker_A)

74
Functions: A - M

Result 12

Learn more about displacement functions.

75
Printed Documentation

Run-time functions

Distance Along Y (DY)

Returns a y component of the translational displacement vector from one coordinate


system marker to another.

Format

DY (To Marker, From Marker, Along Marker)

Arguments

To (Required) Coordinate system marker to which the


Marker distance is measured.
From (Optional) Coordinate system marker from which the
Marker distance is measured.
Along (Optional) Coordinate system marker along whose y-axis the distance is
Marker measured.

Note: If not specified, optional arguments default to global coordinate


system.

Equation

Mathematically, DY is calculated as follows:

where,

 is the position vector from the global origin to the To Marker, T.


 is the position vector from the global origin to the From Marker, F.
 is the unit vector along the y-axis of the Along Marker, A.

Example

The following function returns the y component of the displacement vector from
marker_F to marker_T, along the y-axis of marker_A:

Function DY(marker_T, marker_F, marker_A)

76
Functions: A - M

Result -5

Learn more about displacement functions.

77
Printed Documentation

Run-time functions

Distance Along Z (DZ)

Returns a z component of the translational displacement vector from one coordinate


system marker to another.

Format

DZ (To Marker, From Marker, Along Marker)

Arguments

To (Required) Coordinate system marker to which the


Marker distance is measured.
From (Optional) Coordinate system marker from which the
Marker distance is measured.
Along (Optional) Coordinate system marker along whose z-axis the distance is
Marker measured.

Note: If not specified, optional arguments default to global coordinate


system.

Equation

where,

 is the position vector from the global origin to the To Marker, T.


 is the position vector from the global origin to the From Marker, F.
 is the unit vector along the z-axis of Along Marker, A.

Example

The following function returns the z component of the displacement vector from
marker_F to marker_T, along the z-axis of marker_A:

Function DZ(marker_T, marker_F, marker_A)

Result 0

78
Functions: A - M

Learn more about displacement functions.

79
Printed Documentation

Run-time functions

Distance Magnitude (DM)

Returns the magnitude of the translational displacement vector from one coordinate
system marker to another.

Format

DM (To Marker, From Marker)

Arguments

To Marker (Required) Coordinate system marker to which


the distance is measured.
From Marker (Optional) Coordinate system marker from
which the distance is measured. If not
specified, this argument defaults to the global
coordinate system.

Equation

Mathematically, DM is calculated as follows:

where,

 is the position vector from the global origin to the To Marker, T.


 is the position vector from the global origin to the From Marker, F.

Example

The following function returns a number greater than or equal to 0:

Function DM(marker_T, marker_F)

Result 13

80
Functions: A - M

Learn more about displacement functions.

81
Printed Documentation

Run-time functions

DTOR

Returns the degrees-to-radian units conversion factor ( /180), same as (PI/180).

Format

DTOR

Argument

None

Example

The following example represents a value of 30 degrees in units of radians:

30d*DTOR or (30 *PI/180)

Learn more about Constants and Variables.

82
Functions: A - M

Run-time functions

EXP

Returns the value ex, where x is any expression that represents a numerical value.

Format

EXP(x)

Argument

x Any valid expression that evaluates to a real number.

Example

The following function returns e2*TIME, where TIME is the current simulation time:

EXP(2*TIME)

Learn more about math functions.

83
Printed Documentation

Run-time functions

Field Force (FIELD)

Returns a force or torque applied by a specified field force on one or two bodies directly
affected by the field force.

Format

FIELD (Field Force Name, On This Body, Force Component, Along/About Axes)

Arguments

Field Force (Required) Field force for which the force is


Name measured.
On This Body (Required) Body on which the force is measured.

The legal values are:

 0 = forces and torques on the first body, at


the I marker
 1 = forces and torques on the second body, at
the J marker

Force (Required) Force or torque component you want to measure.


Component
The legal values are:

 Fm = 1 = force magnitude
 Fx = 2 = x component of the force
 Fy = 3 = y component of the force
 Fz = 4 = z component of the force
 Tm = 5 = torque magnitude
 Tx = 6 = x component of the torque
 Ty = 7 = y component of the torque
 Tz = 8 = z component of the torque

84
Functions: A - M

Along/About (Optional) Coordinate system marker in which the results are


Axes measured.

To have your results measured in the global coordinate


system, do one of the following:

 If you're entering your function through the


Assist dialog box, leave the Along/About Axes
text box empty.
 If you're entering your function directly in the
function text box, enter a 0.

Example

The following function returns the magnitude of the torque acting on the second body (at
the J marker) of .model_1.field_11, measured in the global coordinate system:

FIELD(.model_1.field_11, 1, 5, 0)

Learn more about force in object functions.

85
Printed Documentation

Run-time functions

Fourier Cosine Series (FORCOS)

Evaluates a Fourier Cosine series at a user-specified value x.

Format

FORCOS (x, Shift, Frequency, Coefficients)

Arguments

x Real variable that specifies the independent variable.


Shift Real variable that specifies a shift in the Fourier Cosine
series.
Frequency Real variable that specifies the fundamental frequency
of the series. MSC.ADAMS assumes that is in
radians per unit of the independent variable unless
you use a D after the value for degrees.
Coefficients Real variables that define as many as thirty-one
coefficients for the Fourier Cosine series.

Example

The following function defines a Fourier Cosine, which is a harmonic function of time
with no shift, and a fundamental frequency of 1 cycle (360 degrees) per time unit:

COS(TIME, 0, 360D, 1, 2, 3, 4)

The function defined is as follows:

FORCOS = 1 + 2*COS(360D*TIME)+
3*COS(2*360D*TIME)+
4*COS(3*360D*TIME)

TIME is the current simulation time.

Learn more about math functions.

86
Functions: A - M

Run-time functions

Fourier Sine Series (FORSIN)

Evaluates a Fourier Sine series at a user-specified value x.

Format

FORSIN (x, Shift, Frequency, Coefficients)

Arguments

x Real variable that specifies the independent variable.


Shift Real variable that specifies a shift in the Fourier Sine
series.
Frequency Real variable that specifies the fundamental frequency
of the series. Assume that is in radians per unit of
the independent variable unless you use a D after the
value for degrees.
Coefficients The real variables that define as many as thirty-one
coefficients for the Fourier Sine series.

Example

The following function defines a Fourier Sine, which is a harmonic function of TIME
with a -0.25 shift, and a fundamental frequency of 0.5 cycle ( radians) per time unit:

FORSIN(TIME,-0.25, PI, 0, 1, 2, 3)

The function defined is as follows:

FORSIN = 0 + SIN( *(TIME + 0.25))


+ 2*SIN(2 *(TIME + 0.25))
+ 3*SIN(3 *(TIME + 0.25))

TIME is the current simulation time.

Learn more about math functions.

87
Printed Documentation

Run-time functions

Haversine Step (HAVSIN)

Defines a haversine function. HAVSIN is most often used to represent a smooth


transition between two functions.

Note: The HAVSIN function behavior is similar to the behavior of the


STEP functions. HAVSIN is much smoother than either of these
functions. The smoothness, however, causes its derivatives to be
slightly larger than that of STEP.

The following plot shows a comparison between HAVSIN and STEP, STEP5, and
TANH.

Format

HAVSIN (x, Begin At, End At, Initial Function Value, Final Function Value)

Arguments

88
Functions: A - M

x Real variable that specifies the independent


variable.
Begin At Real variable that specifies the x value at which
the haversine function begins.
End At Real variable that specifies the x value at which
the haversine function ends.
Initial Function Initial value of the haversine function.
Value
Final Function Final value of the haversine function.
Value

Example

The following function defines a smooth step function from time 1 to time 2 with a
displacement from 0 to 1:

HAVSIN(TIME, 1, 0, 2, 1)

Learn more about math functions.

89
Printed Documentation

Run-time functions

IF

Allows you to conditionally define a function expression.

Note: Using the IF function will likely cause discontinuities in the


derivatives of the function evaluation, which can cause the integrator
to decrease the time step size or fail. We recommend that you use the
STEP function instead of the IF.

Format

IF(Expression1: Expression2, Expression3, Expression4)

Arguments

Expression1 The expression MSC.ADAMS evaluates.


Expression2 If the value of Expression1 is less than 0, IF returns
Expression2.
Expression3 If the value of Expression1 is 0, IF returns
Expression3.
Expression4 If the value of Expression1 is greater than 0, IF
returns Expression4.

Example

In the following illustration, the expression returns different values depending on the
value of the variable called time:

Function IF(time-2.5:0,0.5,1)

0.0 if time < 2.5

Result 0.5 if time = 2.5

1.0 if time > 2.5

90
Functions: A - M

Learn more about constants and variables.

91
Printed Documentation

Run-time functions

Inverse Power Spectral Density (INVSPD)

Regenerates a time signal from a power spectral density description.

Format

INVPSD (Independent Variable, Spline Name, Min Frequency, Max Frequency, Num
Frequencies, Use Logarithmic, Random Number Seed)

Arguments

Independent Independent variable


Variable or x
Spline Name Name of the spline containing the PSD data
versus frequency.
Min Frequency or Real variable that specifies the lowest
f0 frequency to be regenerated.
Max Frequency or Real variable that specifies the highest
f1 frequency to be regenerated.
Num Frequencies Real variable that specifies the number of
or nf frequencies. This number is supposed to be
larger than 1 and less than 200.
Use Logarithmic or Real variable that acts as a flag indicating whether
linlog the PSD data points are interpolated in the linear or
logarithmic domain.

The legal values are:

 yes (0) - linear domain


 no (1) - logarithmic domain

Random Number Real variable that specifies a seed for a


Seed or Seed random number generator, used to calculate
the phase shifts. During a simulation, PSD can
be called with up to a maximum of 20
different seeds.

Equation

Mathematically, INVPSD is calculated as follows:

92
Functions: A - M

The regenerated signal consists of a series of sinusoidal functions where the amplitudes,
Ai, are determined in such a way that the effective value for the PSD and the time signal
are the same. The phase angle, , is calculated by a pseudo-random
number generator.

Using the same seed value will always result in the same set of phase angles.

Back to top

Example

For the power spectral density data shown in Figure 1, INVPSD(TIME, spline_1, 1, 10,
20, 0, 0) regenerates the time signal shown in Figure 2.

Figure 1. PSD vs. Frequency in Log-Log Scale

Figure 2. Regenerated Time Signal

93
Printed Documentation

Learn more about math functions.

94
Functions: A - M

Run-time functions

INTERP
The INTERP function returns the iord derivative of the interpolated value of SPLINE/id
at time=x. The INTERP function supports time-series splines, which are splines that
include a FILE argument that specifies a time history file of type DAC or RPC III.

Format

INTERP (Indep_Var, Method, Spline_name, Deriv_order)

Arguments

Independent Enter a real variable that specifies the value of time,


Variable the independent variable along the x-axis of the time
series spline that is being interpolated.
Derivative Select the order of the derivative that ADAMS/Solver
Order takes at the interpolated point, and then returns
through INTERP.

 Curve Coordinates (0) - Take no derivative (default)


 1st Derivative (1)
 2nd Derivative (2)

Interpolation Select the method of interpolation:


Method
 Linear (1)
 Cubic (3)

Spline Name Enter the name of the SPLINE statement in the


ADAMS/Solver dataset. The SPLINE statement must
reference time series data from a DAC or RPC III file.

Back to top

Examples

As part of the ADAMS/Durability feature, the INTERP function lets you specify how
you want to interpolate spline data from an RPC III or DAC time history file. An
example is shown below of how to specify the INTERP function in ADAMS/Solver for
durability analysis.

95
Printed Documentation

For durability analysis, the INTERP function appears in a motion or force statement, and
looks as follows:

INTERP(time, 3, spline id)

where:

 time is the independent variable of the interpolation. For durability analysis, this
real variable is always time or an expression that includes time.
 3 is the method of interpolation, which indicates cubic interpolation between data
points. 1, which indicates linear interpolation, is also a valid entry.
 spline id is the identifier of the spline that specifies the RPC III or DAC file input.
Setting up a Spline in ADAMS/Durability.

For more information on the INTERP function, see INTERP for ADAMS/Solver (C++)
or INTERP for ADAMS/Solver (FORTRAN).

96
Functions: A - M

Run-time functions

Joint Force (JOINT)

Returns a force or torque induced by a specified joint on one of the two bodies connected
by the joint object.

Format

JOINT (Joint Name, On This Body, Force Component, Along/About Axes)

Arguments

Joint Name (Required) Joint for which the force is measured.

On This Body (Required) Body on which the force is measured.

The legal values are:

 0 = forces and torques on the first body, at


the I marker
 1 = forces and torques on the second body,
at the J marker

Force (Required) Force or torque component you want


Component to measure.

The legal values are:

 Fm = 1 = force magnitude
 Fx = 2 = x component of the force
 Fy = 3 = y component of the force
 Fz = 4 = z component of the force
 Tm = 5 = torque magnitude
 Tx = 6 = x component of the torque
 Ty = 7 = y component of the torque
 Tz = 8 = z component of the torque

97
Printed Documentation

Along/About (Optional) Coordinate system marker in which the


Axes results are measured.

To have your results measured in the global coordinate


system, do one of the following:

 If you're entering your function through the


Assist dialog box, leave the Along/About
Axes text box empty.
 If you're entering your function directly in
the function text box, enter a 0.

Example

The following function returns the magnitude of the force vector acting on the first body
(at the I marker) of .model_1.joint_1 in the global coordinate system.

JOINT(.model_1.joint_1, 0, 1, 0)

Learn more about force in object functions.

98
Functions: A - M

Run-time functions

Joint Primitive Force (JPRIM)

Returns a force or torque induced by a specified joint primitive on one of the two bodies
connected by the joint primitive.

Format

JPRIM (Joint Primitive Name, On This Body, Force Component, Along/About Axes)

Arguments

Joint Primitive (Required) Joint primitive for which the force is


Name measured.
On This Body (Required) Body on which the force is
measured.

The legal values are:

 0 = forces and torques on the first body,


at the I marker
 1 = forces and torques on the second
body, at the J marker

Force Component (Required) Force or torque component you want to


measure.

The legal values are:

 Fm = 1 = force magnitude
 Fx = 2 = x component of the force
 Fy = 3 = y component of the force
 Fz = 4 = z component of the force
 Tm = 5 = torque magnitude
 Tx = 6 = x component of the torque
 Ty = 7 = y component of the torque
 Tz = 8 = z component of the torque

99
Printed Documentation

Along/About (Optional) Coordinate system marker in which


Axes the results are measured.

To have your results measured in the global


coordinate system, do one of the following:

 If you're entering your function through


the Assist dialog box, leave the
Along/About Axes text box empty.
 If you're entering your function directly in
the function text box, enter a 0.

Example

The following function returns the z component of the torque vector acting on the second
body (at the J marker) of .model_1.jprim_21 measured along the z-axis of
.model_1.part_1.mar_11:

JPRIM(.model_1.jprim_21, 1, 8, .model_1.part_1.mar_11)

Learn more about force in object functions.

100
Functions: A - M

Run-time functions

LOG

Returns the natural logarithm of an expression that represents a numerical value.

If ex = a then LOG(a) = x. The LOG function is defined only for positive values of a (that
is, a > 0). It's undefined for all other values.

Format

LOG(x)

Argument

x Any valid expression that evaluates to a real number.

Example

The following function returns the natural logarithm of the expression (1+TIME), where
TIME is the current simulation time:

LOG(1+TIME)

Learn more about math functions.

101
Printed Documentation

Run-time functions

LOG10

Returns log to base 10 of an expression that represents a numerical value.

If 10x = a, then LOG10(a) = x. The LOG10 function is defined only for positive values of
a (that is, a > 0). It is undefined for all other values.

Format

LOG10(x)

Argument

x Any valid expression that evaluates to a real number.

Example

The following function returns the base 10 logarithm of the expression:

LOG10(1+VM(marker_21, marker_31))

Learn more about math functions.

102
Functions: A - M

Run-time functions

MIN

Returns the minimum of two expressions that represent numerical values:

MIN(x1,x2) = x1 if x1 < x2
MIN(x1,x2) = x2 if x2 < x1

Note: The MIN function is generally discontinuous. Use this function


expression with care when specifying force or motion input.

Format

MIN(x1,x2)

Arguments

x1 Any valid expression that evaluates to a real number.


x2 Any valid expression that evaluates to a real number.

Example

The following function is designed to always return a negative or zero value:

MIN(0, (25D-AZ(marker_2, marker_1)))

Learn more about math functions.

103
Printed Documentation

Run-time functions

MAX

Returns the maximum of two expressions that represent numerical values:

MAX(x1,x2) = x1 if x1 > x2
MAX(x1,x2) = x2 if x2 > x1
Note: MAX is generally discontinuous. Use this function expression
with care when specifying force or motion input.

Format

MAX(x1,x2)

Arguments

x1 Any valid expression that evaluates to a real number.

x2 Any valid expression that evaluates to a real number.

Example

The following function is designed to always return a non-negative value:

MAX(0, (25D-AZ(marker_2, marker_1)))

Learn more about math functions.

104
Functions: A - M

Run-time functions

MOD

Returns the remainder when one expression representing a numerical value is divided by
another expression that represents a numerical value:

MOD(a1, a2) = a1 - INT(a1/a2) * a2

Note: MAX is generally discontinuous. Use this function expression


with care when specifying force or motion input.

Format

MOD(x1,x2)

Arguments

x1 Any valid expression that evaluates to a real number.


x2 Any valid expression that evaluates to a real number.

Examples

The following examples illustrate the use of the MOD function:

Function MOD(45, 15)

Result 0

Function MOD(45, 16)

Result 13

Learn more about math functions.

105
Printed Documentation

106
Functions: A - M

Run-time functions

MODE

Returns an integer value indicating the current analysis mode.

The following are possible integer values and their corresponding analysis modes:

 1 = Kinematics
 2 = Reserved
 3 = Initial conditions
 4 = Dynamics
 5 = Statics
 6 = Quasi-statics
 7 = Linear analysis

Format

MODE

Argument

None

Example

The following example combines the MODE function with the IF function to define a
value applied only during statics, quasi-static and linear analysis modes. For these
analysis modes, we use the value of -50. For all other analyses modes, we use the value 0.

IF(MODE-4: 0, 0, -50)

Learn more about constants and variables.

107
Printed Documentation

Run-time functions

Motion Force (MOTION)

Returns a force or torque component induced by a specified motion on one of the two
bodies affected by the motion object.

Format

MOTION (Motion Name, On This Body, Force Component, Along/About Axes)

Arguments

Motion Name (Required) Motion for which the force is


measured.
On This Body (Required) Body on which the force is measured.

The legal values are:

 0 = forces and torques on the first body, at


the I marker
 1 = forces and torques on the second
body, at the J marker

Force (Required) Force or torque component you want


Component to measure.

The legal values are:

 Fm = 1 = force magnitude
 Fx = 2 = x component of the force
 Fy = 3 = y component of the force
 Fz = 4 = z component of the force
 Tm = 5 = torque magnitude
 Tx = 6 = x component of the torque
 Ty = 7 = y component of the torque
 Tz = 8 = z component of the torque

Along/About (Optional)
Axes
Coordinate system marker in which the results are
measured.

To have your results measured in the global coordinate

108
Functions: A - M

system, do one of the following:

 If you're entering your function through the


Assist dialog box, leave the Along/About
Axes text box empty.
 If you're entering your function directly in
the function text box, enter a 0.

Example

The following function returns the z component of the torque vector acting on the second
body (at the J marker) affected by .model_1.motion_1, measured about the z-axis of
.model_1.ground.marker_11:

MOTION(.model_1.motion_1, 1, 8, .model_1.ground.marker_11)

Learn more about force in object functions.

109
Run-time functions

Multipoint Force (NFORCE)

Returns a force or torque applied by a specified multipoint force on one or two bodies
directly affected by the multipoint force.

Note: NFORCE can only be used for output purposes. Therefore, it can
be used only with output request and sensor objects.

Format

NFORCE (Multipoint Force Name, At This Marker, Force Component, Along/About


Axes)

Arguments

Multipoint Force (Required) Multipoint force for which the force


Name is measured.
At This Marker (Required) Marker on which the force is measured.

The legal values are:

 0 = forces and torques on the I marker


 1 = forces and torques on the J marker

Force Component (Required) Force or torque component you want to


measure.

The legal values are:

 Fm = 1 = force magnitude
 Fx = 2 = x component of the force
 Fy = 3 = y component of the force
 Fz = 4 = z component of the force
 Tm = 5 = torque magnitude
 Tx = 6 = x component of the torque
 Ty = 7 = y component of the torque
 Tz = 8 = z component of the torque

111
Printed Documentation

Along/About Axes (Optional) Coordinate system marker in which


the results are measured.

To have your results measured in the global


coordinate system, do one of the following:

 If you're entering your function through


the Assist dialog box, leave the
Along/About Axes text box empty.
 If you're entering your function directly
in the function text box, enter a 0.

Example

The following function returns the y component of the force vector acting on the second
body (at the J marker) of .model_3.nforce_41, measured along the y-axis of
.model_3.part_5.marker_3:

NFORCE(.model_3.nfo_5, 1, 3, .model_3.part_5.marker_3)

Learn more about force in object functions.

112
Functions: N - Z

Run-time functions

One-sided Impact (IMPACT)

Returns a real number for a force magnitude corresponding to a one-sided collision, using
a compression-only nonlinear spring-damper formulation.

Format

IMPACT (Displacement Variable, Velocity Variable, Trigger for Displacement Variable,


Stiffness Coefficient, Stiffness Force Exponent, Damping Coefficient, Damping Ramp-
up Distance)

Arguments

Displacement A measure of the distance between colliding


Variable bodies; defined by a run-time displacement
function.
Velocity Variable A measure of the time derivative of the
distance between colliding bodies; defined by a
run-time velocity function.
Trigger for Independent variable value at which to turn the
Displacement one-sided impact on and off; defined by a real
Variable number, a run-time function, a design-time
function, a design variable or an expression.
Stiffness Stiffness coefficient for spring force; defined by
Coefficient or K a real number, a run-time function, a design-
time function, a design variable or an
expression.
Stiffness Force Exponent for nonlinear spring force; defined by
Exponent a real number, a run-time function, a design-
time function, a design variable or an
expression.
Damping Damping coefficient for damper force; defined
Coefficient or C by a real number, a run-time function, a
design-time function, a design variable or an
expression.
Damping Ramp- Distance over which to gradually turn on
up Distance damping once impact is triggered; defined by a
real number, a run-time function, a design-time

113
Printed Documentation

function, a design variable or an expression.

Equation

The IMPACT function turns a force on and off depending on the value of the
independent variable, as follows:

Mathematically, IMPACT is calculated as follows:

where,

 q is the displacement variable


 is the velocity variable
 qo is the trigger for displacement variable
 K is the stiffness coefficient
 C is the damping coefficient
 d is the damping ramp-up distance

Compression-only Spring Force from IMPACT Function

114
Functions: N - Z

Compression-only Damping Force from IMPACT Function

Back to top

Examples

You can use the IMPACT function to create a user-defined collision force (such as a
single-component force), for example, when a sphere hits a flat surface:

Sphere Hitting Flat Surface

115
Printed Documentation

Note: Assume that the flat surface being contacted by the sphere is
an infinite plane.

IMPACT(
DZ(marker_1, marker_2, marker_2),
VZ(marker_1, marker_2, marker_2, marker_2),
15, 100, 1.2, 2.5, 0.01)

where,

 DZ(marker_1, marker_2, marker_2) defines the instantaneous


displacement of marker_1 with respect to marker_2 along the z-
axis of marker_2.
 VZ(marker_1, marker_2, marker_2, marker_2) defines the
velocity of marker_1 with respect to part_2 minus the velocity of
marker_2 with respect to part_2 along the z-axis of marker_2.
 The displacement trigger is the radius of the sphere, in this case
15 length units.
 The stiffness coefficient is 100.
 The stiffness force exponent is 1.2.
 The damping coefficient is 2.5.
 The penetration at which full damping is applied is 0.01 length
unit.

Learn more about contact functions.

116
Functions: N - Z

Run-time functions

PI

Returns the ratio of the circumference of a circle to its diameter ( ).

Format

PI

Argument

None

Example

The following example illustrates the use of the PI function:

2*PI*50

Learn more about constants and variables.

117
Printed Documentation

Run-time functions

PLANT INPUT VALUE (PINVAL)

Returns the run-time value of a plant input.

Format

PINVAL (Plant Input Name, Element Number)

Arguments

Plant Input Name of the plant input to reference.


Name
Element The element number in the list of inputs for the
Number given plant input name.

Example

model_1.PIN corresponds to a definition of a plant input list. This plant input list contains
three input variables, defined as follows:

(model_1.VAR_1, model_1.VAR_2, model_1.VAR_3)

where,

 model_1.VAR_1 = "sin(TIME)"
 model_1.VAR_2 = "2"
 model_1.VAR_3 = "5"

Then PINVAL(model_1.PIN, 3) is equal to 5 at all times in the simulation.

Learn more about data element access.

118
Functions: N - Z

Run-time functions

Plant Output Value (POUVAL)

Returns the run-time value of a plant output.

Format

POUVAL(Plant Output Name, Element Number)

Arguments

Plant Output Name of the plant output to reference.


Name
Element Number The element number in the list of outputs for
the given plant output name.

Examples

model_1.POU corresponds to a definition of a plant output list. This plant output list
contains three input variables, defined as follows:

(model_1.VAR_1, model_1.VAR_2, model_1.VAR_3)

where,

 model_1.VAR_1 = "sin(2*PI*TIME)"
 model_1.VAR_2 = "2"
 model_1.VAR_3 = "5"

At any time in the simulation,

Function POUVAL(model_1.POU,1)

Result sin(2*PI*TIME)

At .75 seconds into the simulation,

Function POUVAL(model_1.PIN,1)

Result -1

119
Printed Documentation

Learn more about data element access.

120
Functions: N - Z

Run-time functions

Point-to-Curve Force (PTCV)

Returns a force or torque induced by a specified point-to-curve object on one of the two
bodies connected by the point-to-curve object.

Note: PTCV can only be used for output purposes. Therefore, it can be
used only with output request and sensor objects.

Format

PTCV (Point-to-Curve Name, On This Body, Component, Along/About Axes)

Arguments

Point-to-Curve Name (Required) Point-to-curve object for which


the force is measured.
On This Body (Required) Body on which the force is
measured.

The legal values are:

 0 = forces and torques on the first


body, at the I marker
 1 = forces and torques on the second
body, at the J marker

Force Component (Required) Force or torque component you


want to measure.

The legal values are:

 Fm = 1 = force magnitude
 Fx = 2 = x component of the force
 Fy = 3 = y component of the force
 Fz = 4 = z component of the force
 Tm = 5 = torque magnitude
 Tx = 6 = x component of the torque
 Ty = 7 = y component of the torque

121
Printed Documentation

 Tz = 8 = z component of the torque

Along/About Axes (Optional) Coordinate system marker in which


the results are measured.

To have your results measured in the global


coordinate system, do one of the following:

 If you're entering your function


through the Assist dialog box, leave
the Along/About Axes text box
empty.
 If you're entering your function
directly in the function text box, enter
a 0.

Example

The following function returns the x component of the force vector acting on the first
body (at the I marker) of .model_1.ptcv_31, measured along the x-axis of the global
coordinate system:

PTCV(.model_1.ptcv_31, 0, 2, 0)
Learn more about force in object functions.

122
Functions: N - Z

Run-time functions

Polynomial Fitted (POLYFIT)

Returns the coefficients of a polynomial fitted to the supplied function data.

Format

POLYFIT (x, y, order)

Arguments

x Array of x values.
y Array of y values.
order Maximum order of the polynomical. The coefficients are
returned in increasing order (from zeroth order to this value).

Examples

The following commands produce the array result.

var cre var=xx rea=(series2(0, 20, 20))

var cre var=yy rea=(1.0 + 1.2*xx + 2.5*xx**2 + 2.0*xx**3)

var cre var=pp rea=(polyfit(xx, yy, 5))

Array result:

[1.0, 1.2, 2.5, 2.0, 0.0, 0.0]

The coefficients are ordered from the zeroth order to the nth order, from left to right.

Learn more about math functions.

123
Printed Documentation

Run-time functions

Polynomial (POLY)

Evaluates a standard polynomial at a user-specified value x.

Format

POLY (x, Shift, Coefficients)

Arguments

x Real variable that specifies the independent variable.


Shift Real variable that specifies a shift in the polynomial.
Coefficients Real variables that define as many as thirty-one
coefficients for the polynomial series.

Examples

The following function defines a quadratic polynomial function with respect to the
system variable TIME:

Function POLY(TIME, 0, 0, 0, 1)

Expanded function POLY = TIME2

The following function defines a linear function with respect to the system variable
TIME:

Function POLY(TIME, 5, 0, 10)

Expanded function POLY=10*(TIME-5)

The following function defines a cubic polynomial function with respect to the system
variable TIME:

Function POLY(TIME, 10, 0, 25, 0, 0.75)

Expanded function POLY=-25*[TIME-10]+ 0.75*[TIME-10]3

Learn more about math functions.

124
Functions: N - Z

125
Printed Documentation

Run-time functions

RTOD

Returns the radians-to-degree units conversion factor (180/ ), same as (180/PI).

Format

RTOD

Argument

None

Example

The following example returns the roll angle, in degrees, to marker_2 from marker_4:

RTOD*ROLL(marker_2, marker_4)

Learn more about constants and variables.

126
Functions: N - Z

Run-time functions

SIGN

Transfers the sign of one expression representing a numerical value to the magnitude of
another expression representing a numerical value:

SIGN(a1, a2) = ABS(a1) if a2 > 0


SIGN(a1, a2) = -ABS(a1) if a2 < 0

Note: SIGN is discontinuous. Use this function with care to avoid


creating expressions that are discontinuous.

Format

SIGN (x1,x2)

Arguments

x1 Any valid expression that evaluates to a real number.


x2 Any valid expression that evaluates to a real number.

Example

In the following function,

When VZ(marker_2, marker_3) > 0, the value is ABS(TIME).


When VZ(marker_2, marker_3)< 0, the value is -ABS(TIME).
SIGN(TIME,VZ(marker_2, marker_3))
Learn more about math functions.

127
Printed Documentation

Run-time functions

Simple Harmonic (SHF)

Evaluates a simple harmonic function.

Format

SHF (x, Shift, Amplitude, Frequency, Phase Shift, Average Value of Displacement)

Arguments

x Real variable that specifies the independent


variable.
Shift or x0 Real variable that specifies the offset in the
independent variable x.
Amplitude or a Real variable that specifies the amplitude of the
harmonic function.
Frequency or Real variable that specifies the frequency of the
harmonic function. It is assumed that is in
radians per unit of the independent variable
unless you use a D after the value for degrees.
Phase Shift or phi Real variable that specifies a phase shift in the
harmonic function. MSC.ADAMS assumes that phi
is in radians unless you use a D after the value.
Average Value of Real variable that specifies the average value of
Displacement or b displacement of the harmonic function.

Equation

Mathematically, SHF is defined as follows:

SHF = a*SIN( *(x-x0)-phi)+b

where:

 x = Independent variable
 x0 = Shift
 = Frequency
128
Functions: N - Z

 phi = Phase Shift


 a = Amplitude
 b = Average Value of Displacement

Example

The following example illustrates the use of the SHF function:

SHF(TIME, 25D, PI, 360D, 0, 5)

The following function defines the harmonic function:

SHF = 5+PI*SIN(360D*(TIME-25D))

In the function:

 x = TIME
 x0 = 25 degrees
 = 1 cycle (360D)
 phi = 0
 a = PI
 b=5

Learn more about math functions.

129
Printed Documentation

Run-time functions

SIN

Returns the sine of an expression that represents a numerical value.

Format

SIN(x)

Argument

x Any valid expression that evaluates to a real number.

Example

The following example returns the sine of 10*TIME, where TIME is the current
simulation time:

SIN(10*TIME)

Learn more about math functions.

130
Functions: N - Z

Run-time functions

Single-component Force (SFORCE)

Returns a force or torque applied by a specified single-component force on one or two


bodies directly affected by the single-component force.

Format

SFORCE (Single-component Force, On This Body, Force Component, Along/About


Axes)

Arguments

Single- (Required) Single-component force for which the


component force is measured.
Force
On This (Required) Body on which the force is measured.
Body
The legal values are:

 0 = forces and torques on the first body, at the


I marker
 1 = forces and torques on the second body, at
the J marker

Force (Required) Force or torque component you want to


Component measure.

The legal values are:

 Fm = 1 = force magnitude
 Fx = 2 = x component of the force
 Fy = 3 = y component of the force
 Fz = 4 = z component of the force
 Tm = 5 = torque magnitude
 Tx = 6 = x component of the torque
 Ty = 7 = y component of the torque
 Tz = 8 = z component of the torque

Along/About (Optional)Coordinate system marker in which the results


Axes are measured.

To have your results measured in the global coordinate

131
Printed Documentation

system, do one of the following:

 If you're entering your function through the


Assist dialog box, leave the Along/About Axes
text box empty.
 If you're entering your function directly in the
function text box, enter a 0.

Example

The following function returns the y component of the torque vector acting on the first
body (at the I marker) of .model_1.force_1, measured along the y-axis of the global
coordinate system:

SFORCE(.model_1.force_1, 0, 7, 0)

Learn more about force in object functions.

132
Functions: N - Z

Run-time functions

SINH

Returns the hyperbolic sine of an expression that represents a numerical value:

SINH(x) = (ex-e-x)/2.0

Format

SINH(x)

Argument

x Any valid expression that evaluates to a real number.

Example

The following example returns the hyperbolic sine of the x component of the
displacement of marker_21 with respect to marker_32:

SINH(DX(marker_21, marker_32))

Learn more about math functions.

133
Printed Documentation

Run-time functions

Six-component Force/Torque (GFORCE)

Returns a force or torque applied by a specified six-component force/torque on one or


two bodies directly affected by the six-component force/torque.

Format

GFORCE (Six-component Force/Torque, On This Body, Force Component, Along/About


Axes)

Arguments

Six-component (Required) Six-component force/torque for


Force/Torque which the force is measured.
On This Body (Required) Body on which the force is
measured.

The legal values are:

 0 = forces and torques on the first body,


at the I marker
 1 = forces and torques on the second
body, at the J marker

Force Component (Required) Force or torque component you


want to measure.

The legal values are:

 Fm = 1 = force magnitude
 Fx = 2 = x component of the force
 Fy = 3 = y component of the force
 Fz = 4 = z component of the force
 Tm = 5 = torque magnitude
 Tx = 6 = x component of the torque
 Ty = 7 = y component of the torque
 Tz = 8 = z component of the torque

134
Functions: N - Z

Along/About Axes (Optional) Coordinate system marker in which


the results are measured.

To have your results measured in the global


coordinate system, do one of the following:

 If you're entering your function through


the Assist dialog box, leave the
Along/About Axes text box empty.
 If you're entering your function directly
in the function text box, enter a 0.

Example

The following function returns the z component of the force vector acting on the first
body (at the I marker) of .model_3.gforce_31, measured along the z-axis of marker_23:

GFORCE(.model_3.gforce_31, 0, 4, marker_23)

Learn more about force in object functions.

135
Printed Documentation

Run-time functions

Spring-Damper Force (SPDP)

Returns a force or torque applied by a specified spring-damper force on one or two


bodies affected by the spring-damper force.

Format

SPDP (Spring-Damper Force Name, On This Body, Force Component, Along/About


Axes)

Arguments

Spring-Damper (Required) Spring-damper force for which the


Force Name force is measured.
On This Body (Required) Body on which the force is measured.

The legal values are:

 0 = forces and torques on the first body,


at the I marker
 1 = forces and torques on the second
body, at the J marker

136
Functions: N - Z

Force Component (Required) Force or torque component you


want to measure.

The legal values are:

 Fm = 1 = force magnitude
 Fx = 2 = x component of the force
 Fy = 3 = y component of the force
 Fz = 4 = z component of the force
 Tm = 5 = torque magnitude
 Tx = 6 = x component of the torque
 Ty = 7 = y component of the torque
 Tz = 8 = z component of the torque

Along/About (Optional) Coordinate system marker in which the


Axes results are measured.

To have your results measured in the global


coordinate system, do one of the following:

 If you're entering your function through


the Assist dialog box, leave the
Along/About Axes text box empty.
 If you're entering your function directly in
the function text box, enter a 0.

Example

The following function returns the z component of the force vector acting on the first
body (at the I marker) of .model_1.spring_31, measured along the z-axis of the global
coordinate system:

SPDP(.model_1.spring_15, 0, 4, 0)

Learn more about force in object functions.

137
Printed Documentation

138
Functions: N - Z

Run-time functions

SQRT

Returns the square root of an expression that represents a numerical value. The square
root function is defined only for non-negative values of x.

Format

SQRT(x)

Argument

x Any valid expression that evaluates to a real number.

Example

The following function returns the square root of the expression TIME:

Function SQRT(TIME*TIME)

Result TIME

Learn more about math functions.

139
Printed Documentation

Run-time functions

STEP

Approximates the Heaviside step function with a cubic polynomial.

Note: STEP has continuous first derivatives, but its second derivatives are discontinuous
at x=x0 and x=x1. Haversine Step (HAVSIN), STEP5, and TANH offer other
approximations for the Heaviside step function. These have a higher degree of continuity
and differentiability, but can have larger derivatives.

See Haversine Step (HAVSIN) for a plot comparing STEP, STEP5, TANH, and
Haversine Step (HAVSIN).

Format

STEP (x, Begin At, Initial Function Value, End At, Final Function Value)

Arguments

x Independent variable.
Begin At or x0 Value of independent variable at which the
STEP function begins; defined by a real
number, an expression or a design variable.
Initial Function Initial value of the step; defined by a real
Value or h0 number, an expression, a design variable or a
run-time function.
End At or x1 Value of independent variable at which the
STEP function ends; defined by a real number,
an expression or a design variable.
Final Function Final value of the step; defined by a real
Value or h1 number, an expression, a design variable or a
run-time function.

Extended Definition

The STEP function approximates the Heaviside step function with a cubic polynomial.
The following figure illustrates the STEP function.

140
Functions: N - Z

The equation defining the STEP function is:

Example

Using a cubic polynomial, the following function defines a smooth step function from 3
to 4, with a displacement from 0 to 1:

STEP((2, 3, 3.5, 4, 5), 3, 0, 4, 1)

This example produces the following results:

0.0, 0.0, 0.5, 1.0, 1.0

Learn more about math functions.

141
Printed Documentation

Run-time functions

STEP5

Provides approximations to the Heaviside step function with a quintic polynomial.

Note: STEP5 has continuous first and second derivatives, but its third derivative is
discontinuous at x=x0 and x=x1.

See Haversine Step (HAVSIN) for a plot comparing STEP, STEP5, TANH, and
Haversine Step (HAVSIN).

Format

STEP5 (x, Begin At, Initial Function Value, End At, Final Function Value)

Arguments

x Independent variable.
Begin At or x0 Real variable that specifies the x value at which
the STEP5 function begins.
Initial Function Initial value of the step.
Value or h0
End At or x1 Real variable that specifies the x value at which
the STEP5 function ends.
Final Function Final value of the step.
Value or h1

Example

Using a quintic polynomial, the following function defines a smooth step function from
time 1 to time 2 with a displacement from 0 to 1:

STEP(TIME, 1, 0, 2, 1)

Learn more about math functions.

142
Functions: N - Z

Run-time functions

Sum of Forces Along X (FX)

Returns an x component of the net translational force acting at one coordinate system
marker due to all applied forces and constraints acting between that coordinate system
marker and another.

Format

FX (Applied To Marker, Applied From Marker, Along Marker)

Arguments

Applied To (Required) Measure of the sume of all forces


Marker applied to this coordinate system marker.
Applied From (Optional) Measure the sum of all forces applied
Marker from this coordinate system marker. If you
don't specify this argument, it returns the x
component of all the action-only single-
component forces acting at the Applied To
Marker.
Along Marker (Optional) Measure the sum of all forces in the
x direction of this coordinate system marker. If
you don't specify this argument, it defaults to
the global origin.

Equation

Mathematically, FX is calculated as follows:

where,

 is the sum of all applied and constraint forces involving both the Applied To
Marker, T, and the Applied From Marker, F.
 is the x-axis of the Along Marker, A.

Example

143
Printed Documentation

The following function returns the x component of the sum of all forces acting at
marker_T. All forces acting between marker_T and marker_F are included in this
calculation.

Function FX(marker_T, marker_F, marker_A)

Result 4

Learn more about resultant force functions.

144
Functions: N - Z

Run-time functions

Sum of Forces Along Y (FY)

Returns a y component of the net translational force acting at one coordinate system
marker due to all applied forces and constraints acting between that coordinate system
marker and another.

Format

FY (Applied To Marker, Applied From Marker, Along Marker)

Arguments

Applied To (Required) Measure the sum of all forces


Marker applied to this coordinate system marker.
Applied From (Optional) Measure the sum of all forces applied
Marker from this coordinate system marker. If you
don't specify this argument, it returns the y
component of all the action-only single-
component forces acting at the Applied To
Marker.
Along Marker (Optional) Measure the sum of all forces in the
y direction of this coordinate system marker. If
you don't specify this argument, it defaults to
the global origin.

Equation

Mathematically, FY is calculated as follows:

where,

 is the sum of all applied and constraint forces involving both the Applied To
Marker, T, and the Applied From Marker, F.
 is the y-axis of the Along Marker, A.

Example

145
Printed Documentation

The following function returns the y component of the sum of all forces acting at
marker_T. All forces acting between marker_T and marker_F are included in this
calculation.

Function FY(marker_T, marker_F, marker_A)

Result 3

Learn more about resultant force functions.

146
Functions: N - Z

Run-time functions

Sum of Forces Along Z (FZ)

Returns a z component of the net translational force acting at one coordinate system
marker due to all applied forces and constraints acting between that coordinate system
marker and another.

Format

FZ (Applied To Marker, Applied From Marker, Along Marker)

Arguments

Applied To (Required) Measure the sum of all forces


Marker applied to this coordinate system marker.
Applied From (Optional) Measure the sum of all forces applied
Marker from this coordinate system marker. If you
don't specify this argument, it returns the z
component of all the action-only single-
component forces acting at the Applied To
Marker.
Along Marker (Optional) Measure the sum of all forces in the
z direction of this coordinate system marker. If
you don't specify this argument, it defaults to
the global origin.

Equation

Mathematically, FZ is calculated as follows:

where,

 is the sum of all applied and constraint forces involving both the Applied To
Marker, T, and the Applied From Marker, F.
 is the z-axis of the Along Marker, A.

Example

147
Printed Documentation

The following function returns the z component of the sum of all forces acting at
marker_T. All forces acting between marker_T and marker_F are included in this
calculation.

Function FZ(marker_T, marker_F, marker_A)

Result 0

Learn more about resultant force functions.

148
Functions: N - Z

Run-time functions

Sum of Forces Magnitude (FM)

Returns the magnitude of the net translational force acting at one coordinate system
marker due to all applied forces and constraints acting between that coordinate system
marker and another.

Format

FM (Applied To Marker, Applied From Marker)

Arguments

Applied To (Required) Measure the sum of all forces applied to


Marker this coordinate system marker.
Applied From (Optional) Measure the sum of all forces applied
Marker from this coordinate system marker. If you don’t
specify this argument, it returns the magnitude of
the net translational force at the Applied To Marker
due to action-only single-component forces acting at
the Applied To Marker.

Equation

Mathematically, FM is calculated as follows:

where,

 is the sum of all applied and constraint forces involving both the Applied
To Marker, T, and the Applied From Marker, F.

Example

The following function returns the magnitude of the sum of all forces acting at marker_T.
All forces acting between marker_T and marker_F are included in this calculation:

Function FM(marker_T,
marker_F)

149
Printed Documentation

Result 5

Learn more about resultant force functions.

150
Functions: N - Z

Run-time functions

Sum of Torques About X (TX)

Returns an x component of the net torque acting at one coordinate system marker due to
all applied torques and constraints acting between that coordinate system marker and
another.

Format

TX (Applied To Marker, Applied From Marker, About Marker)

Arguments

Applied To Marker (Required) Measure the sum of all torques


applied to this coordinate system marker.
Applied From (Optional) Measure the sum of all torques
Marker applied from this coordinate system marker. If
you don't specify this argument, it returns the
x component of all the action-only single-
component torques acting at the Applied To
Marker.
About Marker (Optional) Measure the sum of all torques
about the x-axis of this coordinate system
marker. If you don't specify this argument, it
defaults to the global coordinate system.

Equation

Mathematically, TX is calculated as follows:

where,

 is the sum of all applied and constraint torques involving both the Applied
To Marker, T, and the Applied From Marker, F.
 is the x-axis of the About Marker, A.

Example

151
Printed Documentation

The following function returns the x component of the sum of all torques acting at
marker_T. All torques acting between marker_T and marker_F are included in this
calculation.

Function TX(marker_T, marker_F, marker_A)

Result 5.3

Learn more about resultant force functions.

152
Functions: N - Z

Run-time functions

Sum of Torques About Y (TY)

Returns a y component of the net torque acting at one coordinate system marker due to all
applied torques and constraints acting between that coordinate system marker and
another.

Format

TY (Applied To Marker, Applied From Marker, About Marker)

Arguments

Applied To Marker (Required) Measure the sum of all torques


applied to this coordinate system marker.
Applied From (Optional) Measure the sum of all torques
Marker applied from this coordinate system marker. If
you don't specify this argument, it returns the
x component of all the action-only single-
component torques acting at the Applied To
Marker.
About Marker (Optional) Measure the sum of all torques
about the y-axis of this coordinate system
marker. If you don't specify this argument, it
defaults to the global coordinate system.

Equation

Mathematically, TY is calculated as follows:

where,

 is the sum of all applied and constraint torques involving both the Applied
To Marker, T, and the Applied From Marker, F.
 is the y-axis of the About Marker, A.

Examples

153
Printed Documentation

The following function returns the y component of the sum of all torques acting at
marker_T. All torques acting between marker_T and marker_F are included in this
calculation.

Function TY(marker_T, marker_F, marker_A)

Result 7.2

Learn more about resultant force functions.

154
Functions: N - Z

Run-time functions

Sum of Torques About Z (TZ)

Returns a z component of the net torque acting at one coordinate system marker due to all
applied torques and constraints acting between that coordinate system marker and
another.

Format

TZ (Applied To Marker, Applied From Marker, About Marker)

Arguments

Applied To (Required) Measure the sum of all torques applied to


Marker this coordinate system marker.
Applied (Optional) Measure the sum of all torques applied from
From this coordinate system marker. If you don't specify this
Marker argument, it returns the x component of all the action-
only single-component torques acting at the Applied To
Marker.
About (Optional) Measure the sum of all torques about the z-
Marker axis of this coordinate system marker. If you don't
specify this argument, it defaults to the global
coordinate system.

Equation

Mathematically, TZ is calculated as follows:

where,

 is the sum of all applied and constraint torques involving


both the Applied To Marker, T, and the Applied From Marker, F.
 is the z-axis of the About Marker, A.

Example

155
Printed Documentation

The following function returns the z component of the sum of all torques acting at
marker_T. All torques acting between marker_T and marker_F are included in this
calculation.

Function TZ(marker_T, marker_F, marker_A)

Result 9.7

Learn more about resultant force functions.

156
Functions: N - Z

Run-time functions

Sum of Torques Magnitude (TM)

Returns the magnitude of the net torque acting at one coordinate system marker due to all
applied torques and constraints acting between that coordinate system marker and
another.

Format

TM (Applied To Marker, Applied From Marker)

Arguments

Applied To (Required) Measure the sum of all torques


Marker applied to this coordinate system maker.
Applied From (Optional) Measure the sum of all torques
Marker applied from this coordinate system maker. If
you don't specify this argument, it returns the
magnitude of the sum of all torques at the
Applied To Marker due to action-only torque
acting at the Applied To Marker.

Equation

Mathematically, TM is calculated as follows:

where,

is the sum of all applied and constraint torques involving both the Applied To
Marker, T, and the Applied From Marker, F.

Example

The following function returns the magnitude of the sum of all torques acting at
marker_T. All torques acting between marker_T and marker_F are included in this
calculation.

Function TM(marker_T, marker_F)

Result 13.19

157
Printed Documentation

Learn more about resultant force functions.

158
Functions: N - Z

Run-time functions

SWEEP

Returns a constant amplitude sinusoidal function with linearly increasing frequency.

Format

SWEEP (Independent Variable, Amplitude, Start Value, Start Frequency, End Value,
End Frequency, Delta X)

Arguments

Independent Independent variable.


Variable or x
Amplitude or a Real variable that specifies the amplitude.
Start Value or x0 Real variable that specifies the independent
variable value at which the SWEEP function
begins.
Start Frequency or Real variable that specifies the initial frequency.
f0
End Value or x1 Real variable that specifies the independent
variable value at which the SWEEP function
ends.
End Frequency or Real variable that defines the final frequency.
f1
Delta X or dx Real variable that specifies the interval in which
the SWEEP function becomes fully active.

Equation

Mathematically, SWEEP is calculated as follows:

SWEEP = STEP5(x,0,0,dx,1)* a * sin(2 *(freq(x)*x +


PHASE(x)))

where:

159
Printed Documentation

Example

The following function defines a sinusoidal function with a frequency increasing from 2
to 6Hz within the time interval 0 to 5:

SWEEP(TIME, 1.0, 0.0, 2.0, 5.0, 6.0, 0.01)

Learn more about math functions.

160
Functions: N - Z

Run-time functions

TAN

Returns the tangent of an expression that represents a numerical value.

Format

TAN(x)

Argument

x Any valid expression that evaluates to a real number.

Example

The following function returns the tangent of 10*TIME, where TIME is the current
simulation time:

TAN(10*TIME)

Learn more about math functions.

161
Printed Documentation

Run-time functions

TANH

Returns the hyperbolic tangent of an expression that represents a numerical value:

TANH(x) = (ex-e-x)/(xa+exa)

Note: See Haversine Step (HAVSIN) for a plot comparing STEP,


STEP5, TANH, and Haversine Step (HAVSIN).

Format

TANH(x)

Argument

x Any valid expression that evaluates to a real number.

Example

Using a hyperbolic tangent, the following function defines a smooth step function that
transitions from a value of 0 to 1:

TANH(5*(TIME-1.5))

Learn more about math functions.

162
Functions: N - Z

Run-time functions

Three-component Force (VFORCE)

Returns a force or torque applied by a specified three-component force on one or two


bodies directly affected by the three-component force.

Format

VFORCE (Three-component Force, On This Body, Force Component, Along Axes)

Arguments

Three-component Force (Required) Three-component force for


which the force is measured.
On This Body (Required) Body on which the force is
measured.

The legal values are:

 0 = forces and torques on the


first body, at the I marker
 1 = forces and torques on the
second body, at the J marker

Force Component (Required) Force or torque component


you want to measure.

The legal values are:

 Fm = 1 = force magnitude
 Fx = 2 = x component of the
force
 Fy = 3 = y component of the
force
 Fz = 4 = z component of the
force
 Tm = 5 = torque magnitude
 Tx = 6 = x component of the
torque
 Ty = 7 = y component of the
torque
 Tz = 8 = z component of the

163
Printed Documentation

torque

Along/About Axes (Optional) Coordinate system marker


in which the results are measured.

To have your results measured in the


global coordinate system, do one of the
following:

 If you're entering your function


through the Assist dialog box,
leave the Along/About Axes text
box empty.
 If you're entering your function
directly in the function text box,
enter a 0.

Examples

The following function returns the x component of the force vector acting on the second
body (at the J marker) due to the three-component force named .model_1.vforce_31,
measured along the x-axis of the global coordinate system:

VFORCE(.model_1.vforce_31, 1, 2, 0)

The following function returns the z component of the force vector acting on the first
body (at the I marker) due to the three-component force named .contact_force, measured
along the z-axis of marker_6:

VFORCE(contact_force, 0, 4, marker_6)

Learn more about force in object functions.

164
Functions: N - Z

Run-time functions

Three-component Torque (VTORQ)

Returns a force or torque applied by a specified three-component torque on one or two


bodies directly affected by the three-component torque.

Format

VTORQ (Three-component Torque, On This Body, Component, About Axes)

Arguments

Three-component (Required) Three-component torque for


Torque which the force is measured.
On This Body (Required) Body on which the force is
measured.

The legal values are:

 0 = forces and torques on the first


body, at the I marker
 1 = forces and torques on the
second body, at the J marker

Force Component (Required) Force or torque component


you want to measure.

The legal values are:

 Fm = 1 = force magnitude
 Fx = 2 = x component of the force
 Fy = 3 = y component of the force
 Fz = 4 = z component of the force
 Tm = 5 = torque magnitude
 Tx = 6 = x component of the
torque
 Ty = 7 = y component of the
torque
 Tz = 8 = z component of the
torque

165
Printed Documentation

About Axes (Optional) Coordinate system marker in


which the results are measured.

To have your results measured in the global


coordinate system, do one of the following:

 If you're entering your function


through the Assist dialog box,
leave the Along/About Axes text
box empty.
 If you're entering your function
directly in the function text box,
enter a 0.

Example

The following function returns the x component of the torque vector acting on the second
body (at the J marker) of .model_1.vtorque_31, measured along the x-axis of marker_2:

VTORQ(.model_1.vtorque_1, 1, 6, marker_2)

Learn more about force in object functions.

166
Functions: N - Z

Run-time functions

TIME

Returns the current simulation time.

Format

TIME

Argument

None

Example

The following example and illustration represent a linearly-increasing function of


simulation time with a slope of 2:

2*TIME

Learn more about constants and variables.

167
Printed Documentation

Run-time functions

Two-sided Impact (BISTOP)

Returns a real number for a force magnitude corresponding to a two-sided collision, using
a compression-only nonlinear spring-damper formulation.

Format

BISTOP (Displacement Variable, Velocity Variable, Low Trigger for Displacement


Variable, High Trigger for Displacement Variable, Stiffness Coefficient, Stiffness Force
Exponent, Damping Coefficient, Damping Ramp-up Distance)

Arguments

Displacement A measure of the distance between colliding


Variable bodies; defined by a run-time displacement
function.
Velocity Variable A measure of the time derivative of the distance
between colliding bodies; defined by a run-time
velocity function.
Low Trigger for Lower value for independent variable at which to
Displacement trigger the first side of two-sided impact.
Value
High Trigger for Higher value for independent variable at which to
Displacement trigger the second side of two-sided impact.
Value
Stiffness Stiffness coefficient for spring force; defined by a
Coefficient or K real number, a run-time function, a design-time
function, a design variable or an expression.
Stiffness Force Exponent for nonlinear spring force; defined by a
Exponent real number, a run-time function, a design-time
function, a design variable or an expression.
Damping Damping coefficient for damper force; defined by
Coefficient or C a real number, a run-time function, a design-
time function, a design variable or an expression.
Damping Ramp- Distance over which to gradually turn on
up Distance damping once impact is triggered; defined by a
real number, a run-time function, a design-time
function, a design variable or an expression.

168
Functions: N - Z

Back to top

Equation

The BISTOP function turns a force on and off depending on the value of the independent
variable q, as follows:

Mathematically, BISTOP is calculated as follows:

Example

You can use the BISTOP function for the system shown in the figure below:

BISTOP(
DX(marker_1, marker_2, marker_2),
VX(marker_1, marker_2, marker_2, marker_2),
5.2, 22.4, 100, 1.2, 2.5, 0.005)

where 22.4 was derived from 5.2 + 28.7 - 11.5.

BISTOP Example

169
Printed Documentation

Learn more about contact functions.

170
Functions: N - Z

Run-time functions

USER

Passes one or more values that are used as parameters in a user-written subroutine.

For information on subroutines, see the online help for ADAMS/Solver Subroutines.

Format

USER(Parameters)

Argument

Parameters Real values that define the parameters for use by the
user-written subroutine. Up to thirty parameters may
be defined.

Example

To model a simple spring damper in a SFORCE subroutine, you need information about
the i and j marker, stiffness and damping, as well as the free length. Assume the
following:

 i marker id = 1
 j marker id = 2
 stiffness (k) = 1e5N/mm
 damping coefficient (c) = 10ns/mm
 free length (FL) = 1e3mm

Given the above information, the USER function is:

USER (1, 2, 1e5, 10, 1e3)

Learn more about user-written subroutine invocation.

171
Printed Documentation

Run-time functions

Velocity Along Line-of-Sight (VR)

Returns the radial (relative) velocity to one coordinate system marker from another. The
vector time derivative is taken in a reference coordinate system marker.

When the two markers move away from each other, VR is positive. When the two
markers approach each other, VR is negative.

Format

VR (To Marker, From Marker, Reference Frame)

Arguments

To Marker (Required) The coordinate system marker


whose velocity is being measured.
From Marker (Optional) The coordinate system marker
whose velocity is subtracted off. If you don't
specify this argument, it defaults to the global
origin.
Reference Frame (Optional) The coordinate system marker in
which the time-derivatives are calculated. If
you don't specify this argument, it defaults to
the ground reference frame.

Equation

Mathematically, VR is calculated as follows:

where,

 is the position vector from the global origin to the To Marker, T.

 is the time-derivative of with respect to the Reference Frame, R.


 is the position vector from the global origin to the From Marker, F.

 is the time-derivative of with respect to the Reference Frame, R.


172
Functions: N - Z

 DM(T,F) is the distance between the To Marker, T, and the From Marker, F.

Example

The following function returns the radial (relative) velocity of the velocity vector
between marker_T and marker_F. The vector time-derivative is taken in the reference
frame of marker_R.

VR(marker_T, marker_F, marker_R)

Learn more about velocity functions.

173
Printed Documentation

Run-time functions

Simple Harmonic (SHF)

Evaluates a simple harmonic function.

Format

SHF (x, Shift, Amplitude, Frequency, Phase Shift, Average Value of Displacement)

Arguments

x Real variable that specifies the independent


variable.
Shift or x0 Real variable that specifies the offset in the
independent variable x.
Amplitude or a Real variable that specifies the amplitude of the
harmonic function.
Frequency or Real variable that specifies the frequency of the
harmonic function. It is assumed that is in
radians per unit of the independent variable
unless you use a D after the value for degrees.
Phase Shift or phi Real variable that specifies a phase shift in the
harmonic function. MSC.ADAMS assumes that phi
is in radians unless you use a D after the value.
Average Value of Real variable that specifies the average value of
Displacement or b displacement of the harmonic function.

Equation

Mathematically, SHF is defined as follows:

SHF = a*SIN( *(x-x0)-phi)+b

where:

 x = Independent variable
 x0 = Shift
 = Frequency
 phi = Phase Shift
 a = Amplitude
174
Functions: N - Z

 b = Average Value of Displacement

Example

The following example illustrates the use of the SHF function:

SHF(TIME, 25D, PI, 360D, 0, 5)

The following function defines the harmonic function:

SHF = 5+PI*SIN(360D*(TIME-25D))

In the function:

 x = TIME
 x0 = 25 degrees
 = 1 cycle (360D)
 phi = 0
 a = PI
 b=5

Learn more about math functions.

175
Printed Documentation

Run-time functions

Velocity Along X (VX)

Returns an x component of the difference between the velocity vectors of two coordinate
system markers.

Format

VX (To Marker, From Marker, Along Marker, Reference Frame)

Arguments

To Marker (Required) The coordinate system marker whose


velocity is being measured.
From Marker (Optional) The coordinate system marker whose
velocity is subtracted off. If you don't specify this
argument, it defaults to the global origin.
Along Marker (Optional) The coordinate system marker along
whose x-axis the velocity is measured. If you
don't specify this argument, it defaults to the
global x-axis.
Reference (Optional) The coordinate system marker in
Frame which the time derivatives are calculated. If you
don't specify this argument, it defaults to the
ground reference frame.

Equation

Mathematically, VX is calculated as follows:

where,

 is the position vector from the global origin to the To Marker, T.

 is the time-derivative of with respect to the Reference Frame, R.


 is the position vector from the global origin to the From Marker, F.

 is the time-derivative of with respect to the Reference Frame, R.

176
Functions: N - Z

 is the unit vector along the x-axis of the Along Marker, A.

Example

The following function returns the x component of the velocity vector between marker_T
and marker_F. The vector is expressed in the coordinate system of marker_A. All time-
derivatives are calculated in the reference frame of marker_R.

VX(marker_T, marker_F, marker_A, marker_R)

Learn more about velocity functions.

177
Printed Documentation

Run-time functions

Velocity Along Y (VY)

Returns a y component of the difference between the velocity vectors of two coordinate
system markers.

Format

VY (To Marker, From Marker, Along Marker, Reference Frame)

Arguments

To Marker (Required) The coordinate system marker whose


velocity is being measured.
From Marker (Optional) The coordinate system marker whose
velocity is subtracted off. If you don't specify this
argument, it defaults to the global origin.
Along Marker (Optional) The coordinate system marker along
whose y-axis the velocity is measured. If you
don't specify this argument, it defaults to the
global y-axis.
Reference (Optional) The coordinate system marker in
Frame which the time derivatives are calculated. If you
don't specify this argument, it defaults to the
ground reference frame.

Equation

Mathematically, VY is calculated as follows:

where,

 is the position vector from the global origin to the To Marker, T.

 is the time-derivative of with respect to the Reference Frame, R.

178
Functions: N - Z

 is the position vector from the global origin to the From Marker, F.

 is the time-derivative of with respect to the Reference Frame, R.


 is the unit vector along the y-axis of the Along Marker, A.

Example

The following function returns the y component of the velocity vector between marker_T
and marker_F. The vector is expressed in the coordinate system of marker_A. All time-
derivatives are calculated in the reference frame of marker_R.

VY(marker_T, marker_F, marker_A, marker_R)


Learn more about velocity functions.

179
Printed Documentation

Run-time functions

Velocity Along Z (VZ)

Returns a z component of the difference between the velocity vectors of two coordinate
system markers.

Format

VZ (To Marker, From Marker, Along Marker, Reference Frame)

Arguments

To Marker (Required) The coordinate system marker whose


velocity is being measured.
From Marker (Optional) The coordinate system marker whose
velocity is subtracted off. If you don't specify this
argument, it defaults to the global origin.
Along Marker (Optional) The coordinate system marker along
whose z-axis the velocity is measured. If you
don't specify this argument, it defaults to the
global z-axis.
Reference (Optional) The coordinate system marker in
Frame which the time derivatives are calculated. If you
don't specify this argument, it defaults to the
ground reference frame.

Equation

Mathematically, VZ is calculated as follows:

where,

 is the position vector from the global origin to the To Marker, T.

 is the time-derivative of with respect to the Reference Frame, R.


 is the position vector from the global origin to the From Marker, F.

 is the time-derivative of with respect to the Reference Frame, R.


180
Functions: N - Z

 is the unit vector along the z-axis of the Along Marker, A.

Example

The following function returns the z component of the velocity vector between marker_T
and marker_F. The vector is expressed in the coordinate system of marker_A. All time-
derivatives are calculated in the reference frame of marker_R.

VY(marker_T, marker_F, marker_A, marker_R)


Learn more about velocity functions.

181
Printed Documentation

Run-time functions

Velocity Magnitude (VM)

Returns the magnitude of the first time-derivative of the displacement vector between two
coordinate system markers.

Format

VM (To Marker, From Marker, Reference Frame)

Arguments

To Marker (Required) The coordinate system marker whose


velocity is being measured.
From Marker (Optional) The coordinate system marker whose
velocity is subtracted off. If you don't specify
this argument, it defaults to the global origin.
Reference Frame (Optional) The coordinate system marker in
which the time derivatives are calculated. If you
don't specify this argument, it defaults to the
ground reference frame.

Equation

Mathematically, VM is calculated as follows:

where,

 is the position vector from the global origin to the To Marker, T.

 is the time-derivative of with respect to the Reference Frame, R.


 is the position vector from the global origin to the From Marker, F.

 is the time-derivative of with respect to the Reference Frame, R.

Example

182
Functions: N - Z

The following function returns the magnitude of the velocity vector between marker_T
and marker_F. The vector time-derivative is taken in the reference frame of marker_R.

VM(marker_T, marker_F, marker_R)

Learn more about velocity functions.

183

You might also like