MSolve API

What is the Python interface for MotionSolve?

A Python interface has been developed for MotionSolve. This means that MotionSolve is now available in Python as a library. All of its functionality can be accessed through a well-defined set of Python functions, protocols and tools. From Python, you can access MotionSolve functionality in exactly the same way you would access other libraries such as NumPy or Matplotlib. The availability of this interface fundamentally alters the way in which you interact with MotionSolve.

You do not need to be a programmer in order to use MotionSolve in the Python environment. You can still provide models for MotionSolve to solve. However, you now also have the ability to program with MotionSolve and create your own solutions.

MotionSolve has historically been a black box. The only way to communicate with it was through an XML input file and user-subroutines, as shown in the figure below.



Figure 1. The Current Paradigm for Interacting with MotionSolve is very Batch Oriented

The Python interface alters this interaction in four significant ways.

  • The input to MotionSolve is a set of Python commands. These can be conveniently collected into a script, Python functions or classes and reused.
  • Using standard Python, you can extend the core capabilities of MotionSolve. So, MotionSolve now is much more easily customized.
  • The distinction between model input files, commands and user-subroutines vanishes. They all become inputs to MotionSolve. Some inputs are processed before the simulation and others during the simulation. The same language is used to express all three.
  • The rich set of functionality available in Python and its application libraries can be easily integrated with MotionSolve capabilities to provide an open, extensible and incredibly powerful set of multibody simulation capabilities.


Figure 2. The New Paradigm Allows you to Interact with MotionSolve in a Very Flexible Way

You are not compelled to use the new paradigm. The old paradigm continues to work and is fully supported. You can continue to use it if this is what you want.

Who will use the Python interface?

The Python interface will be used by four groups of users.

  • End-users not really interested in programming with MotionSolve. MotionSolve can still be provided with an input deck and it will generate the answers you want. It is 100% backward compatible, and functions exactly as it used to.
  • Advanced users: You can customize MotionSolve to address your specific needs. You can create new modeling elements, develop composite entities, calculate custom results and perform post-processing operations with the results - all with the power of Python.
  • MotionView developers: You will use the Python interface to create an interactive user environment for multibody simulation. The solver can be integrated into the model-building phase.
  • 3rd party developers: You will use the Python interface to create application specific objects that know about the physics of their behavior. Communication with MotionSolve can be in terms of these higher-level objects.

What is being provided as a part of this interface?

The Python interface for MotionSolve consists of the following:
  • A new object oriented Python interface for MotionSolve.
  • A complete set of reference documentation for the interface
  • Numerous examples that illustrate the use of the interface
  • Webinar-based training, dedicated Confluence page with helpful information and 1-O-1 support