Main Content

Battery Modeling Workflow

Simscape™ Battery™ includes MATLAB® objects and functions to automate the creation of Simscape battery models. Use these objects and functions to define your own battery design specifications, visualize your battery in a 3-D space, customize the modeling resolution during simulation, and generate a Simulink® library that contains your custom generated battery blocks. You can use these blocks to assist with virtual battery design and verification, help develop battery control algorithms using Simulink software, explore design sensitivities, and design thermal management strategies.

You can develop and test battery control strategies by simulating your custom battery blocks with the blocks in the Battery Management System (BMS) library of Simscape Battery. You can also thermally couple your custom battery models in Simulink with the blocks in the Thermal Management System library. Alternatively, you can define your own custom battery control and cooling system blocks.

By using the battery objects in Simscape Battery, you can specify several electro-thermal features that you want to model in your battery simulation. For example, you can:

  • Add a cell-balancing circuit to every parallel assembly or cell for BMS control.

  • Add custom thermal boundary conditions, such as thermal resistors, that represent ambient heat dissipation paths.

  • Enable battery aging models in the cell-level model block.

All battery models are scaled up from a single cell model block, which by default is defined as the Battery (Table-Based) block.

You can customize the model resolution before model creation to suit the model requirements of your specific engineering problem. A larger number of equivalent circuit models of a battery provides a higher resolution. By default, the model resolution is Lumped, which is the lowest resolution and provides the best simulation speed and compilation time. This resolution indicates that only one “scaled-up” equivalent circuit model represents your system. If you increase the model resolution to Grouped, you can customize the number of electrical and thermal models required to answer your specific engineering question while increasing simulation speed. If you require a very detailed battery model, you can choose to simulate every single cell inside your battery electrically and thermally. This level of resolution comes at a great performance cost. To support real-time simulations, keep the number of equivalent circuit models equal to or less than 30. All custom Simscape Battery models support the Simscape scalable compilation feature.

To create your own battery model, follow these steps:

Define Battery Design

Create a Simscape Battery object in your MATLAB workspace and specify its properties. These are the battery objects you can create:

You can also create these objects without any inputs and define them with the required level of detail. You can create the battery models with or without defining the geometrical characteristics of the battery cells and the battery topology. High-level models without consideration of geometry are normally used as value models early in the design stages of a prototype pack to evaluate key performance indicators. Battery mass and packaging volume are dependent properties that you can obtain by querying the Mass and PackagingVolume properties of the battery object. To determine the energy and capacity of your battery pack, you must simulate your battery model first.

You can access the MATLAB objects of Simscape Battery from the MATLAB Command Window.

Visualize Battery

The BatteryChart object provides a custom battery visualization function to verify the hardware specifications of your battery, such as the cell dimensions, inter-cell spacing, inter-module spacing, number of cells, selected parallel assembly topology, and many more. Geometry and cell layout are required properties to perform more detailed thermal modelling with thermal management system blocks, like the coupling of a battery module block with one of the cooling plates blocks provided in the Thermal library of Simscape Battery.

Define Model Resolution

Set a suitable model resolution or simulation strategy by specifying the ModelResolution property in the ParallelAssembly and Module levels. When you specify the resolution of your battery model, you must consider the trade-off between model resolution and model speed. To obtain optimal performance, keep the number of models to lower than or equal to 30. You can simulate specific regions or areas of your battery by using a grouped model resolution and by specifying the SeriesGrouping and ParallelGrouping properties. With this flexible approach, you can simulate specific subcomponents of your battery that exhibit the hottest and coldest temperatures, or the highest and lowest state of charge. You must capture these spreads to correctly test and develop the battery control strategy.

Build Battery Model

Use the buildBattery function to create a custom battery model from the ParallelAssembly, Module, ModuleAssembly, and Pack objects. This function creates one or two libraries in your current working directory that contain the necessary subsystems and variables you need to simulate the battery. The buildBattery function creates one library for the Simscape-level battery blocks of the object hierarchy (ParallelAssembly and Module), and another library for the Simulink-level battery subsystems, ModuleAssembly and Pack.