General Constraints

Use the General Constraints tool to create a generic expression-based constraint.

MotionView provides several standard constraints such as Joints and Motions, however they may not be suitable to represent all possible modeling scenarios. A GeneralConstraint may be defined using solver expressions in such scenarios. During solution, the solver would impose constraint such that the given expression is equated to zero.

Create General Constraints

  1. From the Model Browser, select the system to which the general constraint entity is to be added.
  2. Right-click on a system in the Model Browser and select Add > Constraint > GeneralConstraint from the context menu.
    OR
    Right-click on a general constraint folder in the Model Browser and select Add GeneralConstraint from the context menu.
    OR
    From the Model ribbon, click the arrow next to the Entities tool set name, then select General Constraints icon.
    The Add GeneralConstraint dialog is displayed.
  3. Specify a label and variable name.
    By default, variables names of entities in MotionView follow a certain convention. For example, all general constraint entities have a variable name starting with “gcon_”. This is the recommended convention to follow when building models in MotionView since it has many advantages in model editing and model manipulation.
  4. Click OK to close the window or Apply to continue creating entities.
    Once a general constraint entity has been added to the model, the properties of the constraint will be displayed in the Entity Editor.

Edit General Constraints

  1. Enter a solver expression in the Expression field.
    The expression may involve position, velocity, or any other general measure of the system.
  2. Alternatively, activate the User-defined check box to provide the constraint through a sub-routine.
    1. Provide an expression with the USER solver function in User expr with parameters being passed to the user subroutine.
    2. Alternatively, activate the Use local file and function name check box to specify a local file where the subroutine code can be accessed by the solver.
      If this option is not specified, MotionSolve will search for a subroutine following its user subroutine loading rules.
    3. Select a function type from the drop-down menu.
    4. Select the local file for the subroutine.
      The type of file to be specified will depend on the selected function type. For example, if DLL/SO is selected, you can specify a file with a .dll extension (for Windows) or an .so extension (for Linux).
    5. Specify the function name in the subroutine that defines the entity.
General Constraint Properties:
Property Description
General  
Label Descriptive label for the entity.
Varname Variable name of the entity.
ID Integer identifier.
Active Active state of the entity. True or False. Entity is deactivated if False.
Properties  
Expression A solver expression representing the constraint.
User Defined Alternate option to use a user subroutine (MotionSolve only) instead of Expression with the following properties:
  User expr USER() expression used to call the subroutine.
  Use local file and function name Option to use a local subroutine file along with the function.
  Local file Name of the subroutine file depending on the Function Type.
  Function Type Type of subroutine function. Available choices are DLL/SO, PYTHON, MATLAB, COMPOSE.
  Function name Name of function to be called within the subroutine.
Use Reaction marker Use a marker to impose reaction force (ADAMS only).
  Reaction marker Marker where the reaction is imposed.
Note  
Note Optional descriptive note.