Skip to content

Collection of MATLAB and Simulink resources for students, educators, and researchers interested in electric vehicles and related systems and subsystems.

License

Notifications You must be signed in to change notification settings

mathworks/EV-with-MATLAB-and-Simulink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Electric Vehicle with MATLAB and Simulink Resources

This repository is a collection of MATLAB® and Simulink® resources for students, educators, and researchers interested in electric vehicles and related systems and subsystems. Similar extended resource collections are available for complex and engineered systems such as UAV and Renewable Energy Systems.

MathWorks® provide various tools to facilitate the design and development of electric vehicles. The diagram below highlights tools for electric vehicle and automotive design. You can find the full set of MathWorks toolboxes and blocksets at the MathWorks product page. Overview of related Toolboxes and Blocksets related to design, modeling, simulation, analysis, development of elextric and hybrid vehicles

To help find related materials, the content is categorized based on their overall focus on related topics to EV design and development.

Note: Recently added items are identified with a " ⭐ (New! 20xx-xx)" at the beginning of the line.

Full System

Highlights

  • MATLAB and Simulink for Electric Vehicle Development [Content Collection] — MATLAB, Simulink, and Simscape enable engineers to model, simulate, and optimize electric vehicle systems including batteries, motors, and controllers using pre-built reference applications.
  • Upskill for the Electric Vehicle Transition [Content Collection] — A curated set of free tutorials and courses to build skills in EV system development, covering motor control, battery management, fuel cells, and simulation.
  • Battery Electric Vehicle Model in Simscape [Code/Model] — A modular and multi-fidelity BEV model for longitudinal powertrain analysis and drive cycle simulation using Simscape, suitable for performance and thermal efficiency studies.
  • Get Started with the Virtual Vehicle Composer [Doc] — A guided app for configuring, building, and testing virtual vehicles for system-level performance analysis, including fuel economy, battery SOC, and HIL testing.

Applications

Educational and Training

  • Online Courses - Automotive [Online Course] — Offers self-paced courses for automotive engineers covering Simulink fundamentals, Stateflow, and MATLAB applications for system modeling and control.
  • ChalmersX: Electric and Conventional Vehicles [Online Course] — Teaches how electric and conventional powertrains work and how to analyze their performance and energy consumption.
  • ChalmersX: Hybrid Vehicles [Online Course] — Focuses on designing hybrid powertrains by combining electric motors and combustion engines to meet modern vehicle requirements.
  • Simscape Onramp [Online Course] — A free, interactive course introducing Simscape for modeling dynamic systems across physical domains using a physical network approach.
  • Building Your Virtual Vehicle with Simulink [Content Collection] — Demonstrates how to build and simulate virtual vehicles using Simulink for use cases like thermal analysis and autonomous driving.
  • Powertrain Reference Applications [Doc, Content Collection] — Provides fully assembled models of internal combustion, hybrid, and electric powertrains for simulation, calibration, and HIL testing.

Examples and Demos

Technical Articles and Presentations

Powertrain - Electric Motor and Transmission

Highlights

  • MATLAB and Simulink for Motor Drives and Traction Motors [Content Collection] — Provides tools to model, simulate, and implement motor control algorithms for traction motors, including fault detection, autotuning, and hardware-in-the-loop testing.
  • Motor Control Design with Simulink [Content Collection] — Demonstrates how to design field-oriented control systems in Simulink, including PI controller tuning and flux weakening strategies.
  • How to Design Motor Controllers Using Simscape Electrical [Video Series] — Explains how to model BLDC motors, simulate back-EMF, and design speed controllers using Simscape Electrical.
  • What Is Field-Oriented Control? [Content Collection] — Describes the principles and implementation of field-oriented control for PMSM and BLDC motors, including transformations and modulation techniques.
  • What Is BLDC Motor Control? [Content Collection] — Covers trapezoidal and field-oriented control methods for BLDC motors, with modeling, tuning, and code generation workflows.
  • What Is Motor Modeling and Simulation? [Content Collection] — Discusses different fidelity levels of motor models for system design, control development, and traction applications.
  • Powertrain Blockset [Content Collection] — Offers preassembled reference models for gasoline, hybrid, and electric powertrains, with tools for component sizing, calibration, and HIL testing.
  • Developing Virtual Vehicles Using Powertrain Blockset [Presentation] — Shows how to build and parameterize virtual vehicle models using benchmarking data and validate them against real-world measurements.

Applications

Educational and Training

Examples and Demos

Technical Articles and Presentations

Energy - Battery

Highlights

  • MATLAB and Simulink for Battery Systems [Content Collection] — Provides tools for modeling battery cells and packs, designing battery management systems, and simulating thermal and electrical behavior under various operating conditions.
  • What Is Battery Modeling? [Content Collection] — Explains how battery models are used for characterization, SOC/SOH estimation, algorithm development, and real-time simulation, with a focus on equivalent circuit models.
  • Battery Pack Modeling [Doc, Content Collection] — Offers a workflow for designing battery packs using Simscape Battery, including cell configuration, thermal modeling, and integration with BMS and cooling systems.
  • Simscape Battery Essentials [Video Series, Content Collection] — A video series that teaches how to build, parameterize, and simulate battery modules and packs, including SOC estimation, cell balancing, and thermal analysis.
  • Battery Management System (BMS) [Technical Article] — Describes the role of BMS in monitoring, protecting, and optimizing battery performance, including SOC/SOH estimation, cell balancing, thermal management, and fault detection.

Applications, Technical Articles, and Presentations

Educational and Training

  • Simscape Battery Onramp [Online Course] — A free, self-paced course that teaches how to simulate battery packs and battery management systems using Simscape, including thermal effects and charging algorithms like CC-CV and coulomb counting.
  • Battery Systems: introduction [Course Module] — Covers battery pack design, cell modeling (electrical and thermal), and BMS fundamentals using MATLAB, Simulink, and Simscape, with interactive examples and SoC estimation techniques.
  • Battery Pack Modeling [Online Course] — Offers training on modeling battery packs using the Battery Builder app in Simscape, including cell-to-pack workflows, thermal modeling, and integration of cooling plates.
  • (New! 2025-09) Battery State Estimation [Online Course] - Model Kalman filter-based techniques to estimate battery state using Simscape Battery. Learn to parameterize and tune the Kalman filter for battery state estimation. Estimate the state of charge, state of energy, and state of health to seek optimum performance of the battery pack.
  • Developing Battery Systems with Simulink and Simscape [Technical Article] — Explains how Simulink and Simscape Battery support battery system development, from pack design and thermal management to BMS algorithm development and hardware-in-the-loop testing.

Examples and Demos

Energy - Fuel Cell

Highlights

  • (New! 2025-09) MATLAB and Simulink for Fuel Cells and Electrolyzers [Content Collection] — Efficient development of fuel cell and electrolyzer applications requires simulation models of adequate fidelity. These models enable you to perform design space exploration, analyze design tradeoffs, and help inform control systems development.
  • Fuel Cell Model [Content Collection] — Describes how fuel cells convert hydrogen and oxygen into electricity and water, and provides modeling tools for different levels of fidelity to support control system development, thermal analysis, and hardware-in-the-loop testing.
  • Hydrogen Electrolyzer [Content Collection] — Explains how hydrogen electrolyzers split water into hydrogen and oxygen using electrical energy, and offers simulation models for electrochemical reactions, thermal management, and integration into green hydrogen systems.
  • Hydrogen Fuel Cells Powering the Future [Content Collection] — Showcases industry examples of hydrogen fuel cell applications in transportation and energy systems, highlighting how Model-Based Design and AI accelerate development and reduce costs.

Applications, Technical Articles, and Presentations

Educational and Training

Examples and Demos

  • Fuel Cell Vehicle Model in Simscape [Code/Model, Video] — Simulates a fuel cell electric vehicle with a battery and cooling system using Simscape, allowing drive cycle testing and gas species tracking in the fuel cell domain.
  • Fuel Cell–Battery Driven Electric Motor & Hydrogen Transfer [Code/Model] — Models the interaction between a fuel cell and battery supplying an electric motor, including hydrogen transfer thermodynamics and cooling regulation.
  • Fuel Cell [Doc] — Provides a block-level model of a fuel cell stack with configurable fidelity, supporting simplified and detailed electrochemical modeling for simulation and control design.
  • Fuel Cell System [Doc] — Simulates a complete fuel cell system operating under stoichiometric conditions, with real-time simulation capabilities and performance logging.
  • Hydrogen Refueling Station [Doc] — Models a hydrogen refueling station with multi-stage compression, buffer storage, and cooling systems, following SAE J2601 protocols for safe and efficient hydrogen dispensing.
  • PEM Electrolysis System [Doc] — Simulates a PEM electrolyzer that splits water into hydrogen and oxygen, including thermal and gas flow modeling, pressure regulation, and dehumidification.
  • PEM Fuel Cell System [Doc] — Models a PEM fuel cell stack with detailed gas flow, thermal management, and humidification systems, supporting dynamic operation and control development.

Electronics

Highlights

  • Power Electronics Simulation [Content Collection] — Enables modeling and simulation of power converters, motor drives, and battery systems using Simulink and Simscape Electrical, supporting controller design, fault analysis, and hardware-in-the-loop testing.
  • MATLAB and Simulink for Power Conversion Control [Content Collection] — Provides tools to model and simulate power conversion systems, design digital controllers, and generate production code for embedded hardware including microcontrollers and FPGAs.
  • MATLAB and Simulink for Electronics Systems [Content Collection] — Supports design and simulation of signal processing, control systems, and embedded electronics, with capabilities for code generation, verification, and integration with hardware platforms.
  • Power Electronics Hardware-in-the-Loop (HIL) Testing [Content Collection] — Describes how to use Simulink and Speedgoat hardware for real-time HIL testing of power electronics controllers, enabling validation before physical prototyping.
  • How to Develop DC-DC Converter Control in Simulink [Video Series, Technical Article] — Demonstrates modeling and control of DC-DC converters using Simulink and Simscape Electrical, including SEPIC topology, PID tuning, efficiency mapping, and code generation for TI microcontrollers.

Applications

Educational and Training

  • Introduction to Power Electronics [Course Module] — A 14-week self-paced course covering switching components, AC-DC rectifiers, DC-DC converters, DC-AC inverters, and basic control, with video lectures, quizzes, and simulation problems.
  • Power Electronics Simulation Onramp [Online Course] — Teaches how to simulate power electronics converters in Simscape Electrical, including modeling buck converters at different fidelity levels and implementing closed-loop control.
  • DC Circuit Analysis [Course Module] — Offers interactive MATLAB live scripts and Simscape models for mesh and nodal analysis, Thevenin circuits, RL/RLC circuits, and op-amps, including virtual oscilloscope measurements.
  • Electrical Engineering Virtual Electric Machine & Power Labs [Course Module] — Provides eight virtual labs simulating three-phase systems, transformers, DC motors, synchronous machines, and generators, with lab assignments mimicking real hardware experiments.
  • Circuit Simulation Onramp [Online Course] — Introduces analog circuit simulation in Simscape, covering RC/RLC circuits, op-amps, filters, and fault protection using the physical network approach.
  • Power Systems Simulation Onramp [Online Course] — Guides users through simulating power systems by modeling a microgrid, measuring three-phase circuits, and evaluating control algorithms like droop control and MPPT.

Examples and Demos

Technical Articles and Presentations

Thermal

Highlights

  • Battery Thermal Management System [Content Collection] — Explains how to model and simulate battery thermal management systems using MATLAB and Simulink, including active, passive, and hybrid cooling strategies, thermal path modeling, and control logic for temperature regulation.
  • Battery Thermal Management System Design [Video] — Demonstrates how to model a battery thermal management system for a small EV using Simscape, diagnose control issues, and analyze energy usage under different operating conditions.
  • Examples in Heat Transfer [Content Collection, Code/Model] — A GitHub repository with MATLAB-based examples for solving canonical heat transfer problems using Symbolic Math Toolbox, PDE Toolbox, and Simscape Fluids, including conduction, convection, and transient heat flow.

Applications, Technical Articles, and Presentations

Educational and Training

  • Thermodynamics [Course Module] — Offers interactive live scripts that teach thermodynamic principles such as energy conservation, conduction, convection, and transient heat transfer using MATLAB and Simscape.
  • Battery Systems: introduction [Course Module] — Covers battery pack design, cell modeling, and battery management systems using MATLAB, Simulink, and Simscape, including SOC estimation and thermal modeling.
  • Heat Conduction Through Iron Rod [Doc] — Demonstrates how to model heat conduction and convection in a rod using Simscape thermal blocks, comparing lumped and distributed thermal mass models.
  • Heat Transfer in a Thermal Liquid Pipe [Doc] — Shows how mass flow rate, pipe geometry, and environmental conditions affect heat transfer in a thermal liquid pipe using Simscape Fluids.
  • Pressure Loss and Mass Flow Rate in a Thermal Liquid Pipe [Doc] — Explores how pipe friction and elevation changes impact pressure loss and flow rate, using Bernoulli's principle and Simscape simulation.
  • Parameterize a Simple Heat Exchanger [Doc] — Uses the NTU method to compare heat exchanger geometries and fluids, calculating effectiveness and thermal performance in Simscape Fluids.
  • EV Battery Cooling System Design [Doc] — Models a battery cooling system with cold plates, radiators, and evaporators, analyzing heat transfer and coolant behavior under different ambient conditions.
  • Simscape Battery Onramp [Online Course] — Teaches how to simulate battery packs and BMS algorithms using Simscape, including thermal effects and charging strategies.
  • Battery Pack Modeling [Doc] — Guides users through building battery packs with thermal coupling and control integration using the Battery Builder app and Simscape Battery.

Examples and Demos

Vehicle Dynamics

Highlights

  • Longitudinal Vehicle Motion: Simscape Essentials for Automotive Student Teams [Video, Code/Model] — Introduces students to vehicle modeling for competitions like Formula Student using Simscape, including a simple model of a non-driven vehicle braking while descending a slope.
  • Simscape Vehicle Templates [Code/Model, Content Collection] — Provides configurable vehicle models for simulating conventional, hybrid, electric, and fuel cell vehicles, with modular components for suspension, braking, and ADAS testing.
  • Vehicle Dynamics Blockset – Examples [Code/Model, Content Collection] — Offers preassembled vehicle dynamics models for passenger cars, trucks, and motorcycles, including propulsion, steering, suspension, and tire models, with support for Unreal Engine-based 3D simulation.

Applications, Technical Articles, and Presentations

Educational and Training

Examples and Demos

  • Model an Anti-Lock Braking System [Doc] — Simulates a single-wheel ABS system using slip-based control logic, mu-slip curves, and bang-bang control to illustrate braking dynamics and optimal friction conditions.
  • Full Vehicle on Four Post Testrig [Doc] — Models a passenger vehicle on a four-post testrig to replicate vertical wheel motion and analyze suspension response, roll, pitch, and wheel hop frequencies.
  • Swept Sine Reference Generator [Doc] — Generates swept-sine steering commands for dynamic steering response testing, useful for ride and handling analysis and chassis control development.
  • Estimate Vehicle Drag Coefficients by Coast-Down Testing [Doc] — Uses coast-down velocity data and parameter estimation to determine aerodynamic, rolling, and fixed drag coefficients based on SAE J1263 standards.
  • Generate Skidpad Test [Doc] — Simulates a skidpad test for Formula Student vehicles, including path tracking, lap time estimation, and visualization of vehicle dynamics in 3D.
  • Double Lane Change Reference Application [Doc] — Simulates ISO 3888-1/2 double lane change maneuvers to evaluate yaw stability, lateral acceleration, and obstacle avoidance performance.
  • Kinematics and Compliance Virtual Test Laboratory [Doc] — Generates suspension parameters using Simscape Multibody and Model-Based Calibration Toolbox, comparing mapped and physical suspension responses.
  • Vehicle Steering Gain at Different Speeds [Doc] — Analyzes steering gain and lateral dynamics using a slowly increasing steering maneuver based on SAE J266, with speed-dependent response evaluation.
  • Vehicle Scenarios with Unreal Engine [Doc] — Integrates Unreal Engine with Simulink for 3D simulation of vehicle scenarios, enabling virtual testing of perception, control, and planning algorithms.
  • Import RoadRunner Scene into Unreal Engine Using Simulink [Doc] — Shows how to import RoadRunner scenes into Unreal Engine for simulation, including semantic segmentation, depth data, and sensor modeling.
  • Vehicle Suspension System Templates [Doc] — Provides templates for double wishbone, MacPherson, and pushrod suspensions, allowing simulation of roll, bounce, and road profile response.
  • Configuring Dynamic Cameras - Vehicle Slalom [Doc] — Demonstrates how to configure dynamic camera views for vehicle slalom maneuvers in Simscape Multibody, enhancing visualization and analysis.
  • Suspension System Comparison [Doc] — Compares different suspension architectures under identical road profiles, analyzing vertical force, camber, and toe angle responses.

Optimization and Efficiency

Highlights

Applications, Technical Articles, and Presentations

Educational and Training

  • Common Data Analysis Techniques [Online Course] — Teaches how to explore relationships between variables, perform polynomial fitting, and apply linear correlation techniques to extract insights from datasets.
  • Optimization Onramp [Online Course] — Introduces the basics of solving constrained and unconstrained optimization problems in MATLAB, including defining variables, objective functions, and constraints.
  • Machine Learning Techniques in MATLAB [Online Course] — Covers classification and regression methods, model training, and deployment using MATLAB and Simulink, with hands-on exercises and automated feedback.
  • Battery Systems: introduction [Course Module] — Offers foundational training in battery pack design, cell modeling, and battery management systems using MATLAB, Simulink, and Simscape.
  • Design Optimization with MATLAB [Video] — Demonstrates how to use Optimization Toolbox and Global Optimization Toolbox to define and solve design optimization problems across engineering domains.
  • Mathematical Modeling with Optimization [Video Series] — Explains how to transform real-world problems into mathematical programs and solve them using linear, nonlinear, and mixed-integer optimization techniques.
  • Solving Optimization Problems with MATLAB – Master Class with Loren Shure [Video] — A comprehensive master class covering solver-based and problem-based approaches, optimization workflows, and solver selection for various problem types.
  • Linear Programming [Content Collection] — Provides resources for solving linear optimization problems using interior-point and simplex algorithms, with applications in manufacturing, finance, and energy.
  • Nonlinear Programming [Content Collection] — Covers solving nonlinear optimization problems with constraints using algorithms like SQP, trust-region, and interior-point methods.
  • Genetic Algorithm [Content Collection] — Explains how to use genetic algorithms for global optimization, including mutation, crossover, and elitism strategies for solving complex problems.
  • Surrogate Optimization [Content Collection] — Describes how to use surrogate models to approximate expensive simulations and optimize design parameters efficiently.
  • Surrogate Optimization [Video] — Demonstrates how surrogate optimization can solve complex design problems with minimal evaluations using simulation-based models.
  • Integer Programming [Content Collection] — Offers tools for solving mixed-integer linear and nonlinear problems, useful for scheduling, resource allocation, and discrete optimization.
  • How to Use the Problem-Based Optimize Live Editor Task [Video] — Shows how to interactively define and solve optimization problems using the Live Editor, including constraints, objectives, and solver selection.

Examples and Demos

  • Electric Vehicle Design with Simscape [Code/Model] — Provides a comprehensive BEV model built with Simscape libraries for range estimation, battery sizing, gear ratio selection, motor loss mapping, and thermal analysis, including neural network-based virtual sensors and inverter lifetime prediction.
  • Design and Analyze a Battery Electric Vehicle with Thermal Management [Video] — Demonstrates how to build a virtual BEV model with powertrain, driveline, and thermal subsystems to assess range and consumption under different ambient conditions and drive cycles.
  • Design and Analyze a Battery Electric Vehicle with Thermal Management [Code/Model] — Offers a GitHub repository with a Simscape-based BEV model including electric powertrain, coolant and refrigerant loops, and cabin HVAC, designed for thermal optimization and control algorithm development.
  • Calibrate ECMS Block for Objective Hybrid Vehicle Fuel Economy Assessment [Doc] — Provides a script to calibrate the ECMS weighting factor for hybrid vehicles, ensuring net-zero battery SOC change over a drive cycle and accurate fuel economy estimation.
  • Optimize Transmission Control Module Shift Schedules [Doc] — Uses the conventional vehicle reference application to optimize TCM shift maps for improved fuel economy and performance, leveraging global optimization and parallel computing.
  • Least Squares [Doc] — Offers tools for solving linear and nonlinear least-squares problems, including curve fitting, ODE parameter estimation, and problem-based optimization workflows.
  • Systems of Nonlinear Equations [Doc] — Explains how to solve multivariable nonlinear equations using MATLAB's fsolve and problem-based approaches, with support for Jacobian computation and solver customization.

Advanced Driver Assistance and Automated Driving Systems (ADAS/ADS)

Highlights

  • ADAS Learning Resources for Students [Content Collection] — Offers a curated set of tutorials, documentation, and videos for students working on ADAS and automated driving projects, covering topics like sensor fusion, path planning, perception, and scenario generation using MATLAB, Simulink, and RoadRunner.

Applications

Educational and Training

Examples and Demos

Technical Articles and Presentations

Model-Based Systems Engineering (MBSE)

Highlights

  • Model-Based Systems Engineering [Content Collection] — Provides a unified environment using MATLAB, Simulink, System Composer, and Requirements Toolbox to define system architectures, link requirements, perform trade studies, and validate designs through simulation, enabling a digital thread across the development lifecycle.

Applications, Technical Articles, and Presentations

Educational and Training

Examples and Demos

Releases

No releases published

Packages

No packages published