User Subroutines in MotionSolve

User-defined subroutines enable you to define your own modeling entities. For example, you may define a new constraint type using the UCOSUB user subroutine, or a new general force element using the GFOSUB user subroutine. User subroutines can be written in compiled languages such as FORTRAN, C/C++, or in interpreted languages such as Python, Altair Compose, and MathWorks® MATLAB. In case of compiled languages, a compiler is necessary to compile and link the user subroutines into a DLL (dynamically linked library) or SO (shared object). In case of interpreted languages, an interpreter needs to be installed alongside MotionSolve. MotionSolve calls the DLL/SO or script as necessary during the simulation process.

User subroutines provide the following key benefits:
  • Significantly faster simulation than expressions if compiled language is used.
  • Hides proprietary knowledge if compiled language is used.
  • Complete access to all solver functions.
  • The full power of the programming language and its associated libraries.
  • User subroutines have been used to model varied and complex elements like tires, hydrodynamic bearing pressures, aerodynamic forces, amplitude, and frequency dependent bushing models and friction models.

MotionSolve supports three types of subroutines: Modeling, Driver, and Utility. For detailed information on these subroutines, refer to Types of User-Written Subroutines in the MotionSolve Reference Guide.