This document explains how to install, configure and prepare the Smart EV Powertrain Simulator for use.
The project is developed using MATLAB and Simulink and contains MATLAB calculation scripts, Simulink models, project configuration files, drive-cycle data, generated results and technical documentation.
The installation process consists of:
- Obtaining the project
- Installing and verifying MATLAB and Simulink
- Opening the MATLAB project
- Initialising the project
- Verifying the project structure
- Running the MATLAB calculation modules
- Generating the required calculation data
- Opening the main Simulink model
- Running the simulation
- Opening the dashboard
- Reviewing the generated results
The project is a MATLAB/Simulink simulation and does not require specialised EV hardware.
A computer with the following is recommended:
| Component | Recommended |
|---|---|
| Processor | Modern multi-core CPU |
| RAM | 8 GB minimum, 16 GB recommended |
| Storage | At least 5 GB free space |
| Display | 1920 × 1080 or higher recommended |
| Operating System | Windows / macOS / Linux supported by MATLAB |
Actual simulation performance depends on the MATLAB release, model complexity and computer hardware.
The project requires:
| Software | Purpose |
|---|---|
| MATLAB | Engineering calculations and data processing |
| Simulink | Dynamic system simulation |
| MATLAB Project | Project organisation and path management |
| Git | Version control |
| GitHub | Remote repository hosting |
The project should preferably be opened using the MATLAB project file:
Smart-EV-Powertrain-Simulator.prj
No additional MATLAB toolboxes beyond base MATLAB and Simulink are required to run the calculation scripts and models as delivered.
git clone https://github.com/devsurya2004/Smart-EV-Powertrain-Simulator.git
cd Smart-EV-Powertrain-SimulatorIf Git isn't available, download the repository as a ZIP archive from GitHub and extract it to a folder of your choice.
Open MATLAB, navigate to the extracted project folder, and open:
Smart-EV-Powertrain-Simulator.prj
Opening the .prj file (rather than individual scripts) is recommended because the MATLAB Project automatically manages the folders on the MATLAB path for this project.
Every calculation script begins by calling:
[EV, scriptFolder, projectRoot] = Initialize_Project();Initialize_Project.m (in Scripts/) performs the following on each call:
- Clears the command window (in desktop MATLAB)
- Resolves the project root and Scripts folder paths
- Verifies that the
Scripts,ModelsandDocumentationfolders exist - Creates the
DataandResultsoutput folders if they're missing - Runs
Project_Parameters.mto load every project setting into theEVstructure - Exports
EV,projectRootandscriptFolderto the MATLAB base workspace
You don't need to call it directly — every script in Scripts/ does this automatically as its first line.
After opening the project, confirm the following folders are present at the project root:
Data/ Documentation/ DriveCycles/ Images/ Models/ Results/ Scripts/
Data/ and Results/ are created automatically by Initialize_Project.m on first run if they don't already exist, so it's normal for Data/ to be empty before you've run any calculation scripts.
The simplest way to run every calculation module in the correct order is:
Run_ProjectThis runs, in sequence: Battery → Motor → Transmission → Inverter → Vehicle → Vehicle Dynamics → Drive Cycle → Regenerative Braking → Performance Summary, printing a design report for each stage and reporting total execution time.
Alternatively, run individual scripts directly from Scripts/ (for example, just Battery to re-check the pack sizing) — each script can be run on its own as long as any Data/*.mat files it loads from upstream modules already exist.
Running the scripts in step 8 populates Data/ with one .mat file per module (Battery_Calculations.mat, Motor_Calculations.mat, Inverter_Calculations.mat, Transmission_Calculations.mat, Vehicle_Calculations.mat, Vehicle_Dynamics.mat, Drive_Cycle.mat, Regenerative_Braking.mat) and one plot set per module inside Results/. The Simulink model reads several of these EV.* values from the base workspace, so the calculation scripts should be run at least once per MATLAB session before simulating.
With the calculated EV structure in the base workspace, open:
Models/Smart_EV_Powertrain.slx
and press Run
Models/Smart_EV_Powertrain_Dashboard.slx
for a consolidated, gauge-style view of vehicle, battery and motor variables during the same simulation.
See the User Manual for a walkthrough of what happens at each stage and how to read the results.
Generated plots are saved automatically to Results/<Module>/ as .png files at each script run, and can be browsed directly or referenced from the Documentation pages, which embed the current set of results inline.
| Symptom | Likely Cause | Fix |
|---|---|---|
Project_Parameters.m not found error |
Scripts run without opening the .prj first |
Open Smart-EV-Powertrain-Simulator.prj, or run scripts from inside Scripts/ |
Required project folder not found error |
Project extracted with a missing subfolder, or scripts run from the wrong directory | Re-extract/re-clone the repository and open the .prj from its root |
A script errors loading a Data/*.mat file |
An upstream module hasn't been run yet in this session | Run Run_Project to execute every module in the correct order |
| Simulink model uses stale/default values | EV in the base workspace is from an old run or was cleared |
Re-run Run_Project (or the relevant scripts) before running the simulation |
| ← Previous | Index | Next → |
|---|---|---|
| Design Decisions | Documentation Home | User Manual |