Battery Modeling Workflow
Simscape™ Battery™ includes MATLAB® objects, functions, apps, and a library of dynamic battery cell models that facilitate and automate the creation of parameterized and simulation-ready Simscape models. Use these tools to automate several processes in the battery model-based-design workflow, such as:
Estimate battery cell model parameters.
Define your own battery design specifications.
Visualize your battery in a 3-D space.
Customize the model resolution during simulation.
Generate a Simulink® library that contains your custom dynamic battery model blocks. You can use these blocks to assist with virtual battery design and verification, develop and test battery management system control algorithms, explore design sensitivities, and design thermal management strategies.
You can estimate battery cell model parameters by using the parameter
estimation functions and methods, such as fitECM
and
fitEISModel
.
You can develop and test battery control strategies by simulating your custom battery blocks
with the blocks in the Battery Management System (BMS)
library, such as SOC Estimator (Kalman
Filter) and Battery CC-CV.
You can also thermally couple your custom battery models in Simulink with the blocks in the
Thermal Management System library, such as
Parallel
Channels. Alternatively, you can define your own custom battery control
and cooling system blocks.
This figure shows a typical battery modeling workflow. You model batteries as part of battery systems engineering or for virtual design and verification. This is an iterative process, repeated at many different stages of your product life cycle or for different battery products and applications.
A typical battery modeling workflow comprises five cyclical steps:
Define model requirements — Define simulation outputs, accuracy targets, battery system size, and system components. At this stage, you also select the type of battery model, such as an equivalent circuit model (ECM) or an electrochemical model.
Define load profile — Define use cases or load profiles, agree on pass and fail criteria, specify the initial battery states, such as the state of charge, and the environmental and thermal boundary conditions.
Battery parameter estimation — Collect data from battery cells and systems and estimate their parameters using different techniques, including hybrid pulse power characterization (HPPC), electrochemical impedance spectroscopy (EIS), galvanostatic intermittent titration technique (GITT).
Create battery model — Define battery design, architecture, and model resolution, generate dynamic models, and link model blocks and subsystems to parameters.
Simulate and validate — Verify and validate models, run simulations, and visualize results.
This figure shows how Simscape Battery facilitates these features of the battery modeling workflow. You can select different battery model types, such as equivalent circuit or electrochemical models, parameterize battery cell models from test data such as HPPC and EIS, scale up models from the cell level to the system level, and run simulations in Simscape.
Estimate Battery Parameters
By using the battery parameter estimation functions in Simscape Battery, you can process battery test data, estimate parameters for battery equivalent circuit models, and automatically parameterize battery cell blocks.
Alternatively, you can store your parameter tables as variables and use them as part
of larger battery system-level simulations. Generate the battery model and a script with
all the required variables required for simulation by using the buildBattery
function. Then, link these variables to the values of the
parameter tables inside the ECM
object
that you obtain by using the fitECM
function. This
ECM
object represents an equivalent circuit model with the
estimated parameters according to your requirements.
This figure shows the steps of the parameter estimation process in Simscape Battery:
For more information about battery parameter estimation, see Hybrid Pulse Power Characterization (HPPC) Parameter Estimation and Electrochemical Impedance Spectroscopy (EIS) Parameter Estimation. For an example on how to estimate model parameters from HPPC data, see Estimate Battery Model Parameters from HPPC Data.
Create Battery Models
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 the desired thermal effects, such as the inter-cell heat transfer, cooling plates, thermal resistors that represent ambient heat dissipation paths, and more.
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. Alternatively, you can also select other blocks such as the Battery Equivalent Circuit and Battery Single Particle blocks, or even define your own custom battery cell as long as it meets specific requirements.
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:
This workflow applies whether you are creating your battery model at the MATLAB Command Window or by using the Battery Builder app.
Define Battery Design
Create a Simscape Battery object and specify its properties. These are the battery objects you can create:
You can create these objects either at the MATLAB Command Window or by using the Battery Builder app. The Battery Builder app allows you to interactively create, modify, visualize, and build your MATLAB battery objects.
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. Use the
CumulativeCellCapacity
and
CumulativeCellEnergy
properties to understand how the
cell-level capacity and energy values scale up at system level without considering
non-cell component losses or other operating conditions. To determine the actual
delivered energy and capacity of your battery pack, you must simulate your battery
model first.
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.
Inside the Battery Builder app, the Selected Battery panel automatically displays a 3-D plot of the selected object. You can edit multiple properties of the plot under the Battery Chart tab, such as axes labels, axes direction, title of the plot, and lights. You can also check the current simulation strategy and model resolution of the selected battery object.
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.
Note
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.
To build the battery model in the Battery Builder app, under the Battery Builder tab, in the Library section of the toolstrip, select Create Library.
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
. If you also specify the
MaskParameters
and MaskInitialTargets
name-value arguments, the buildBattery
function generates a
parameterization script that helps you managing the run-time parameters of the
different modules and parallel assemblies inside the pack.
Visualize Simulation Results
After you run a battery simulation using Simscape Battery generated blocks, use a
BatterySimulationChart
object to construct a dynamic version of
the batteryChart
object. Use this dynamic version of the
battery chart to visualize the time-series data of a dynamic variable that you store
inside a BatterySimulationLog
object. This dynamic variable can be any variable
stored within the BatterySimulationLog
object from a Simscape-based
simulation, such as the temperature, state of charge, and current.
See Also
Apps
Objects
Cell
|ParallelAssembly
|Module
|ModuleAssembly
|Pack
Functions
buildBattery
|ecm
|hppcTest
|hppcTestSuite
|eisModel
|eisTest
|fitECM
|fitEISModel