Main Content

Pack

Create pack of module assemblies

Since R2022b

Description

Use Pack to create a battery pack object that represents a number of ModuleAssembly objects connected electrically in series or in parallel.

To generate a Simscape™ model of your Pack object, use the buildBattery function.

The Pack object only supports the definition of structural or design parameters. You can modify the run-time parameters for this object and for the models of its constituent module assemblies and modules after you create the model. The Pack object keeps track of its unique constituent module models and generates properties for these models instead of doing it for every model instance. You can generate a script that contains all the parameters of the Pack object by specifying the MaskParameters argument in the buildBattery function. A unique pack model is characterized by having the same properties (such as NumSeriesAssemblies and ModelResolution) and the same constituent cell properties (such as name, format, and weight).

The Pack object is the final stage of a battery pack system model in a bottom-up approach. Pack models are required for architecture evaluation in early development stages, software and hardware development, system integration and requirement evaluation, cooling system design, control strategy development hardware-in-the-loop, and many more applications.

Thermal Boundary Conditions

Thermal boundary conditions define the specific heat transfer mechanisms that occur at each interface of a cell thermal model and its surroundings. In battery systems, cells are typically thermally coupled to different heat sources and sinks, all of which have an effect on the battery cell temperature. The number and type of thermal boundary conditions for a cell model depends on the thermal and mechanical design of the battery system.

For example, you can place cells on an aluminium cooling plate to enhance heat removal and, at the same time, join them together mechanically with a potting compound that effectively eliminates or decreases the inter-cell heat exchange path. The cell temperature has a direct impact on battery performance and lifetime. Therefore, it is crucial to predict this state in dynamic simulation.

Inside a battery object, you can set up a thermal network of lumped-thermal-mass cell models to simultaneously capture the thermal paths to the ambient, the coolant, and/or the cooling plate:

These options are not mutually exclusive. For example, your battery model can combine both the coolant thermal path and the cooling thermal plates to model individual thermal resistances between the individual cells and the sections of the cooling plate.

For more information about thermal paths, see the AmbientThermalPath, CoolantThermalPath, and CoolingPlate properties.

You can also model direct cell-to-cell heat exchange. This is important when you want to simulate more detailed thermal management strategies or even thermal propagation scenarios where inter-cell heat transfer happens at faster rates than ambient or coolant rates. In the battery industry, you can link battery cells to each other through many different means. For example, you can link cylindrical cells by using potting compounds for mechanical rigidity, stability, and thermal isolation, or other types of thermal interface materials. You can also use dielectric fluids or other compounds to heat or cool down cylindrical cells, as well as forced air convection.

You can define the thermal parameters for the inter-cell heat exchange after you create the battery model. You can find these parameters from first principles calculations and more detailed 3D simulations.

These options are not mutually exclusive.

For more information about inter-cell thermal paths, see the InterCellThermalPath and InterCellRadiativeThermalPath properties.

Creation

Description

Note

To quickly create a Pack object, use the batteryPack function. By using this function, you avoid importing the namespace, using the full class name, or dealing only with name-value arguments when creating the object. (since R2024a)

To use this object, at the MATLAB® Command Window, run this command at least once each MATLAB session:

import simscape.battery.builder.*; 
All properties are exposed as name-value arguments in this object.

batteryPack = Pack creates a battery pack that comprises module assemblies with default property values.

batteryPack = Pack(Name=Value) sets Properties using one or more name-value arguments. For example, create a pack with four default module assemblies connected in series, stacked along the x-axis, and with a gap between the module assemblies equal to 0.005 m.

batteryPack = Pack(...
    ModuleAssembly=repmat(ModuleAssembly=ModuleAssembly,1,4), ...
    StackingAxis="X",...
    InterModuleAssemblyGap=simscape.Value(0.005,"m"));

You can define the number and types of module assemblies in the ModuleAssembly property. If your pack comprises many module assemblies with exactly the same property values, you can use the repmat function to specify the ModuleAssembly property. Otherwise, specify an array of distinct module assemblies.

example

Properties

expand all

Set of battery module assemblies in the battery pack, specified as a ModuleAssembly object or an array of ModuleAssembly objects. The Pack object electrically connects the module assemblies in series or in parallel according to the CircuitConnection property. If your pack comprises many module assemblies with the same property values, you can use the repmat function to specify this property. Otherwise, specify an array of distinct module assemblies.

Note

This property does not affect how the Pack object stacks the modules. Only the StackingAxis property defines the stacking strategy.

Shortest distance between module assemblies inside the battery pack, specified as a positive scalar or a simscape.Value object that represents a positive scalar with a unit of length. The value of this property must be less than 0.1 m.

If you set this property directly with a positive scalar value instead of using a simscape.Value object, this object converts the value to a simscape.Value object with meter as its physical unit.

State-of-charge cell balancing strategy for the pack, specified as "None", "Passive", or "External".

To specify and model an external cell balancing strategy, set this property to "External". The Pack (Generated Block) then exposes two electrical array-of-nodes ports, +BUS and -BUS. For desktop simulations and hardware-in-the-loop battery emulation hardware, use this option in conjunction with the Passive Balancing Interface block.

Note

Setting this property automatically propagates its value to all the subcomponent battery objects inside this Pack object. However, this change does not propagate to the other battery objects in your MATLAB workspace. If you do not set this property when you create this Pack object, then the default value is automatically propagated to all its subcomponent battery objects.

Option to use a simple thermal resistance block connected between the cells and a Simscape thermal network, specified as "CellBasedThermalResistance" or "None".

Note

Setting this property automatically propagates its value to all the subcomponent battery objects inside this Pack object. However, this change does not propagate to the other battery objects in your MATLAB workspace. If you do not set this property when you create this Pack object, then the default value is automatically propagated to all its subcomponent battery objects.

Example: batteryPack.AmbientThermalPath = "CellBasedThermalResistance"

Option to use a simple thermal resistance block connected between the cells and a Simscape thermal network, specified as "CellBasedThermalResistance" or "None". If you use a cooling plate, the object connects the thermal resistance block between the cells and the cooling plate block by using an array of thermal nodes.

Note

Setting this property automatically propagates its value to all the subcomponent battery objects inside this Pack object. However, this change does not propagate to the other battery objects in your MATLAB workspace. If you do not set this property when you create this Pack object, then the default value is automatically propagated to all its subcomponent battery objects.

Example: batteryPack.CoolantThermalPath = "CellBasedThermalResistance"

Since R2023a

Option to use a cooling plate component at a specific surface boundary, specified as "Top", "Bottom", or "None".

If you want the Battery Pack Builder to automatically add a cooling plate in your generated model, specify the path of the Cooling Plate block by using the CoolingPlateBlockPath property.

Note

Setting this property automatically propagates its value to all the subcomponent battery objects inside this Pack object. However, this change does not propagate to the other battery objects in your MATLAB workspace. If you do not set this property when you create this Pack object, then the default value is automatically propagated to all its subcomponent battery objects.

Example: batteryPack.CoolingPlate = "Top"

Since R2023a

Option to specify which cooling plate block you want to assign to the Pack object at the boundary defined by the CoolingPlate property, specified as "batt_lib/Thermal/Edge Cooling", "batt_lib/Thermal/Parallel Channels", ""batt_lib/Thermal/U-Shaped Channels"", or "None".

This figure shows the internal structure of a pack when you set the CoolingPlate property to "Bottom":

Note

Setting this property automatically propagates its value to all the subcomponent battery objects inside this Pack object. However, this change does not propagate to the other battery objects in your MATLAB workspace. If you do not set this property when you create this Pack object, then the default value is automatically propagated to all its subcomponent battery objects.

Example: batteryPack.CoolingPlateBlockPath = "batt_lib/Thermal/Edge Cooling"

Location of the battery object in a 3-D Cartesian coordinate system, specified as a vector of real and finite entries.

Example: batteryPack.Position = [0 0 0]

Name of the battery pack, specified as a string.

Example: batteryPack.Name = "ModuleAssembly2"

Type of electrical connection between module assemblies, specified as "Series or "Parallel".

Example: batteryPack.CircuitConnection = "Series"

Preferential stacking direction for the arrangement of battery cells in a 2-D Cartesian coordinate system, specified as "X" or "Y".

This figure shows the global coordinate system for batteries.

To plot the Pack object in the direction of the y-axis, set this property to "Y" before creating the BatteryChart object.

Example: batteryPack.StackingAxis = "Y"

Additional non-cell-related mass added to the pack by components such as busbars, tabs, and collector plates, specified as a strictly positive double greater than or equal to 1.

Example: batteryPack.MassFactor = 1.2

Option to use electrical resistance blocks to represent additional electrical resistances from non-cell components, specified as 'off', 'on', or as numeric or logical 1 (true) or 0 (false). A value of 'on' is equivalent to true, and 'off' is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

Example: batteryPack.NonCellResistance = 'on'

Option to use thermal resistance blocks to represent a linear cell-to-cell heat transfer path between adjacent battery cells, specified as 'off', 'on', or as numeric or logical 1 (true) or 0 (false). A value of 'on' is equivalent to true, and 'off' is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

Enabling the inter-cell thermal path is useful only when you have selected a cell thermal model and more than one cell or cell model exists inside the battery.

You can define the value for the thermal resistance parameter after model creation.

If you set this property to 'on', you cannot set the InterCellRadiativeThermalPath property to 'on'.

Note

Setting this property automatically propagates its value to all the subcomponent battery objects inside this Pack object. However, this change does not propagate to the other battery objects in your MATLAB workspace. If you do not set this property when you create this Pack object, then the default value is automatically propagated to all its subcomponent battery objects.

Example: batteryPack.InterCellThermalPath = "on"

Option to use thermal resistance blocks to represent a radiative cell-to-cell heat transfer path between adjacent battery cells, specified as 'off', 'on', or as numeric or logical 1 (true) or 0 (false). A value of 'on' is equivalent to true, and 'off' is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

Enabling the inter-cell radiative thermal path is useful only when you have selected a cell thermal model and more than one cell or cell model exists inside the battery.

You can define the value for the radiation heat transfer parameters after model creation.

If you set this property to 'on', you cannot set the InterCellThermalPath property to 'on'.

Note

Setting this property automatically propagates its value to all the subcomponent battery objects inside this Pack object. However, this change does not propagate to the other battery objects in your MATLAB workspace. If you do not set this property when you create this Pack object, then the default value is automatically propagated to all its subcomponent battery objects.

Example: batteryPack.InterCellRadiativeThermalPath = "on"

This property is read-only.

Volume of the battery, returned as a simscape.Value object with a unit of volume.

This property is read-only.

Cumulative mass of the battery, returned as a simscape.Value object with a unit of mass.

Since R2023a

This property is read-only.

Cumulative cell capacity of the battery, returned as a simscape.Value object with unit of current multiplied by time.

The value of this property is equal to the individual cell capacity multiplied by the number of cells electrically connected in parallel inside this battery object.

Since R2023a

This property is read-only.

Cumulative cell energy of the battery, returned as a simscape.Value object with unit of energy.

The value of this property is equal to the individual cell energy multiplied by the total number of cells inside this battery object.

This property is read-only.

Number of cell model blocks in simulation, returned as a double.

This property is read-only.

Numbering for all of the cells inside of the battery, returned as a structure.

This property is read-only.

Vectorized thermal node information for external boundary conditions, returned as a structure. This information comprise XY location, XY dimensions, and number of thermal nodes. If you do not define a battery cell geometry, this property is an empty structure.

This property is read-only.

Type of battery, returned as "Pack".

Examples

collapse all

Create a Cell object with a cylindrical geometry.

batteryCell = Cell(Geometry=CylindricalGeometry)

Create a ParallelAssembly object of three parallel cells with the default topology.

pSet = ParallelAssembly(Cell=batteryCell,NumParallelCells=3)

Use this ParallelAssembly object to create a Module object of 10 parallel assemblies connected in series and stack them along the x-axis.

batteryModule = Module(ParallelAssembly=pSet,NumSeriesAssemblies=10,StackingAxis="X")

Use the Module object to create a ModuleAssembly object of four identical modules connected in series.

batteryModuleAssembly = ModuleAssembly(Module=repmat(batteryModule,1,4))

Use the ModuleAssembly object to create a Pack object of two identical module assemblies connected in series.

batteryPack = Pack(ModuleAssembly=repmat(batteryModuleAssembly,1,2))

Visualize the pack by using a BatteryChart object.

packChart = BatteryChart(Battery=batteryPack);

To define the cell balancing strategy for a pack, follow the steps in Create Cylindrical Cell Pack with Two Series Module Assemblies to create a pack.

Set a common cell balancing strategy.

batteryPack.BalancingStrategy = "Passive"

To maintain consistency between the BalancingStrategy properties of the pack and all of its underlying components, setting the pack balancing strategy automatically modifies all the BalancingStrategy property in each of the underlying module components of the pack.

disp(batteryPack.ModuleAssembly(1).Module(1).BalancingStrategy);
disp(batteryPack.ModuleAssembly(2).Module(1).BalancingStrategy);
Passive
Passive

Version History

Introduced in R2022b

expand all