Extended Range Dual-Motor Electric Vehicle Model

Versione 1.0.0 (3,04 MB) da Vincent Hu
A high-performance extended range electric vehicle model with a dual-motor (EREV 2EM) architecture, developed using Powertrain Blockset™.
9 download
Aggiornato 22 ott 2025

Visualizza la licenza

Extended Range Dual-Motor Electric Vehicle Model using Powertrain Blockset™
This project presents a high-performance extended range electric vehicle model with a dual-motor (EREV 2EM) architecture, developed using Powertrain Blockset™. By leveraging a set of enhanced component models, the simulation achieves high execution speed, often running thousands of times faster than real time.
This work requires MATLAB release R2024b or newer.
Target use cases:
  • System-level design and optimization
  • System sizing and component trade studies
  • Longitudinal vehicle dynamics analysis
  • Power consumption estimation
  • Design space exploration of powertrain parameters
In this demo we show how to:
  1. Quickly parameterize an EREV 2EM model.
  2. Simulate transient drive cycles to validate the model’s accuracy against published energy consumption and range data.
  3. Explore system sizing by varying key model parameters (e.g., vehicle mass, motor specs, battery capacity).
  4. Achieve high simulation speeds, enabling use in Model-in-the-Loop (MIL), Hardware-in-the-Loop (HIL), or optimization workflows.
Table of Contents
Setup
To get started:
  1. Download and unzip the files.
  2. Open the project file LFM_EREV_2EM.prj in MATLAB.
  3. Then, open the Main.mlx live script located in the project’s root folder to begin exploring the model.
Introduction
This demo showcases an extended range dual-motor electric vehicle simulation model. The model is implemented using Powertrain Blockset and focuses on accurately defining traction forces and energy losses to estimate energy consumption and driving range, while maintaining very high simulation speed.
Model Customization
The model is designed for easy reparameterization. By changing a few key inputs (vehicle mass, motor specs, battery size, gear ratio, etc.), users can quickly simulate different EREV configurations for:
  • System-level analysis
  • System sizing and trade-offs
  • Power consumption and range studies
Simulation Model
openProject("LFM_EREV_2EM.prj");
The vehicle model includes the following key components:
1. Vehicle Body Total Road Load with Load Transfer: Implements a one-degree-of-freedom (1DOF) rigid vehicle model using coast-down testing coefficients.
  • Models the complete longitudinal road load dynamics, including aerodynamic drag, rolling resistance, road gradient, and dynamic load transfer between axles during acceleration and braking
2. Simple Wheel: Simulates the longitudinal dynamics of the wheel-tire system. Optimized for fast execution with minimal parameterization. This block supports:
  • Multiple rolling resistance modeling options
  • Ability to disable wheel slip for faster simulations
3. Open Differential Driveline: Implements a kinematic open differential. This block allows:
  • Power loss modeling via efficiency lookup tables or scalar values
  • Specifying a damping coefficient as an alternative to efficiency modeling
4. Simple Gearbox Driveline: A simplified driveline model without gear inertias and downstream couplings. Supports drivetrain loss modeling via:
  • Scalar damping coefficient
  • Efficiency lookup table
  • Scalar efficiency value
5. Datasheet Battery Model: Models battery behavior using:
  • Open-circuit voltage (OCV) as a function of state of charge (SOC)
  • Internal resistance as a function of SOC and temperature
6. Mapped Electric Motor: A system-level motor model that uses efficiency maps to represent:
  • Motor torque-speed behavior
  • Associated inverter (power electronics) efficiency
7. Kinematic Transmission: Eliminates the need to model gear inertias and associated powertrain couplings. It uses implicit gear indexing:
  • A negative gear ratio in the first element implies reverse gear
  • A gear index of 0 implies neutral
  • No need to explicitly define a gear index vector
8. SI Mapped Engine: A mapped (steady-state) spark-ignition engine model
  • Using power, air mass flow, fuel flow, exhaust temperature, efficiency, and emission performance lookup tables
9. Simple Thermal System: Regulates the temperatures of the battery, power electronics, motor, and cabin by generating heat flow rates, targetting the optimal operating set point.
  • Coefficient of Performance (COP) for the whole thermal management system is used for estimating power consumption
  • Uses a minimal set of key parameters, simplifying integration, calibration, and validation
10. Vehicle Control Unit: 2 version of controlers are implemented.
  • ECMS based VCU
  • ROM based VCU (default)
Top level of the simulation model, showing the drive cycle source, driver model, controller, and vehicle plant model:
modelName = "ConfiguredVirtualVehicleModel";
open_system(modelName);
Model Parameters
All the default parameters are stored in the VirtualVehicleTemplate.sldd file. To parameterize this model, you can either edit values directly in the VirtualVehicleTemplate.sldd file using Model Exploer, or define custom data in the ParameterList.m.
Open the ParamaeterList.m file. This file contains descriptions for each of the parameters it defines.
edit ParameterList.m;
To apply custom data in ParameterList.m, select the checkbox to enable these commands to open the top-level data dictionary, access the 'Design Data' section, import the custom data, and save the changes to the data dictionary.
if false %apply modified parameter values
myDictionaryObj = Simulink.data.dictionary.open('VirtualVehicleTemplate.sldd');
dDataSectObj = getSection(myDictionaryObj,'Design Data');
importFromFile(dDataSectObj,'ParameterList.m','existingVarsAction','overwrite');
saveChanges(myDictionaryObj);
end
Simulation
out = sim(modelName);
The results displayed using Simulation Data Inspector (SDI) tool.
Open and run the script, MotorEfficiencyPlot.mlx, to plot the front/rear motor and generator efficiency for the drive cycle test.
edit MotorEfficiencyPlot.mlx;
To evaluate simulation speed, select the checkbox to enable the functions to measure performance using the ratio of simulation time to elapsed wall time, exluding model initialization and termination phases.
if false
simSpeed = (out.SimulationMetadata.ModelInfo.StopTime - out.SimulationMetadata.ModelInfo.StartTime)/...
out.SimulationMetadata.TimingInfo.ExecutionElapsedWallTime
end
Being a very simple model, it runs very fast, almost 1400 times faster than the wall clock time (ROM based VCU) and 30 times faster than the wall clock time (ECMS based VCU) on a typical laptop. Therefore, the model can be used for either MIL or HIL testing (since it runs with a fixed-step solver), or for system sizing optimization studies.
Power consumprion analysis
open and run GenerateEnergyReport.mlx to generate the power consumption results.
edit GenerateEnergyReport.mlx;
MathWorks Products (http://www.mathworks.com)
Requires MATLAB® release R2024b.
License
The license is available in the license.txt file within this repository.
Community Support
Project status
Last update: 10/15/2025

Cita come

Vincent Hu (2025). Extended Range Dual-Motor Electric Vehicle Model (https://it.mathworks.com/matlabcentral/fileexchange/182370-extended-range-dual-motor-electric-vehicle-model), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2024b
Compatibile con R2024b e release successive
Compatibilità della piattaforma
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

ConfiguredVirtualVehicle

Scripts

Versione Pubblicato Note della release
1.0.0