# Constraint: General

Model ElementThe Constraint_General element is used to specify a user defined general constraint.

## Description

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" ]
}
[ is_virtual           = {"FALSE" | "TRUE"} ]
</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.
is_virtual
Defines whether the constraint is virtual or regular. If is_virtual is set to TRUE, the constraint is implemented as a virtual constraint. If is_virtual is set to FALSE, the constraint is implemented as a regular, algebraic constraint. This parameter is optional. The default is FALSE. See Comment 22 in Constraint: Joint for more information about virtual joints.
interpreter
Specifies the interpreted language that the user script is written in. Valid choices are MATLAB or PYTHON.