Build Model of Battery Module with Inter-Cell Heat Exchange
This example shows how to create and build a Simscape™ system model of a battery module with inter-cell heat exchange in Simscape™ Battery™. Inter-cell heat transfer mechanisms are relevant in the design of battery systems, including analyzing battery thermal propagation and evaluating electro-thermal load cycles in virtual verification. The heat transfer mechanisms supported in Simscape™ Battery™ are conduction, convection, and radiation. To create the system model of a battery module, you must first create the Cell
and ParallelAssembly
objects that comprise the battery module, and then use the buildBattery
function. The buildBattery
function generates Simscape models for these Simscape Battery objects:
This function creates a library in your working folder that contains a system model block of a battery module. Use this model as reference in your simulations. You can modify the run-time parameters for this model block, such as the battery cell resistance or the battery open-circuit voltage, after you create the model. To define the run-time parameters, specify them in the block mask of the generated Simscape models or use the MaskParameters
argument of the buildBattery
function.
Create Battery Module
Object in MATLAB
To create a battery module object, you must first design and create the foundational elements of the battery module.
This figure shows the hierarchy of a battery pack object in a bottom-up view:
A battery module comprises multiple parallel assemblies. These parallel assemblies, in turn, comprise a number of battery cells connected electrically in parallel under a specific topological configuration or geometrical arrangement.
Create Cell
Object
To create the Module
object, first create a Cell
object with the cylindrical geometry.
The CylindricalGeometry
object defines the cylindrical geometrical arrangement of the battery cell. To create the CylindricalGeometry
object, use the batteryCylindricalGeometry
function. Specify the cell height as the first argument and the cell radius as the second argument.
cylindricalGeometry = batteryCylindricalGeometry(simscape.Value(0.07,"m"),... simscape.Value(0.0105,"m"));
For more information on the possible geometrical arrangements of a battery cell, see the PouchGeometry
and PrismaticGeometry
documentation pages.
Now use this CylindricalGeometry
object to create a cylindrical battery cell.
cylindricalCell = batteryCell(cylindricalGeometry)
cylindricalCell = Cell with properties: Geometry: [1×1 simscape.battery.builder.CylindricalGeometry] CellModelOptions: [1×1 simscape.battery.builder.CellModelBlock] Mass: 0.1000 (kg) Capacity: 5 (A*hr) Energy: 50 (W*hr) Show all properties
The Cell
object allows you to simulate the thermal effects of the battery cell by using a simple 1-D model. To simulate the thermal effects of the battery cell, in the BlockParameters
property of the CellModelOptions
property of the Cell
object, set the thermal_port
property to "model"
.
cylindricalCell.CellModelOptions.BlockParameters.thermal_port = "model";
Create ParallelAssembly
Object
A battery parallel assembly comprises multiple battery cells connected electrically in parallel under a specific topological configuration or geometrical arrangement. In this example, you create a parallel assembly of three cylindrical cells stacked in a square topology over three rows.
To create the ParallelAssembly
object, use the batteryParallelAssembly
function. Define the Cell
object as the first argument and the number of cells in parallel as the second argument. To specify the additional properties, use the name-value arguments StackingAxis
and Topology
.
parallelAssembly = batteryParallelAssembly(cylindricalCell,3,... StackingAxis="X", ... Topology="Square");
Create Module
Object
You now have all the foundational elements to create your battery module. A battery module comprises multiple parallel assemblies connected in series. In this example, you create a battery module of six parallel assemblies. You also define the model resolution of the module.
To create the Module
object, use the batteryModule
function. Define the ParallelAssembly
object as the first argument and the number of parallel assemblies in series as the second argument. To specify the additional properties, use the name-value arguments InterParallelAssemblyGap
and ModelResolution
.
module = batteryModule(parallelAssembly,6,... InterParallelAssemblyGap=simscape.Value(2e-3,'m'),... ModelResolution="Detailed");
Enable Inter-Cell Thermal Path
To enable cell-to-cell heat conduction paths, set the InterCellThermalPath
property of the batteryModule
object to "on"
. The battery cell model block must enable a valid thermal model with at least one thermal domain port.
module.InterCellThermalPath = "on";
The Module
and ParallelAssembly
objects simulate thermal interactions between adjacent battery cells by creating a thermal domain network. In this thermal domain network, the thermal model of every battery cell is inter-connected to each of their neighbors. Enabling the InterCellThermalPath
property thermally connects adjacent cells by using a Simscape™ thermal resistance block. You can set the Thermal resistance parameter after you build the Simscape™ battery block. You can set a different value for every thermal connection between two adjacent cells.
View Information on Inter-Cell Thermal Path Connectivity
To view the total number of inter-cell thermal connections inside the Module
object, use the NumInterCellThermalConnections
property. This property is the sum of all inter-cell thermal connections inside every parallel assembly in the module.
disp(module.NumInterCellThermalConnections)
12
To view the number of thermal connections between adjacent ParallelAssemblies
objects, use the NumInterParallelAssemblyThermalConnections
property.
disp(module.NumInterParallelAssemblyThermalConnections)
35
To visualize the cell-to-cell thermal connections, use the InterCellConnectionsMapping
property. The InterCellConnectionsMapping
is a 2-D matrix that shows the connections between adjacent battery cell models. For each column, the first row of the InterCellConnectionsMapping
property shows the cell index in a specific parallel assembly from which the thermal connection originates from. The second row contains the index of the corresponding destination cell. This thermal connection is bidirectional as with all thermal domain connections in Simscape™. For a Module
object, the indexes are based only on the number of cells connected in parallel in the parallel assembly.
disp(module.InterCellConnectionsMapping)
1 2 1 2 1 2 1 2 1 2 1 2 2 3 2 3 2 3 2 3 2 3 2 3
To visualize the parallelAssembly-to-parallelAssembly thermal connections, use the InterParallelAssemblyConnectionsMapping
property. The InterParallelAssemblyConnectionsMapping
is a 2-D matrix that shows the connections between adjacent battery cell models from adjacent parallel assemblies inside the module. For each column, the first row of the InterParallelAssemblyConnectionsMapping
shows the ParallelAssembly
index inside the Module
from which the thermal connection originates from. The second row contains the index of the corresponding destination ParallelAssembly
.
disp(module.InterParallelAssemblyConnectionsMapping)
1 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 3 4 4 4 4 4 4 4 5 5 5 5 5 5 5 2 2 2 2 2 2 2 3 3 3 3 3 3 3 4 4 4 4 4 4 4 5 5 5 5 5 5 5 6 6 6 6 6 6 6
The battery builder in Simscape Battery also supports radiation heat exchange between cells. Enabling the InterCellRadiativeThermalPath
property thermally connects adjacent cell models by using a Simscape™ radiation block. This figure shows a comparison between the two methods:
Visualize Battery Module and Check Model Resolution
To obtain the number of Simscape Battery(Table-based) blocks used for the module simulation, use the NumModels
property of your Module
object.
disp(module.NumModels)
18
To visualize the battery module before you build the system model and to view its model resolution, create the figure where you want to visualize your module and then use the batteryChart
function. To view the model resolution of the module, specify the SimulationStrategyVisible
name-value argument as "On"
.
f = figure(Color="w"); tl = tiledlayout(1,2,"Parent",f,"TileSpacing","Compact"); nexttile(tl) moduleChart1 = batteryChart(tl,module); nexttile(tl) moduleChart2 = batteryChart(tl,module,SimulationStrategyVisible="On");
Build Simscape Model of Module
Object
After you create your battery objects, you need to convert them into Simscape models to use them in block diagrams. You can then use these models as reference for your system integration and requirement evaluation, cooling system design, control strategy development, hardware-in-the-loop, and many more applications.
To create a library that contains the Simscape Battery model of the Module
object, use the buildBattery
function.
buildBattery(module,LibraryName="interCellHeatExchangeModule");
This function creates a library named interCellHeatExchangeModule_lib
in your working folder. Open this model to access your battery objects as Simscape blocks.