Scripting and the MASTA API
Scripting
MASTA includes an extensive set of scripting functionality. Scripting developed out of two main ideas. Firstly, enabling engineers to spend less time on manual tasks of model building, running analyses and extracting results. Secondly, enabling companies to utilise their own IP efficiently in design/development workflows without having to share it externally. Scripting, however, enables much more than this.
MASTA API
The API allows users write their own code outside of MASTA to interact with MASTA models and analyses. The API can be used from a whole range of languages including MATLAB and Python as well as any .NET language. The advantages of this are obvious. This flexibility allows users to write in the code languages they are familiar with. Secondly, this enables users to write code using the common IDE’s, such as Microsoft’s Visual Studio, and take advantage of all their debugging, intellisense and other development tools. Further it allows to easily interact with in-house tools no matter what language those tools are written in. The use cases for such functionality are limitless and can range from small utility type functions to whole new analysis methods.
Example - MATLAB
MATLAB code has been written using the MASTA API to run two variants of MASTA models and compare dynamic response to Gear Whine. In this case the acceleration response at an accelerometer location for the primary gear mesh order is compared. Using such a utility comparison between models can be done very quickly and efficiently.
Figure 1
Example - Running Python scripts within MASTA
Scripting not only allows the user to interact with software from outside its interface. It also allows more possibilities for extending the software functionality within the user interface. An example of this is shown in Figure 3. This shows a Python script referenced by a button within MASTA. When the button is pressed the script optimises the gear micro geometry to minimise TE. This is a simple example which demonstrates the advantage of being able to use high level Python functions, such as the utilised minimisation function, within MASTA scripts
Figure 2
Scripts run from within the software can either be obtained from referenced source code libraries or from compiled dynamic link libraries dlls. For easy distribution of scripting tools the SMT Store will allow easy download of any apps which have been distributed by SMT from within the software.