Motion

Model ElementMotion defines a motion input into the system.

Class Name

Motion

Description

Motion defines a motion input into the system in one of two ways:
  • At an allowed degree-of-freedom in a joint
  • A relative displacement between two markers
When the input is specified at a joint, only on three types of joints can be used:
  • Revolute joints (rotational motion only)
  • Translational joints (translational motion only)
  • Cylindrical joints (either rotational or translational motion)

More general motion input on a Marker can be achieved using the Motion_Marker entity.

This interface accommodates both types of motion input.

Attribute Summary

Name Property Modifiable by command? Designable?
id Int()    
label Str() Yes  
i Reference("Marker") Yes Yes
j Reference("Marker") Yes Yes
joint Reference("Joint") Yes  
jtype Enum("TRANSLATION ROTATION", default="TRANSLATION")    
direction Enum("X Y Z B1 B2 B3") Yes  
dtype Enum("DISPLACEMENT VELOCITY ACCELERATION", default="DISPLACEMENT") Yes  
icdisp Double(None) Yes FD Only
icvel Double(None) Yes FD Only
function Function("MOTSUB") Yes FD Only
routine Routine()   FD Only
active Bool() Yes  

Usage

# Joint-based motion specified as an expression
Motion (joint=objJoint, function=expressionString, optional_attributes)

# Joint-based motion specified in a compiled user-written subroutine
Motion (joint=objJoint, function=userString, routine=string optional_attributes)

# Joint-based motion specified in a Python function
Motion (joint=objJoint, function= userString, routine=functionPointer, optional_attributes)

# Marker-based motion specified as an expression
Motion (i=objMarker, j=objMarker, direction=string, function=expressionString, optional_attributes)

# Marker-based motion specified in a compiled user-written subroutine
Motion (i=objMarker, j=objMarker, direction=string, function=userString, routine=string, optional_attributes)

# Marker-based motion specified in a Python function
Motion (i=objMarker, j=objMarker, direction=string, function=userString, routine=functionPointer, optional_attributes)

Attributes

Joint-based motion specified as an expression
joint
Reference to an existing Joint object.
Specifies the joint on which the motion input is to be applied.
The joint attribute is mandatory.
function
String defining a valid MotionSolve expression.
Specifies the MotionSolve expression that defines the motion output. Any valid run-time MotionSolve expression can be provided as input. It is usually a function of time.
The function attribute is mandatory.
jtype
String
Specifies the type of input that is to be applied. Used only when the joint type is CYLINDRICAL. In this case, you must select one from:
  • "ROTATION"
  • "TRANSLATION"
The jtype attribute is needed only when the joint type is CYLINDRICAL. It is not needed otherwise.
Joint-based motion specified in a compiled user-written subroutine
joint
Reference to an existing Joint object.
Specifies the joint on which the motion input is to be applied.
The joint attribute is mandatory.
function
String defining a valid MotionSolve expression.
The list of parameters that are passed from the data file to the user-defined subroutine where the Vforce is defined.
The function attribute is mandatory.
routine
String
Specifies an alternative name for the user subroutine. The name consists of two pieces of information, separated by "∷". The first is the pathname to the shared library containing the function that computes the response of the user-defined Vforce. The second is the name of the function in the shared library that does the computation.
An example is: routine="/staff/Altair/engine.dll::myMotion"
  • ="/staff/Altair/engine.dll is the DLL
  • "myMotion" is the function within this DLL that performs the calculations
The attribute routine is optional.
When not specified, routine defaults to "MOTSUB".
jtype
String
Specifies the type of input that is to be applied. Used only when the joint type is CYLINDRICAL. In this case, you must select one from:
  • "ROTATION"
  • "TRANSLATION"
The jtype attribute is needed only when the joint type is CYLINDRICAL. It is not needed otherwise.
Joint-based motion defined in a Python function
joint
Reference to an existing Joint object.
Specifies the joint on which the motion input is to be applied.
The joint attribute is mandatory.
function
String defining a valid MotionSolve expression.
The list of parameters that are passed from the data file to the user-defined subroutine where the Vforce is defined.
The function attribute is mandatory.
routine
Pointer to a callable function in Python.
An example is: routine=myMotsub
  • myMotsub is a Python function or method that can be called from wherever the model resides.
The attribute routine is optional.
When not specified, routine defaults to MOTSUB.
jtype
String
Specifies the type of input that is to be applied. Used only when the joint type is CYLINDRICAL. In this case, you must select one from:
  • "ROTATION"
  • "TRANSLATION"
The jtype attribute is needed only when the joint type is CYLINDRICAL. It is not needed otherwise.
Marker-based motion specified as an expression
i
Reference to an existing Marker object.
Specifies the Reference_Marker ID at which the motion input is applied.
The i attribute is mandatory.
j
Reference to an existing floating Marker object.
Specifies the Reference_Marker ID from which the motion input is applied.
The j attribute is mandatory.
direction
String
Specifies the direction in which the input that is to be applied. Select one from the following:
  • "X" - apply the translational input along the x-axis of the j Reference_Marker, i.e., control DX(I,J,J)
  • "Y" - apply the translational input along the y-axis of the j Reference_Marker, i.e., control DY(I,J,J)
  • "Z" - apply the translational input along the z-axis of the j Reference_Marker, i.e., control DZ(I,J,J)
  • "B1" - apply the rotational input about the x-axis of the j Reference_Marker, i.e., control B1(I,J)
  • "B2" - apply the rotational input about the "line of nodes", i.e., control B2 (I,J). See explanation below
  • "B3" - apply the input about the z-axis of the i Reference_Marker", i.e., control B2 (I,J).
The direction attribute is mandatory.
  • Directions B1, B2, and B3 refer to first, second, and third angles of the body-fixed 1, 2, and 3 Euler angles to orient the I marker relative to the J marker. The image below illustrates this sequence.


    Figure 1.
  • Start with a coordinate system X-Y-Z. Rotate the system about the X-axis. This is the B1 rotation. Due to this rotation, Y will move to Y' and Z to Z'. The coordinate system obtained due to the B1 rotation is X-Y'-Z'.
  • Now rotate about the Y' axis by an angle B2. Due to this rotation, Z' will move to its final location, Z1 and X to X''. The coordinate system obtained due to the B2 rotation is X''-Y'-Z1.
    Note: The Y' axis is also referred to as the "line of nodes".
  • The final rotation occurs about the Z1 axis. Due to this rotation, B3, X'' moves to it final location, X1 and Y' to its final location, Y1. The original orientation is X-Y-Z, the final is X1-Y1-Z1. The angles B1, B2, B3 are the Body-fixed 123 (or Bryant) angles.
function
String defining a valid MotionSolve expression.
Specifies the MotionSolve expression that defines the motion output. Any valid run-time MotionSolve expression can be provided as input. It is usually a function of time.
The function attribute is mandatory.
Marker-based motion specified in a compiled user-written subroutine
i
Reference to an existing Marker object.
Specifies the Reference_Marker ID at which the motion input is applied.
The i attribute is mandatory.
j
Reference to an existing floating Marker object.
Specifies the Reference_Marker ID from which the motion input is applied.
The j attribute is mandatory.
direction
String
Specifies the direction in which the input that is to be applied. Select one from the following:
  • "X" - apply the translational input along the x-axis of the j Reference_Marker, i.e., control DX(I,J,J)
  • "Y" - apply the translational input along the y-axis of the j Reference_Marker, i.e., control DY(I,J,J)
  • "Z" - apply the translational input along the z-axis of the j Reference_Marker, i.e., control DZ(I,J,J)
  • "B1" - apply the rotational input about the x-axis of the j Reference_Marker, i.e., control B1(I,J)
  • "B2" - apply the rotational input about the "line of nodes", i.e., control B2 (I,J)
  • "B3" - apply the input about the z-axis of the i Reference_Marker", i.e., control B2 (I,J)
The direction attribute is mandatory.
function
String defining a valid MotionSolve expression.
The list of parameters that are passed from the data file to the user-defined subroutine where the Vforce is defined.
The function attribute is mandatory.
routine
String
Specifies an alternative name for the user subroutine. The name consists of two pieces of information, separated by "∷". The first is the pathname to the shared library containing the function that computes the response of the user-defined Vforce. The second is the name of the function in the shared library that does the computation.
An example is: routine="/staff/Altair/engine.dll::myMotion"
  • "/staff/Altair/engine.dll is the DLL
  • "myMotion" is the function within this DLL that performs the calculations
The attribute routine is optional.
When not specified, routine defaults to "MOTSUB".
Marker-based motion specified in a Python function
i
Reference to an existing marker object.
Specifies the Reference_Marker ID at which the motion input is applied.
The i attribute is mandatory.
j
Reference to an existing floating Marker object.
Specifies the Reference_Marker ID from which the motion input is applied.
The j attribute is mandatory.
direction
String
Specifies the direction in which the input that is to be applied. Select one from the following:
The direction attribute is mandatory.
function
String defining a valid MotionSolve expression.
The list of parameters that are passed from the data file to the user defined subroutine where the Vforce is defined.
The function attribute is mandatory.
routine
Pointer to a callable function in Python.
An example is: routine=myMotsub
  • myMotsub is a Python function or method that can be called from wherever the model resides.
The attribute routine is optional.
When not specified, routine defaults to MOTSUB.
Optional attributes - Available to all variants
id
Integer
Specifies the element identification number. This number must be unique among all the Vforce objects in the model.
This attribute is optional. MotionSolve will automatically create an ID when one is not specified.
Range of values: id > 0
label
String
Specifies the name of the Vforce object.
This attribute is optional. When not specified, MotionSolve creates a label for you.
dtype
Specifies whether the motion applies a displacement input, a velocity input, or an acceleration input. You must select one value from:
  • dtype="DISPLACEMENT" - to specify a displacement input.
  • dtype="VELOCITY" - to specify a velocity input.
  • dtype="ACCELERATION" - to specify an acceleration input.
This attribute is optional. When not specified dtype defaults to "DISPLACEMENT".
icdisp
Double
Specifies the displacement initial condition that is required when dtype = "VELOCITY" or dtype = "ACCELERATION".
icdisp must be specified when dtype = "VELOCITY" or dtype = "ACCELERATION"
icvel
Double
Specifies the velocity initial condition that is required when dtype = "ACCELERATION". icvel must be specified when dtype = "ACCELERATION"
active
Boolean
Select one from "TRUE" or "FALSE"
  • "TRUE" indicates that the element is active in the model and it affects the behavior of the system
  • "FALSE" indicates that the element is inactive in the model and it does not affect the behavior of the system. It is almost as if the entity was removed from the model, of course with the exception that can be turned "ON" when desirable.
The attribute active is optional. When not specified, active defaults to "TRUE"

Example

Define an acceleration Motion on a revolute joint.
mot1 = Motion (label="mot1", joint=j301, dtype="ACCELERATION", 
               function="CUBSPL(Time, 0, 301001)")
Define a displacement Motion on a translational joint.
mot2 = Motion (label="mot2",joint=j302, function="CUBSPL(Time, 0, 301)")
Define a velocity Motion along the Y-direction of the global coordinate system.
mot3 = Motion (label="mot3",i=j303, j=0,direction="Y",dtype="VELOCITY",
        function="-2*PI*Cos(2*PI*(Time-30D))")
Define a displacement rotational Motion about the X-axis of the global coordinate system.
mot4 = Motion (label="mot4", i=j303, j=0, direction="B1", dtype="DISPLACEMENT",
        function="CURVE(3, Time, 1)")
Define a displacement Motion about the Z-axis of the I marker in a compiled user subroutine.
mot5 = Motion (label="mot5", i=j305, j=j404, direction="B3", dtype="DISPLACEMENT",
        function="USER(1,2,9,-10.32)",routine="RobotMotion")
Define a displacement Motion in a user written Python function.
# Define the function
def RobotMotion (id, time, par, npar, dflag, iflag):
  x0 = par[0]
  x1 = par[1]
  h0 = par[2]
  h1 = par[3]
  
return STEP (time, x0, h0, x1, h1)

# Now refer to the function in the Motion object
mot5 = Motion (label="mot5",i=j305, j=j404, direction="B3", dtype="DISPLACEMENT",
       function="USER(1,2,9,-10.32)", routine=RobotMotion

Joint-based Motion vs. Marker based Motion.

Assume there exists a Cylindrical joint, cyl, whose I-marker is cyl_I and J-marker is cyl_J.

#Mot61 and mot62 are entirely equivalent:
Mot61 = Motion (label="mot61",i=cyl_I, j=cyl_J, direction="Z",
        function="2*sin(pi*time)")
Mot62 = Motion (label="mot62",joint=cyl1, jtype="TRANSLATION", 
        function="2*sin(pi*time)")

#Mot71 and mot72 are entirely equivalent:
Mot71 = Motion (label="mot71",i=cyl_I, j=cyl_J, direction="B3", 
function="2*sin(pi*time)")
Mot72 = Motion (label="mot72",joint=cyl, jtype="ROTATION", 
function="2*sin(pi*time)")