HyperWorks Solvers

Constraint: General

Constraint: General

Previous topic Next topic Expand/collapse all hidden text  

Constraint: General

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  
hmtoggle_plus1greyXML Format

Model Element

Description

The Constraint_General element is used to specify a user defined general constraint.  Your constraint equations may involve position as well as velocity measures of the system.  Although MotionSolve provides a large set of constraints to choose from (see Constraint_Joint), there are situations that require non-standard constraints.  For example, the constraint that a wheel rolls without slipping is a non-holonomic constraint that can be modeled using the Constraint_General element.

Format

<Constraint_General

      id                   =  "integer"

    [ label                = "string" ]

{

      expr                 = "motionsolve_expression"

    |

      usrsub_dll_name      = "valid_path_name"

      usrsub_param_string  = "USER( [[par_1][, ...][, par_n]] )"

      usrsub_fnc_name      = "fnc_name" >

    |

      script_name          = "valid_path_name"

      interpreter          = "PYTHON" | "MATLAB" ]

      usrsub_param_string  = "USER( [[par_1 [, ...][,par_n]] )"

    [ usrsub_fnc_name      = "custom_fnc_name" ] >

 

}

</Constraint_General>

Attributes

id

Element identification number, (integer>0).  This number is unique among all Constraint_General elements.

label

The name of the Constraint_General element.

expr

An expression (that will be set to zero) defining the general constraint.

usrsub_dll_name

Specifies the path and name of the DLL or shared library containing a user subroutine.  MotionSolve uses this information to load the user subroutine in the DLL at run time.

usrsub_param_string

The list of parameters that are passed from the data file to the user defined subroutine, GCOSUB.

usrsub_fnc_name

Specifies an alternative name for the user-written subroutine GCOSUB.

script_name

Specifies the path and name of the user written script that contains the routine specified by usrsub_fnc_name.

interpreter

Specifies the interpreted language that the user script is written in. Valid choices are MATLAB or PYTHON.

Comments

1.You can use Constraint_General to impose holonomic as well as non-holonomic constraints. Those constraints that can be written as equations involving only position measurements are called holonomic constraints. The rest are called non-holonomic constraints.
2.For non-holonomic constraints, the constraint reaction forces applied by MotionSolve to the rest of the system are correct if the constraint satisfies the following two conditions:
The constraint is a function of only time, positions, and velocities of the system.
The second, partial derivative of the constraint against any velocity terms results in identity zero.

The second condition implies the constraint must be linear in terms of velocity if it involves any velocity terms.  If either or both of the conditions are not satisfied, certain terms in the constraint reaction forces are neglected by MotionSolve, which may result in incorrect dynamic behavior if these neglected terms become significant.

You can reference a Reference_Variable in Constraint_General using VARVAL(). The Reference_Variable can be defined using an explicit expression or through a user-written subroutine (VARSUB).
Constraint_General cannot be used in a kinematic analysis. It is also not compatible with ABAM, VSTIFF, and MSTIFF in a dynamic anaylsis.
3.When used in a dynamic analysis with DSTIFF, the constraint must be smooth for Index-3.  The constraint and its first derivative (slope) must be smooth for Index-2.  The constraint and both its first derivative (slope) and second derivative (curvature) must be smooth for Index-1.
hmtoggle_plus1greyPython Format

Model Element

Description

The GCON element is used to specify a user defined general constraint.  Your constraint equations may involve position as well as velocity measures of the system.  Although MotionSolve provides a large set of constraints to choose from (see JOINT), there are situations that require non-standard constraints.  For example, the constraint that a wheel rolls without slipping is a non-holonomic constraint that can be modeled using the GCON element.

Declaration

def GCON(id, LABEL="", I=0, FUNCTION="", ROUTINE="", INTERPRETER="", SCRIPT=""):

Attributes

id

Element identification number (integer>0).  This number is unique among all the GCON elements.

LABEL

The name of the GCON element.

I

Specifies the ID of the marker that extracts the reaction force from the general constraint.

FUNCTION

An expression (that will be set to zero) defining the general constraint.

OR

The list of parameters that are passed from the data file to the user defined subroutine, GCOSUB.

ROUTINE

Specifies an alternative name for the user subroutine.

INTERPRETER

Specifies the interpreted language that the user script is written in.  Valid choices are MATLAB or PYTHON.

SCRIPT

 

Specifies the path and name of the user written script that contains the routine.

Comments

See Constraint_General

Example

The example below shows how a GCON element may be defined.  All three together are equivalent to a spherical joint.

GCON(1,LABEL="CON1", FUNCTION="DX(30101020,30102020)")

GCON(2,LABEL="CON2", FUNCTION="DY(30101020,30102020)")

GCON(3,LABEL="CON", FUNCTION="DZ(30101020,30102020)")

See Also:

Constraint_PTCV

JointInitialVel_Cyl

JointInitialVel_Rev

JointInitialVel_Trans

Model Statements

Command Statements

Functions

Notation and Syntax

User Defined Subroutines

User Subroutines in the MotionSolve User's Guide