Setting Up User-Defined Modeling Elements

In addition to writing your solver subroutine, you also have to modify the corresponding modeling element in your multibody model so that it receives output value(s) from the user subroutine.

This can be done in two ways:

Select the method to modify the corresponding modeling element in your multibody model:
  • By editing the MotionSolve XML file.
  • By modifying the entity in the MotionView interface and producing a new XML file.
Regardless of the method you select, you will end up with an XML file where one or more entities are now user defined.
For example, the following motion entity:
  <Motion_Joint
     id                  = "101001"
     type                = "EXPRESSION"
     val_type            = "D"
     expr                = "-.2*TIME"
     joint_id            = "101002"
     joint_type          = "R"
     motion_type         = "R"
     ic_disp             = "0."
     ic_vel              = "0.">
  </Motion_Joint>
can be modified in the following manner to indicate that the motion value is computed in a user subroutine, as opposed to an explicit function expression.
  <Motion_Joint
     id                  = "101001"
     type                = "USERSUB"
     val_type            = "D"
     usrsub_param_string = "USER(5,2)"
     usrsub_dll_name     = "C:/work/testsub.dll"
     joint_id            = "101002"
     joint_type          = "R"
     motion_type         = "R"
     ic_disp             = "0."
     ic_vel              = "0.">
  </Motion_Joint>