EV Drivetrain Demo Using MATLAB®
A script executed in MATLAB® will use the MASTA API to:
Load 2 MASTA models (a baseline model and a modified model)
Run gear whine analysis for a specified load case
Obtain bearing force response to a specified harmonic of a specified harmonic for both designs
Plot and compare the results from both designs
EV Drivetrain Model in MASTA
The model can be found on the Examples menu.
Save the model as 'EV Drivetrain Baseline'
Make a copy and save as 'EV Drivetrain Modified'
Modify the inner profile of the Input Shaft as shown and save.
This will add some mass and stiffness to the shaft.
Adding MASTA API to MATLAB®
Start MATLAB®
Add the .m file 'Add_MASTA_API' to your working directory
Change the mastaDirectory to be the MASTA installation folder on your machine
Run the script
This will load the MASTA API .NET assembly into MATLAB®.
MATLAB® Script
Add ‘EV_Drivetrain_Example.m’ to your working directory
In the setup part of the script, change the pathnames to point to where you have saved the MASTA models
Setup
This part of the script defines the MASTA model pathnames, load case (in design state) to run, which harmonic of which excitation to get results for and for which node of which accelerometers to extract data
Execute Analysis
This part of the script identifies which load case to run, and performs gear whine analysis on that load case
Obtain Results
This part of the script uses harmonic and excitation information to find the accelerations for the specified node of the specified accelerometers
This contains a workaround for accessing the point loads that represent the accelerometers
Plot Results
This part of the script plots all accelerometer accelerations for design 1, all accelerometer accelerations for design 2 and the accelerometer acceleration of the third accelerometer in the list for design 1 and design 2 on the same chart.
Results
Run the script
The entire script takes approximately 3 minutes to run. The results can be compared between the MASTA and MATLAB® plots:


The modified design shows a slight reduction in peak acceleration at 5500 Hz, but an increase at 6000 Hz.

Modify Script
The script can be modified to look at the 2nd harmonic results.
Conclusions
The MASTA API has successfully been loaded and used by MATLAB®.
Results from two different MASTA models have been obtained and compared in a single process, with no manual intervention by the user.