Md-helaluddin /
Automotive-Model-Based-Design
A physics-based simulation of an electric vehicle powertrain (Battery, DC Motor, Transmission, and Vehicle Body) developed in MATLAB/Simulink using Model-Based Design principles
Loading repository data…
mathworks / repository
A Battery Electric Vehicle (BEV) model in Simscape for longitudinal powertrain analysis
Version 3.3.0
This is a MATLAB® Project containing a Battery Electric Vehicle (BEV) model and its components such as motor, high voltage battery, and longitudinal vehicle. This project demonstrates Simscape's modular and multi-fidelity modeling technology.
The abstract BEV model is built in a simple and modular fashion, and it can run faster than real-time. It is suitable as a baseline model for drive cycle simulation to estimate vehicle's electrical efficiency and other vehicle-level information.
BEV system model:
FTP75 drive cycle simulation result:
Simple drive pattern simulation result:
Use BEV Project Navigator App to quickly access some key files and tools.
Use Vehicle1D Performance Design App to design the basic performance parameters of a road vehicle.
Use Motor Drive Unit Efficiency App for System Thermal Model to understand how the model parameters are affecting the motor efficiency.
Use Motor Drive Unit Simulation App to select model and run simulation for the Motor Drive Unit.
Improved Reducer component resources
Improved testing
buildfile.m files for the Build Tool are added.
In particular, tests for Button blocks' callbacks are added to check
that the callbacks work as expected.Improved code quality
codeAnalyzerConfiguration.json file in the Project root > resources folder.
Custom rules are also used by the Editor and by the build tool's CodeIssues task.Improved signal design for lookup table blocks
Streamlined model set up
Improved isolation of simulation case scripts
Improved discoverability and organization of test files
unittest_*, uitest_*, uptodatetest_*, or
uiuptodatetest_* so that the purpose of each test file is clear from its file name.Better organization of utility tools
Past What's New contents have been moved to Change Log.
From R2025a, you can save Live Scripts as plain-text files.
All Live Scripts in the project are now plain-text with .m extensions.
The use of plain-text files improves the compatibility with source control systems.
Text-based search and replace work with not only conventional MATLAB code files but
also all Live Script files in the project.
A model for testing a component is now placed in the component top folder. This improves the discoverability of models for component testing.
Component models that are built as Referenced Subsystems such as Basic model or System model are stored in separate subfolders, such as Model-Basic or Model-System, respectively. Related resources for a referenced subsystem including simulation case scripts and test code files are saved in the same folder, improving the isolation of each component model.
buildfile.mFor running unit tests,
the project now uses the Build Tool with buildfile.m.
From R2025a, you can run Build Tool tasks using the Run Build button in the Toolstrips
in addition to using the buildtool command on the Command Window.
This project has several buildfile.m files.
The Editor recognizes the buildfile.m file as a Build Tool file
and shows the Run Build button in the Editor Toolstrip.
The project finds the buildfile.m file in the project root folder
and shows the Run Build button in the Project Toolstrip.
Reducer component now has a test model and supporting files.
Also, the Reducer component uses Simscape selective data logging, which simplifies the way data in Simscape blocks is logged during simulation. Other components will use the same approach in the future.
To edit physical input signals using PS Lookup Table (1D) blocks in the Reducer component, Signal Tool is used.
For graphically editing signals, you can use SignalDesignApp
which is included in the project and you can find in Project root > Utility > SignalTool folder.
For programmatically editing signals, you can use functions in the SignalTool1 name space.
See the Live Scripts in Project root > Components > Reducer > Model-Basic > SimulationCases
folder for example usages.
Supported MATLAB Version: R2025b or newer releases
Required: MATLAB, Simulink®, Powertrain Blockset, Simscape, Simscape Driveline™, Simscape Electrical™
Optional: MATLAB Test, Parallel Computing Toolbox™
Open BatteryElectricVehicle.prj in MATLAB, and
it will automatically open the project main page BEV_main_script.html.
The script contains the description of the model and
hyperlinks to models and scripts.
You can try this in MATLAB Online. In MATLAB Online, from the HOME tab in the toolstrip, select Add-Ons > Get Add-Ons to open the Add-On Explorer. Then search for the submission name, navigate to the submission page, click Add button, and select Save to MATLAB Drive.
BEV system model and its components are tested using [MATLAB Unit Testing framework][doc-test].
Some tests are passing tests that check if code runs or not and
do not use the verify* functions.
They simply run scripts, functions, classes,
or models, and check that they run without errors.
Passing tests are designed to finish quickly so that they can be used
in day-to-day development activities in a short iteration cycle.
This project uses the buildtool with buildfile.m to
check code, run tests, measure code cov
Selected from shared topics, language and repository description—not editorial ratings.
Md-helaluddin /
A physics-based simulation of an electric vehicle powertrain (Battery, DC Motor, Transmission, and Vehicle Body) developed in MATLAB/Simulink using Model-Based Design principles