Top Banner
SIMPACK Expressions Catalogue SIMPACK Release 8.6 24th September 2003/SIMDOC v8.607 COPYRIGHT 2003 c
39
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Expressions

SIMPACK

Expressions Catalogue

SIMPACK Release 8.6

24th September 2003/SIMDOC v8.607

COPYRIGHT 2003 c©

Page 2: Expressions

VII–EXPR:2 -2 Kinematic Functions

VII–EXPR:2 Kinematic Functions

DX - Displacement in X

Purpose:

Access function of type kinematic measurement of translational dis-placements for SIMPACK.

Definition:

Calculates the translational x-displacement of marker i relative tomarker j in the coordinates of marker k.

Usage:

res = DX(I, J, K)

Input Parameters:

integer I: ID of I marker

integer J: ID of J marker, if 0 defaults to Isys

integer K: ID of reference marker K, if 0 defaults to Isys

DY - displacement in Y

Purpose:

Access function of type kinematic measurement of translational dis-placements for SIMPACK.

Definition:

Calculates the translational y-displacement of marker i relative tomarker j in the coordinates of marker k.

Usage:

res = DY(I, J, K)

Input Parameters:

integer I: ID of I marker

integer J: ID of J marker, if 0 defaults to Isys

integer K: ID of reference marker K, if 0 defaults to Isys

Page 3: Expressions

Kinematic Functions VII–EXPR:2 -3

DZ - Displacement in Z

Purpose:

Access function of type kinematic measurement of translational dis-placements for SIMPACK.

Definition:

Calculates the translational z-displacement of marker i relative tomarker j in the coordinates of marker k.

Usage:

res = DZ(I, J, K)

Input Parameters:

integer I: ID of I marker

integer J: ID of J marker, if 0 defaults to Isys

integer K: ID of reference marker K, if 0 defaults to Isys

DM - Magnitude of Displacement

Purpose:

Access function of type kinematic measurement of translationaldisplacements for SIMPACK.

Definition:

Calculates the positive magnitude of the translational displacement be-tween marker i and marker j.

Usage:

res = DM(I, J)

Input Parameters:

integer I: ID of I marker

integer J: ID of J marker, if 0 defaults to Isys

Page 4: Expressions

VII–EXPR:2 -4 Kinematic Functions

VX - Velocity in X

Purpose:

Access function of type kinematic measurement of translational veloc-ities for SIMPACK.

Definition:

Calculates the x-component of the difference of velocities of markeri in reference to marker j in the x-component of marker l. Themeasurments of the position markers are in the co-ordinates of markerk.

Usage:

res = VX(I, J, K, L)

Input Parameters:

integer I: ID of I marker whose velocity is measured

integer J: ID of J marker, if 0 defaults to Isys

integer K: ID of reference marker K, if 0 defaults to Isys

integer L: ID of L marker, if 0 defaults to Isys

VY - Velocity in Y

Purpose:

Access function of type kinematic measurement of translational veloc-ities for SIMPACK.

Definition:

Calculates the y-component of the difference of velocities of markeri in reference to marker j in the y-component of marker l. Themeasurments of the position markers are in the co-ordinates of markerk.

Usage:

res = VY(I, J, K, L)

Input Parameters:

integer I: ID of I marker whose velocity is measured

integer J: ID of J marker, if 0 defaults to Isys

Page 5: Expressions

Kinematic Functions VII–EXPR:2 -5

integer K: ID of reference marker K, if 0 defaults to Isys

integer L: ID of L marker, if 0 defaults to Isys

VZ - Velocity in Z

Purpose:

Access function of type kinematic measurement of translational veloc-ities for SIMPACK.

Definition:

Calculates the z-component of the difference of velocities of marker i inreference to marker j in the z-component of marker l. The measurmentsof the position markers are in the co-ordinates of marker k.

Usage:

res = VZ(I, J, K, L)

Input Parameters:

integer I: ID of I marker whose velocity is measured

integer J: ID of J marker, if 0 defaults to Isys

integer K: ID of reference marker K, if 0 defaults to Isys

integer L: ID of L marker, if 0 defaults to Isys

VM - Magnitude of Velocity

Purpose:

Access function of type kinematic measurement of translational veloc-ities for SIMPACK.

Definition:

Calculates the magnitude of the difference in speed (scalar quantity)of marker i and marker j in co-ordinates of marker l.

Usage:

res = VM(I, J, L)

Page 6: Expressions

VII–EXPR:2 -6 Kinematic Functions

Input Parameters:

integer I: ID of I marker

integer J: ID of J marker, if 0 defaults to Isys

integer L: ID of reference marker L, if 0 defaults to Isys

VR - Relative Velocity

Purpose:

Access function of type kinematic measurement of translational veloc-ities for SIMPACK.

Definition:

Calculates the relative point to point velocity (vector quantity) ofmarker i in respect to marker j in co-ordinates of marker l.n.b. VR is negative when the markers are approaching each other.

Usage:

res = VR(I, J, L)

Input Parameters:

integer I: ID of I marker

integer J: ID of J marker, if 0 defaults to Isys

integer L: ID of reference marker L, if 0 defaults to Isys

ACCX - Acceleration in X

Purpose:

Access function of type kinematic measurement of translational accel-erations for SIMPACK.

Definition:

Calculates the X-component of the acceleration of Marker i wrt Markerj, calculated in marker l, given in the co-ordinates of marker k.

Usage:

res = ACCX(I, J, K, L)

Page 7: Expressions

Kinematic Functions VII–EXPR:2 -7

Input Parameters:

integer I: ID of I marker whose acceleration is measured

integer J: ID of J marker that acceleration is wrt,

if 0 defaults to Isys

integer K: ID of reference marker K for presentation,

if 0 defaults to Isys

integer L: ID of L marker for co-ordinate system for

calculation, if 0 defaults to Isys

ACCY - Acceleration in Y

Purpose:

Access function of type kinematic measurement of translational accel-erations for SIMPACK.

Definition:

Calculates the Y-component of the acceleration of Marker i wrt Markerj, calculated in marker l, given in the co-ordinates of marker k.

Usage:

res = ACCY(I, J, K, L)

Input Parameters:

integer I: ID of I marker whose acceleration is measured

integer J: ID of J marker which acceleration is wrt,

if 0 defaults to Isys

integer K: ID of reference marker K for presentation,

if 0 defaults to Isys

integer L: ID of L marker which is co-ordinate system for

calculation, if 0 defaults to Isys

ACCZ - Acceleration in Z

Purpose:

Access function of type kinematic measurement of translational accel-erations for SIMPACK.

Page 8: Expressions

VII–EXPR:2 -8 Kinematic Functions

Definition:

Calculates the Z-component of the acceleration of Marker i wrt Markerj, calculated in marker l, given in the co-ordinates of marker k.

Usage:

res = ACCZ(I, J, K, L)

Input Parameters:

integer I: ID of I marker whose acceleration is measured

integer J: ID of J marker, if 0 defaults to Isys

integer K: ID of reference marker K, if 0 defaults to Isys

integer L: ID of L marker, if 0 defaults to Isys

ACCM - Magnitude of Acceleration

Purpose:

Access function of type kinematic measurement of translational accel-erations for SIMPACK expressions.

Definition:

Calculates the positive magnitude of the acceleration of Marker i wrtMarker j given in the co-ordinates of Marker k

Usage:

res = ACCM(I, J, L)

Input Parameters:

integer I: ID of I marker whose acceleration is measured

integer J: ID of J marker that acceleration is wrt,

if 0 defaults to Isys

integer L: ID of L marker for co-ordinate system for calculation

if 0 defaults to Isys

Restrictions:

The determination of the acceleration on line during time integrationis only possible as an additional algebraic q-state.

Page 9: Expressions

Kinematic Functions VII–EXPR:2 -9

AX - First Projected Angle

Purpose:

Access function of type kinematic measurement of rotational displace-ments for SIMPACK.

Definition:

Calculates the angular displacement of marker i about the x-axis ofmarker j.

Usage:

res = AX(I, J)

Input Parameters:

integer I: ID of I marker whose angular displacement

is measured

integer J: ID of reference marker J, if 0 defaults to Isys

Additional Information:

The angle is calculated as follows:AX = atan2(yi × zj, yi × yj).with yi, yj being the y axes of marker I and J respectively and zj beingthe z axis of marker J.

AY - Second Projected Angle

Purpose:

Access function of type kinematic measurement of rotational displace-ments for SIMPACK.

Definition:

Calculates the angular displacement of marker i about the y-axis ofmarker j.

Usage:

res = AY(I, J)

Input Parameters:

integer I: ID of I marker whose angular displacement

Page 10: Expressions

VII–EXPR:2 -10 Kinematic Functions

is measured

integer J: ID of J marker, if 0 defaults to Isys

Additional Information:

The angle is calculated as follows:AY = atan2(zi × xj, zi × zj).with zi, zj being the z axes of markers I and J respectively and xj beingthe x axis of marker J.

AZ - Third Projected Angle

Purpose:

Access function of type kinematic measurement of rotational displace-ments for SIMPACK.

Definition:

Calculates the angular displacement of marker i about the z-axis ofmarker j.

Usage:

res = AZ(I, J)

Input Parameters:

integer I: ID of I marker whose angular displacement

is measured

integer J: ID of J marker, if 0 defaults to Isys

Additional Information:

The angle is calculated as follows:AZ = atan2(xi × yj, xi × xj)with xi, xj being the x axes of marker I and j respectively and yj beingthe y axis of marker J.

YAW - Yaw angle between two markers

Purpose:

Access function of type kinematic measurement of rotational displace-ments for SIMPACK.

Page 11: Expressions

Kinematic Functions VII–EXPR:2 -11

Definition:

Calculates the first rotation of marker i with respect to marker j in3-2-1 Euler Angles.

Usage:

res = YAW(I, J)

Input Parameters:

integer I: ID of I marker whose velocity is measured

integer J: ID of J marker, if 0 defaults to Isys

PITCH - Pitch Angle

Purpose:

Access function of type kinematic measurement of rotational displace-ments for SIMPACK.

Definition:

Calculates the second rotation of marker i with respect to marker j in3-2-1 Euler Angles.

Usage:

res = PITCH(I, J)

Input Parameters:

integer I: ID of I marker whose velocity is measured

integer J: ID of J marker, if 0 defaults to Isys

ROLL - Third Euler Angle

Purpose:

Access function of type kinematic measurement of rotational displace-ments for SIMPACK.

Page 12: Expressions

VII–EXPR:2 -12 Kinematic Functions

Definition:

Calculates the third rotation of marker i with respect to marker j in3-2-1 Euler Angles.

Usage:

res = ROLL(I, J)

PSI - First Euler Angle

Purpose:

Access function of type kinematic measurement of rotational displace-ments for SIMPACK.

Definition:

Calculates the first rotation of marker i with respect to marker j in3-1-3 Euler Angles.

Usage:

res = PSI(I, J)

Input Parameters:

integer I: ID of I marker whose velocity is measured

integer J: ID of J marker, if 0 defaults to Isys

THETA - Second Euler Angle

Purpose:

Access function of type kinematic measurement of rotational displace-ments for SIMPACK.

Definition:

Calculates the second rotation of marker i with respect to marker j in3-1-3 Euler Angles.

Page 13: Expressions

Kinematic Functions VII–EXPR:2 -13

Usage:

res = THETA(I, J)

Input Parameters:

integer I: ID of I marker whose velocity is measured

integer J: ID of J marker, if 0 defaults to Isys

PHI - Third Euler Angle

Purpose:

Access function of type kinematic measurement of rotational displace-ments for SIMPACK.

Definition:

Calculates the third rotation of marker i with respect to marker j in3-1-3 Euler Angles.

Usage:

res = PHI(I, J)

Input Parameters:

integer I: ID of I marker whose velocity is measured

integer J: ID of J marker, if 0 defaults to Isys

ALPHA - First Karden Angle

Purpose:

Access function of type kinematic measurement of rotational displace-ments for SIMPACK.

Definition:

Calculates the first angle alpha of the Kardan sequence 1-2-3 of markerI wrt marker J.

Page 14: Expressions

VII–EXPR:2 -14 Kinematic Functions

Usage:

res = ALPHA(I, J)

Input Parameters:

integer I: ID of I marker whose angular displacement

is measured

integer J: ID of refernce marker J, if 0 defaults to Isys

BETA - Second Karden Angle

Purpose:

Access function of type kinematic measurement of rotational displace-ments for SIMPACK.

Definition:

Calculates the second angle beta of the Kardan sequence 1-2-3 ofmarker I wrt marker J.

Usage:

res = BETA(I, J)

GAMMA - Third Karden Angle

Purpose:

Access function of type kinematic measurement of rotational displace-ments for SIMPACK.

Definition:

Calculates the third angle gamma of the Kardan sequence 1-2-3 ofmarker I wrt marker J.

Usage:

res = GAMMA(I, J)

Page 15: Expressions

Kinematic Functions VII–EXPR:2 -15

WX - Angular Velocity about X

Purpose:

Access function of type kinematic measurement of angular velocitiesfor SIMPACK user routines.

Definition:

Calculates the rotation about X, α, of the difference in the angularvelocity vectors of marker i and marker j calculated in Isys, expressedin marker k.

Usage:

res = WX(I, J, K)

Input Parameters:

integer I: ID of I marker whose velocity is measured

integer J: ID of J marker, if 0 defaults to Isys

integer K: ID of reference marker K, if 0 defaults to Isys

WY - Angular Velocity about Y

Purpose:

Access function of type kinematic measurement of angular velocitiesfor SIMPACK.

Definition:

Calculates the y-component of the difference of the angular velocityvectors of marker i and marker j calculated in the global referenceframe, expressed in marker k.

Usage:

res = WY(I, J, K)

Input Parameters:

integer I: ID of I marker whose velocity is measured

integer J: ID of J marker, if 0 defaults to Isys

integer K: ID of reference marker K, if 0 defaults to Isys

Page 16: Expressions

VII–EXPR:2 -16 Kinematic Functions

WZ - Angular Velocity about Z

Purpose:

Access function of type kinematic measurement of angular velocitiesfor SIMPACK.

Definition:

Calculates the z-component of the difference of the angular velocityvectors of marker i and marker j calculated in the global referenceframe, expressed in marker k.

Usage:

res = WZ(I, J, K)

Input Parameters:

integer I: ID of I marker whose velocity is measured

integer J: ID of J marker, if 0 defaults to Isys

integer K: ID of reference marker K, if 0 defaults to Isys

WM - Magnitude of Angular Velocity

Purpose:

Access function of type kinematic measurement of angular velocitiesfor SIMPACK user routines.

Definition:

Calculates the positive magnitude of the difference of the angularvelocity vectors of marker i and marker j calculated in the globalreference frame.

Usage:

res = WM(I, J)

Input Parameters:

integer I: ID of I marker whose velocity is measured

integer J: ID of J marker, if 0 defaults to Isys

Page 17: Expressions

Kinematic Functions VII–EXPR:2 -17

WDX - Angular Acceleration about X

Purpose:

Access function of type kinematic measurement of angular accelerationsfor SIMPACK.

Definition:

Calculates the x co-ordinate given with respect to marker l, of theangular acceleration of marker i in reference to marker j given inmarker k co-ordinate system.

Usage:

res = WDX(I, J, K, L)

Input Parameters:

integer I: ID of I marker whose acceleration is measured

integer J: ID of J marker, if 0 defaults to Isys

integer K: ID of reference marker K, if 0 defaults to Isys

integer L: ID of L marker, if 0 defaults to Isys

Additional Information:

The angular accelerations are calculated as derivatives of the angularvelocities ω. While the system in which the derivatives for the accel-erations are calculated can be specified through marker l, the angularvelocity ωx is always taken in the global reference frame.

WDY - Angular Acceleration about Y

Purpose:

Access function of type kinematic measurement of angular accelerationsfor SIMPACK.

Definition:

Calculates the y co-ordinate given with respect to marker l, of theangular acceleration of marker i in reference to marker j given inmarker k co-ordinate system.

Page 18: Expressions

VII–EXPR:2 -18 Kinematic Functions

Usage:

res = WDY(I, J, K, L)

Input Parameters:

integer I: ID of I marker whose acceleration is

measured

integer J: ID of J marker, if 0 defaults to Isys

integer K: ID of reference marker K,

if 0 defaults to Isys

integer L: ID of L marker,

if 0 defaults to Isys

Additional Information:

The angular accelerations are calculated as derivatives of the angularvelocities ω. While the system in which the derivatives for the accel-erations are calculated can be specified through marker L, the angularvelocity ωy is always taken in the global reference frame.

WDZ - Angular acceleration about X

Purpose:

Access function of type kinematic measurement of angular accelerationsfor SIMPACK.

Definition:

Calculates the z co-ordinate given with respect to marker l, of theangular acceleration of marker i in reference to marker j given inmarker k co-ordinate system.

Usage:

res = WDZ(I, J, K, L)

Input Parameters:

integer I: ID of I marker whose acceleration is

measured

integer J: ID of J marker, if 0 defaults to Isys

integer K: ID of reference marker K,

if 0 defaults to Isys

integer L: ID of L marker, if 0 defaults to Isys

Page 19: Expressions

Maths Functions VII–EXPR:1 -19

Additional Information:

The angular accelerations are calculated as derivatives of the angularvelocities ω. While the system in which the derivatives for the accel-erations are calculated can be specified through marker l, the angularvelocity ωz is always taken in the global reference frame.

WDM - Magnitude of Angular acceleration

Purpose:

Access function of type kinematic measurement of angular accelerationsfor SIMPACK.

Definition:

Calculates the magnitude of the angular acceleration of marker i inreference to marker j in co-ordinates of marker l.

Usage:

res = WDM(I, J, L)

Input Parameters:

integer I: ID of I marker whose acceleration is measured

integer J: ID of J marker, if 0 defaults to Isys

integer L: ID of L marker, if 0 defaults to Isys

Additional Information:

The angular accelerations are calculated as derivatives of the angularvelocities ω. While the system in which the derivatives for the accel-erations are calculated can be specified through marker l, the angularvelocity ω is always taken in the global reference frame.

VII–EXPR:1 Maths Functions

SIN - Sine

Definition:

Calculates the sine of the formula or value entered in the brackets.

Usage:

res = SIN(inp)

Page 20: Expressions

VII–EXPR:1 -20 Maths Functions

inp is the string or value (radians)

ASIN - Inverse Sine

Definition:

Calculates the arcus sine of the formula or value entered in the brackets.Angle is expressed in radians.

Usage:

res = ASIN(inp)

inp is the string or value

SINH - Hyperbolic Sine

Definition:

Calculates the hyperbolic sine of the formula or value entered in thebrackets.

Usage:

res = SINH(inp)

inp is the string or value

ASINH - Inverse Hyperbolic Sine

Definition:

Calculates the inverse hyperbolic sine of the formula or value enteredin the brackets.

Usage:

res = ASINH(inp)

inp is the string or value

COS - Cosine

Definition:

Calculates the cosine of the formula or value entered in the brackets.

Usage:

res = COS(inp)

inp is the string or value (radians)

ACOS - Inverse Cosine

Definition:

Calculates the arcus cosine of the formula or value entered in the brack-ets. Angle is expressed in radians.

Page 21: Expressions

Maths Functions VII–EXPR:1 -21

Usage:

res = ACOS(inp)

inp is the string or value

COSH - Hyperbolic Cosine

Definition:

Calculates the hyperbolic cosine of the formula or value entered in thebrackets.

Usage:

res = COSH(inp)

inp is the string or value

ACOSH - Inverse Hyperbolic Cosine

Definition:

Calculates the inverse hyperbolic cosine of the formula or value enteredin the brackets.

Usage:

res = ACOSH(inp)

inp is the string or value

TAN - Tangent

Definition:

Calculates the tangent of the formula or value entered in the brackets.

Usage:

res = TAN(inp)

inp is the string or value (radians)

ATAN - Inverse Tangent

Definition:

Calculates the arcus tangent of the formula or value entered in thebrackets. Angle is expressed in radians.

Usage:

res = ATAN(inp)

inp is the string or value

Page 22: Expressions

VII–EXPR:1 -22 Maths Functions

TANH - Hyperbolic Tangent

Definition:

Calculates the hyperbolic tangent of the formula or value entered inthe brackets.

Usage:

res = TANH(inp)

inp is the string or value

ATANH - Inverse Hyperbolic Tangent

Definition:

Calculates the inverse hyperbolic tangent of the formula or value en-tered in the brackets.

Usage:

res = ATANH(inp)

inp is the string or value

EXP - Exponential Function

Definition:

This function calculates the exponential function. The value entered isthe power to which e is raised.

Usage:

res = EXP(inp)

inp is the value entered

ATAN2 - Inverse Tangent (2 arguments)

Definition:

Calculates the arcus tangent of the two variables. The result is returnedin radians between −π and π.

Usage:

res = ATAN2(inp1,inp2)

inp1 is the y variable inp2 is the x variable

LOG - Natural Logarithm

Definition:

Calculates the natural logarithm of the variable entered

Page 23: Expressions

Maths Functions VII–EXPR:1 -23

Usage:

res = LOG(inp)

inp is the variable, which must be 0 or greater

LOG10 - Logarithm to base 10

Definition:

Calculates the logarithm to base 10 of the variable entered

Usage:

res = LOG10(inp)

inp is the variable, which must be 0 or greater

POW - Power Function

Definition:

This function raises the first input to the power defined by the secondinput.

Usage:

res = pow(inp1, inp2)

inp1 is the first input inp2 is the second input to which the first inputis raised

SQRT - Square Root Function

Definition:

The function calculates the square root of the function

Usage:

res = SQRT(inp)

inp is the variable

MAX - Maximum Value

Definition:

Returns the greater value of the two variables.

Usage:

res = MAX(inp1,inp2)

inp1 is the first variable inp2 is the second variable

Page 24: Expressions

VII–EXPR:1 -24 Maths Functions

MIN - Minimum Value

Definition:

Returns the smaller value of the two variables.

Usage:

res = MIN(inp1,inp2)

inp1 is the first variable inp2 is the second variable

AINT - Nearest Integer

Definition:

This function returns the nearest integer, whose magnitude is no greaterthan the value entered. If the value 2.99 is entered then the functionwill return the value 2.

Usage:

res = AINT(inp)

inp is the value entered

ANINT - Next Integer

Definition:

The function returns the nearest whole number to the value entered.

Usage:

res = ANINT(inp)

inp is the value entered

DIM - Positive difference

Definition:

This function calculates the positive difference between the two vari-ables.

Usage:

res = DIM(inp1,inp2)

inp1 is the first variable inp2 is the second variable

The function equals zero if inp2 is greater than or equal to inp 1

MOD - Modulo Function

Definition:

The function divides the first input by the second input and returnsthe remainder.

Page 25: Expressions

Maths Functions VII–EXPR:1 -25

An example of the output for various different inputs to the function isshown:

MOD(7.0, 5.0) returns 2.0 MOD(21, 2) returns 1 MOD(-13, 5) returns-3

Usage:

res = MOD(inp1,inp2)

inp1 is the first variable inp2 is the second variable

% - Modulo Function

Definition:

This is the same function as the Modulo function, however the inputin the expression is slightly different.

An example of the output for various different inputs to the function isshown:

MOD(7.0, 5.0) returns 2.0 MOD(21, 2) returns 1 MOD(-13, 5) returns-3

Usage:

res = inp1%inp2

inp1 is the first variable inp2 is the second variable

ABS - Absolute Value

Definition:

Returns the absolute value of the string or value entered in the brackets.

Usage:

res = ABS(inp)Where,inp is the string or value

SIGN - Signum Function

Definition:

The signum function returns the absolute value of the first argumentmultiplied by the sign of the second argument

Usage:

res = SIGN(inp1, inp2)

inp1 is the first argument inp2 is the second argument

Page 26: Expressions

VII–EXPR:3 -26 Access Functions

IF - Arithmetic IF

Definition:

The expression returns either the first second or third input dependentupon whether the defining function is greater than, less than or equalto zero.

Usage:

res = IF(deffunc:inp1,inp2,inp3)

deffunc is the defining function inp1 is the first output variable inp2 isthe second output variable inp3 is the third output variable

If the defining function is:

• < 0→ inp1 is returned

• = 0→ inp2 is returned

• > 0→ inp3 is returned

VII–EXPR:3 Access Functions

FORCEAF - Force by Applied Force

Purpose:

Access function of type force element force access for SIMPACK.

Definition:

Returns the component COMP of the force ID in the coordinates ofthe Marker REFSYS, which defaults to the global reference frame ifset to zero.

Usage:

res = FORCEAF( id, mflag, comp, refsys )

Input Parameters:

integer id: ID of the force element to be investigated

integer mflag: Flags if force value in I (=0) or J (=1) marker

should be returned

integer comp: Component of the force to be returned

1 = Magnitude of the force

2 = x component of the force

3 = y component of the force

4 = z component of the force

5 = Magnitude of the torque

6 = x component of the torque

7 = y component of the torque

8 = z component of the torque

integer refsys: ID of reference marker in which the force should

Page 27: Expressions

Access Functions VII–EXPR:3 -27

be expressed, if 0 defaults to Isys

FORCEST - Force States

Purpose:

Access function of type force element force access for SIMPACK ex-pressions.

Definition:

Returns the force state of the component COMP and the force ID.

Usage:

res = FORCEST( id, comp, iord )

Input Parameters:

integer id: ID of the force element to be investigated.

Range = {1,2,...,Mbs.Force.nmax}.

integer comp: Component of the force state.

Range = {1,2,...,number_of_joint_states}.

integer iord: The order of the derivative to be returned, if zero,

the value itself is returned.

Range = {0,1}.

FORCEOV - Force Output Values

Purpose:

Access function of type force element force access for SIMPACK ex-pressions.

Definition:

Returns the force output value of the component COMP and the forceID.

Usage:

res = FORCEOV( id, comp )

Input Parameters:

integer id: ID of the force element to be investigated.

Range = {1,2,...,Mbs.Force.nmax}.

Page 28: Expressions

VII–EXPR:3 -28 Access Functions

integer comp: Component of the force state.

Range = {1,2,...,Mbs.Force.Ov.nmax}.

JOINTCF - Joint Constraining forces

Purpose:

Access function of type constrained forces of joints access for SIM-PACK.

Definition:

Returns the component COMP of constrained force of the joint ID inthe coordinates of the Marker REFSYS, which defaults to the globalreference frame if set to zero.k

→jointcf= T T

k · (cfj)In

Tk = Gk · GMk

Usage:

res = JOINTCF( id, mflag, comp, refsys )

Input Parameters:

integer id: ID of the joint to be investigated

integer mflag: Flags if force value in I (=0) or J (=1) marker

should be returned

integer comp: Component of the force to be returned

1 = Magnitude of the force

2 = x component of the force

3 = y component of the force

4 = z component of the force

5 = Magnitude of the torque

6 = x component of the torque

7 = y component of the torque

8 = z component of the torque

integer refsys: ID of reference marker in which the force should

be expressed, if 0 defaults to Isys

JOINTST - Joint States

Purpose:

Access function of type joint element of joints access for SIMPACK.

Page 29: Expressions

Access Functions VII–EXPR:3 -29

Definition:

Returns the joint state of the component COMP and the joint ID.

Usage:

res = JOINTST( id, comp, iord )

Input Parameters:

integer id: ID of the joint element to be investigated.

Range = {1,2,...,Mbs.Joint.nmax}.

integer comp: Component of the joint state.

Range = {1,2,...,number_of_joint_states}.

integer iord: The order of the derivative to be returned, if zero,

the value itself is returned.

Range = {0,1,2}.

CONSTRCF - Constraint Constraining Forces

Purpose:

Access function of type constrained forces of constraints access for SIM-PACK.

Definition:

Returns the component COMP of constrained force of the constraintID in the coordinates of the Marker REFSYS, which defaults to theglobal reference frame if set to zero.k

→constrcf= T T

k · (constrcf)In

Tk = Gk · GMk

Usage:

res = CONSTRCF( id, mflag, comp, refsys )

Input Parameters:

integer id: ID of the constraint to be investigated

integer mflag: Flags if force value in I (=0) or J (=1) marker

should be returned

integer comp: Component of the force to be returned

1 = Magnitude of the force

2 = x component of the force

3 = y component of the force

4 = z component of the force

5 = Magnitude of the torque

6 = x component of the torque

7 = y component of the torque

Page 30: Expressions

VII–EXPR:4 -30 Functions

8 = z component of the torque

integer refsys: ID of reference marker in which the force

should be expressed, if 0 defaults to Isys

CONSTRST - Constraint State

Purpose:

Access function of type constraint element of constraints access forSIMPACK.

Definition:

Returns the constraint state of the component COMP and the con-straint ID.

Usage:

res = CONST( id, comp, iord )

Input Parameters:

integer id: ID of the constraint element to be investigated.

Range = {1,2,...,Mbs.Constr.nmax}.

integer comp: Component of the constraint state.

Range = {1,2,...,number\_of\_constr\_states}.

integer iord: The order of the derivative to be returned, if zero,

the value itself is returned.

Range = {0}.

VII–EXPR:4 Functions

IFCTN - Input Function

Purpose:

Access function of type function evaluation of one dimensional inputfunction.

Definition:

Evaluates the function value of an input function or its , 1. - 3.derivativeThe function value may be a:

• step interpolation (kind spl = 0),

• cubic spline evaluation (kind spl = 1),

Page 31: Expressions

Functions VII–EXPR:4 -31

• linear interpolation (kind spl = 2),

• Akima spline (kind spl = 3).

In case of spline evaluation the derivatives until 3. order are deter-mined for the parameter xinp. Beyond the defined value range for1. parameter xinp the function evaluation in case of splines maybe further spline evaluation or linear interpolation with a smoothtransition from spline interpolation to linear interpolation ( the 2. and3. derivative become 0 after a transition range) When in case of splineevaluation the input value xinp exceeds the defined range, a warning isprinted the first time in Default mode (WPAR(45) = 0). WPAR(45)= 1 prevents the warning.

Usage:

res = IFCTN( xinp, id ifctn, kind deriv , kind spl, kind extr ,range extr )

Input Parameters:

double xinp: Input value of first parameter

integer id_ifctn: ID-number of input function

integer kind_deriv: Index of derivative (0 - 3)

= 0 : evaluation of function

= 1 : 1st derivative of function evaluation

= 2 : 2nd derivative of function evaluation

= 3 : 3rd derivative of function evaluation

integer kind_spl: kind of interpolation:

= -1 : use interpolation defined by GUI

= 0 : step interpolation

= 1 : cubic spline evaluation

= 2 : linear interpolation

= 3 : Akima spline

integer kind_extr: kind of extrapolation beyond the defined

range incase of splines

= -1 : use option defined by GUI

= 0 : spline evaluation beyond the

table values

= 1 : transition from spline evaluation

to linear evaluation

double range_extr: range of extrapolation beyond the defined set

of table values

( kind_extr = 1 (transition to linear ) )

Page 32: Expressions

VII–EXPR:4 -32 Functions

IFARRAY - Input Function Array

Purpose:

Access function of type function evaluation of a 2D-array.

Definition:

Evaluates the function value of a 2D-array: The function value may bea:

• step interpolation (kind spl = 0),

• cubic spline evaluation (kind spl = 1),

• linear interpolation (kind spl = 2),

• Akima spline evaluation (kind spl = 3).

In case of spline evaluation the derivatives (until 3rd order) are de-termined for the parameter xinp, while for the second parameter yinponly the 1st derivative is evaluated. Beyond the defined value range for1st parameter xinp the function is evaluated in case of splines may befurther spline evaluation or linear interpolated with a smooth transi-tion from spline interpolation to linear interpolation (the 2nd and 3rdderivative become 0 after the transition range)

Usage:

res = IFARRAY( xinp, yinp, ID ifarray, kind deriv , kind spl,kind extr, range extr )

Input Parameters:

double xinp: input value of first parameter.

double yinp: input value of second parameter.

integer id_ifarray: ID-number of 2D-array.

integer kind_deriv: kind of interpolation:

= -3 : Third Derivative of Y

= -2 : Second Derivative of Y

= -1 : First Derivative of Y

= 0 : The Actual Value is returned

= 1 : First Derivative of X

= 2 : Second Derivative of X

= 3 : Third Derivative of X

integer kind_spl: kind of interpolation:

= -1 : use interpolation defined by GUI

= 0 : step interpolation

= 1 : cubic spline evaluation

= 2 : linear interpolation

= 3 : Akima spline

integer kind_extr: kind of extrapolation beyond the defined

range in case of splines

= -1 : use option defined by GUI

= 0 : spline evaluation beyond the table

values

Page 33: Expressions

Functions VII–EXPR:4 -33

= 1 : transition from spline evaluation

to linear evaluation

double range_extr: range of extrapolation beyond the defined

set of table values.

( kind_extr = 1 (transition to linear ) )

HAVSIN - Haversine function

Purpose:

Access function of type Haversine Step access for SIMPACK.

Definition:

Returns the value calculated due to Haversin Step function evaluationwith the given parameters.

Usage:

res = HAVSIN(x, x0, h0, x1, h1, iord)Let x0 < x1. f :=SPCK UF HAVSIN is defined as:

f(x) :=

h0 x ≤ x0

12(h1 − h0)

(1− cos

(π x−x0

x1−x0

))+ h0 x0 < x < x1

h1 x1 ≤ x

Input Parameters:

double x: The independent varible for the Haversine

Step function.

double x0: The x-value specifying the begin of the step.

double h0: The value of the function before the step (x < x0 )

double x1: The x-value specifying the end of the step.

double h1: The value of the function after the step (x > x1 )

integer iord: The order of the derative to be returned, if zero,

the value itself is returned.

Range 0 <= iord <= 2.

=0: no error

STEP - Heaviside Step Function

Purpose:

Access function of type Step access for SIMPACK.

Page 34: Expressions

VII–EXPR:4 -34 Functions

Definition:

Returns the cubic approximation of the Heaviside step function withthe given parameters.

Usage:

res = STEP(x, x0, x1, h0, h1)Let x0 < x1. Within the range x0 < x < x1 solve f :=SPCK UF STEPthe cubic approximation:

f(x) :=3∑

n=0

anxn with:

f(x0) = h0, f ′(x0) = 0,f(x1) = h1, f ′(x1) = 0.

⇒ f(x) =

h0 x ≤ x0

(h1 − h0)(

x−x0

x1−x0

)2 (3− 2 x−x0

x1−x0

)+ h0 x0 < x < x1

h1 x1 ≤ x

Input Parameters:

double x: The independent varible for the Heaviside

Step function

double x0: The x-value specifying the begin of the step.

double h0: The value of the function before the step (x < x0 )

double x1: The x-value specifying the end of the step.

double h1: The value of the function after the step (x > x1 )

integer iord: The order of the derivative to be returned,

if zero, the value itself is returned.

Range 0 <= iord <= 2.

STEP5 - Heaviside STEP5 Function

Purpose:

Access function of type Step access for SIMPACK.

Definition:

Returns the approximation of the Heaviside step function through apolynomial of fifth order with the given parameters.

Usage:

res = STEP5(x, x0, x1, h0, h1)Let x0 < x1. Within the range x0 < x < x1 solve f :=SPCK UF Step5the polynom approximation of fifth order:

f(x) :=5∑

n=0

anxn with:f(x0) = h0, f ′(x0) = 0, f ′′(x0) = 0,f(x1) = h1, f ′(x1) = 0, f ′′(x1) = 0.

Page 35: Expressions

Functions VII–EXPR:4 -35

⇒ f(x) =

h0 x ≤ x0

(h1 − h0)(

x−x0

x1−x0

)3(10− 15 x−x0

x1−x0+ 6

(x−x0

x1−x0

)2)+ h0 x0 < x < x1

h1 x1 ≤ x

Input Parameters:

double x: The independent variable for the Haversine

Step function.

double x0: The x-value specifying the begin of the step.

double h0: The value of the function before the step (x < x0 )

double x1: The x-value specifying the end of the step.

double h1: The value of the function after the step (x > x1 )

integer iord: The order of the derative to be returned,

if zero, the value itself is returned.

Range 0 <= iord <= 2.

FORSIN - Fourier Sine

Purpose:

Access function of type Fourier access for SIMPACK.

Definition:

Returns the value calculated due to Fourier Sine evaluation with thegiven parameters.

Usage:

res = FORSIN(x, x_0, omega, b_0, ..., b_N)

SIMPACK provides the Fourier sine series form shown below

FORSIN(x, x0, ω, a) := b0 +N∑

n=1

bn sin (nω(x − x0))

where x, x0, ω ∈ R with ω > 0 and b := (b0, . . . , bN) with N ∈{0, . . . , 31} .

Input Parameters:

double x: The independent varibale for the

Fourier Sine.

double x_0: Specifies an offset in the Fourier

Sine.

double omega: The fundamental frequence in the

double b_0, ..., b_31: The arguments used by the function.

From 0 up to 31 different arguments

can be defined.

Page 36: Expressions

VII–EXPR:4 -36 Functions

FORCOS - Fourier Cosine

Purpose:

Access function of type Fourier access for SIMPACK.

Definition:

Returns the value calculated due to Fourier Cosine evaluation with thegiven parameters.

Usage:

res = FORCOS(x, x_0, omega, a_0, ..., a_N)

SIMPACK provides the Fourier cosine series form shown below

FORCOS(x, x0, ω, a) := a0 +N∑

n=1

an cos (nω(x − x0))

where x, x0, ω ∈ R with ω > 0 and a := (a0, . . . , aN) with N ∈{0, . . . , 31} .

Input Parameters:

double x: The independent variable for the

Fourier Cosine.

double x_0: Specifies an offset in the Fourier

Cosine.

double omega: The fundamental frequence in the

double a_0, ..., a_31: The arguments used by the function.

From 0 up to 31 different arguments

can be defined.

POLY - Polynomial evaluation

Purpose:

Access function of type polynomial access for SIMPACK.

Definition:

Returns the value calculated for the polynomial with the given param-eters.

Usage:

res = POLY(x, x_0, p_0, ..., p_N)

Page 37: Expressions

Functions VII–EXPR:4 -37

SIMPACK provides the polynomial function form shown below

POLY(x, x0,p) := p0 +N∑

n=1

pn (x − x0)n

where x, x0 ∈ R and p := (p0, . . . , pN) with N ∈ {0, . . . , 31} .

Input Parameters:

double x: The independent varible for the

polynomial.

double x_0: Specifies an offset in the polynomial

double p_0, ..., p_31: The arguments used by the function.

From 0 up to 31 different arguments

can be defined.

CHEBY - Chebyshev polynomial evaluation

Purpose:

Access function of type Chebyshev access for SIMPACK.

Definition:

Returns the value calculated for the Chebyshev polynomial with thegiven parameters.

Usage:

res = CHEBY(x, x_0, p_0, ..., p_N)

SIMPACK provides the Chebyshev polynomial function form shownbelow

CHEBY(x, x0,p) := p0 +N∑

n=1

pnTn(x − x0)

where x, x0 ∈ R, p := (p0, . . . , pN) with N ∈ {0, . . . , 31} and the n-thChebyshev polynomial Tn().

Input Parameters:

double x: The independent varibale for the

polynomial.

double x_0: Specifies an offset in the Chebyshev

polynomial.

double p_0, ..., p_31: The arguments used by the function.

From 0 up to 31 different arguments

can be defined.

Page 38: Expressions

VII–EXPR:4 -38 Functions

SHF - Simple Harmonic Function

Purpose:

Access function of type simple harmonic function for SIMPACK.

Definition:

Returns the value calculated for simple harmonic function with thegiven parameters.x = a ∗ sin(ω(x − x0)− φ) + b

Usage:

res = SHF(x, x0, a, w, phi, b, iord)

Input Parameters:

double x: The independent variable for the shf

double x0: Specifies an offset in x of the shf

double a: The amplitude of the sine function

double w: The frequency of the shf

double phi: A phase shift in the shf

double b: The mean value of the shf

integer iord: The order of the derivative to be returned,

if zero, the value itself is returned.

Range 0 <= iord <= 2.

TIME - Current solver time

Purpose:

Access function of type time access for SIMPACK.

Definition:

Returns the current simulation time.

Usage:

res = TIME

Remarks:

This function has no arguments

Page 39: Expressions

Functions VII–EXPR:4 -39

MODE - Solver mode

Purpose:

Access function of type solver access

Definition:

Returns the simulation mode the solver is currently running.

Usage:

res = MODE

Remarks:

This function has no arguments