Skip to main content
emobility.academy
M.TechVehicle dynamicsAdvanced About 8 weeksMATLAB & Simulink

Virtual Range and Performance Testing with the Vehicle Dynamics Blockset

Build a virtual EV test bench from the Powertrain Blockset electric-vehicle reference application and Vehicle Dynamics Blockset components, then run range, acceleration and gradeability tests on IDC, MIDC, WLTP and a hill route. Compare with a simple longitudinal model.

Tools: Vehicle Dynamics Blockset · Powertrain Blockset

Virtual Range and Performance Testing with the Vehicle Dynamics Blockset: Electric scooter in the DIYguru EV lab during a training session
Representative photo from DIYguru's EV lab, not of this specific project.

The problem

OEMs and suppliers use virtual test benches to estimate range and performance before prototypes exist and to compare design variants quickly. MathWorks provides reference applications for this, but students must understand how to parameterise them, what each subsystem assumes and how their results differ from simple calculations. This project builds that understanding through structured virtual tests.

Objectives

  • Set up and parameterise the Powertrain Blockset electric-vehicle reference application for an example vehicle.
  • Integrate Vehicle Dynamics Blockset components where needed for grade and tyre effects.
  • Run range, acceleration, top-speed and gradeability tests on standard and Indian drive cycles.
  • Compare results with a simple longitudinal model and explain the differences.
  • Study design variants such as battery size, gear ratio and vehicle mass.

What you need

Tools and toolboxes

  • Powertrain Blockset — Electric-vehicle reference application with drive cycle source, longitudinal driver, mapped motor, battery and controller subsystems.
  • Vehicle Dynamics Blockset — Vehicle body and tyre components and road grade inputs for higher-fidelity longitudinal and grade tests.
  • Simulink — Model integration, scenario configuration and data logging with the Simulation Data Inspector.
  • MATLAB — Parameter scripts, drive-cycle import, batch runs and test-report generation.

Software

  • MATLAB R2023b or later
  • Simulink
  • Powertrain Blockset
  • Vehicle Dynamics Blockset
  • Excel/CSV for IDC, MIDC and route elevation data

Extra parts and data

None beyond the software above.

Key concepts

Reference application
A ready-made, configurable model of a complete vehicle shipped with the blockset. It speeds up work but must be re-parameterised for the target vehicle.
Mapped motor
A motor model defined by torque limits and an efficiency or loss map against speed and torque, rather than by electrical equations.
Gradeability
The steepest grade the vehicle can climb at a given speed, limited by motor torque, gear ratio and wheel radius, or by tyre grip.
Model fidelity
How much physical detail a model includes. Higher fidelity costs more parameters and time and is worth it only where it changes the answer.

Step-by-step guide

  1. 1

    Define the vehicle and test plan

    Choose an example compact EV with stated mass, frontal area, drag coefficient, rolling resistance, wheel radius, gear ratio, motor peak torque and power, and battery energy. Define tests: range on IDC, MIDC and WLTP; 0–100 km/h acceleration; top speed; gradeability at stated speeds; and a hill route with an elevation profile. Write the outputs and pass targets as example requirements.

    Checkpoint: A test plan with each test's procedure and outputs and a parameter script for the vehicle.

  2. 2

    Set up the reference application

    Create the electric-vehicle reference application project from Powertrain Blockset. Explore its subsystems: drive cycle source, driver, controller, motor, battery and vehicle. Replace the default parameters with the example vehicle's values and record every change. Import IDC and MIDC as custom drive cycles in the drive cycle source block. Keep a copy of the unmodified reference application so changes can be compared. Use a parameter script rather than editing block dialogs directly, so every value is documented and variants can be scripted later.

    Checkpoint: The model runs WLTP with the new parameters and the speed trace is followed within the driver's tolerance.

  3. 3

    Check the motor and battery models

    Check the mapped motor's torque envelope and efficiency map against your example data, and plot them. Check the battery model's capacity, voltage range and internal resistance. Run a constant-power discharge and compare energy delivered with the nominal battery energy. Look closely at the efficiency map at low speed and low torque, where urban cycles spend much of their time, since this region strongly affects range. Record any assumptions the reference application makes, such as constant temperature or ideal inverter behaviour, so they can be listed as limitations.

    Checkpoint: Motor torque envelope matches the example data and battery energy delivered is close to nominal.

  4. 4

    Add grade and tyre effects

    Add a road grade input from distance-based elevation data, and where needed replace the vehicle body with a Vehicle Dynamics Blockset longitudinal body and tyre models that include slip. Check that a constant grade adds the expected m·g·sinθ force by comparing steady-speed power with a hand calculation. Use distance-based elevation so grade is correct regardless of speed. Check that tyre slip remains small in normal driving, which confirms the tyre model is not distorting energy results.

    Checkpoint: Steady-speed power on a constant grade matches the road-load calculation within a few per cent.

  5. 5

    Run range tests

    Run each drive cycle repeatedly from full to a chosen minimum SOC using a script that loops until the stop condition. Record range, Wh/km, regenerated energy and motor and battery losses. Compare consumption across cycles and explain differences in terms of speed, acceleration and regeneration. Use the same initial SOC and stop condition for every cycle. Record auxiliary load assumptions, such as a fixed value for lights and electronics, and keep them constant so differences come from the cycle alone.

    Checkpoint: Range and Wh/km for each cycle, with energy flow totals that balance.

  6. 6

    Run performance tests

    Run full-throttle acceleration from standstill and record 0–50 and 0–100 km/h times and top speed. Run gradeability tests by finding the steepest grade the vehicle can hold at fixed speeds. Check whether results are motor-limited or grip-limited. Script the gradeability search with a bisection loop over grade using sim(). Compare acceleration times with a hand calculation from peak torque, gear ratio and mass, and compare top speed with the point where available power equals road-load power. Explain any difference.

    Checkpoint: Acceleration times, top speed and gradeability values that agree with simple torque and power calculations.

  7. 7

    Compare with a simple model

    Build or reuse a simple longitudinal model with constant drivetrain efficiency and run the same cycles. Compare range and performance. Identify where the high-fidelity model differs most, such as at low speed where motor efficiency drops or during regeneration limits, and explain why. Use the same vehicle parameters in both models, and choose the simple model's constant efficiency from a stated assumption, such as an average from the high-fidelity run. Present differences as percentages for each test.

    Checkpoint: A comparison table with explained differences between simple and high-fidelity results.

  8. 8

    Design-variant study

    Script batch runs for variants: battery energy ±20 per cent, gear ratio ±15 per cent and mass increased for a loaded case. Record range, acceleration and gradeability. Present trade-offs, such as a longer gear improving top speed but reducing gradeability. Use Simulink.SimulationInput arrays to define variants and run them with parsim if Parallel Computing Toolbox is available. Present the results in a table and as trade-off plots, and identify which parameter has the largest effect on each output.

    Checkpoint: Variant results tables and trade-off plots for each design parameter.

  9. 9

    Report

    Present the test plan, model set-up, verification checks, test results, comparison with the simple model and variant study. Document every parameter change from the reference application defaults so the work is reproducible. State the limitations: generic maps, no thermal effects unless added and idealised driver. Include the test plan, verification checks and a table summarising all results. Add a section listing reference-application assumptions and their likely effect on results.

    Checkpoint: A report structured like a vehicle test report, with reproducible scripts.

Testing & validation

  • Drive-cycle tracking within driver tolerance.
  • Motor envelope and battery energy checks.
  • Grade force against hand calculation.
  • Energy balance across range tests.
  • Simple versus high-fidelity model comparison.

Expected results

A parameterised virtual EV test bench producing range, acceleration and gradeability results on standard and Indian cycles, with a clear account of where model fidelity changes the answer.

Research angle for your M.Tech thesis

Research questions: which modelling details change EV range and performance predictions meaningfully on Indian drive cycles compared with standard cycles, and what is the minimum fidelity needed for early design decisions? Metrics: range, Wh/km, acceleration time and gradeability error relative to the highest-fidelity model, and model run time. Baselines: a constant-efficiency longitudinal model. A structured fidelity study with reproducible models, especially one that includes Indian cycles and hill routes, is suitable for a conference paper or a thesis chapter on virtual testing.

Take it further

  • Add battery and motor thermal models to study range at high ambient.
  • Add cabin HVAC load from a separate thermal model.
  • Automate the test suite with Simulink Test and generate reports.
  • Calibrate the model against measured data from a real vehicle if available.

Viva and review questions

Why re-parameterise the reference application rather than use defaults?

The defaults represent a generic vehicle, so results would not apply to your design; every subsystem must match the target vehicle's data.

Why is range lower on MIDC than on IDC for the same vehicle?

MIDC includes higher speeds, where aerodynamic drag grows with the square of speed, so energy per kilometre rises; the exact difference depends on the vehicle.

How do you tell whether gradeability is motor-limited or grip-limited?

Compare the tractive force from motor torque with the friction limit μ times driven-axle load; whichever is lower sets the limit.

Learn it at DIYguru

These DIYguru courses and programmes teach what this project needs.

Related EV projects

All 100 MATLAB & Simulink EV projects