主要内容

batteryCellModelBlock

Set of conditional parameters for Cell object

Since R2024a

Description

Use the batteryCellModelBlock function to construct the CellModelOptions property of a Cell object. This property contains the conditional parameters of the block that you specify in the CellModelBlockPath property. For more information about the CellModelBlock object and its properties, see CellModelBlock (object).

By default, the CellModelBlockPath property uses the Battery Equivalent Circuit block, but you can also use the Battery (Table-Based) block or specify your own custom block. For more information, see the CellModelBlockPath property.

Note

A generated battery block always uses the default values of the parameters in the battery cell blocks that you specify in the CellModelBlockPath property of your battery object, regardless of how you modified them. The only parameters of the cell block that you can modify are the conditional parameters listed in the BlockParameters property.

cellModelOpt = batteryCellModelBlock sets default model options for the Cell object. To modify these options for your application, use dot notation. For a full list of options, see the Properties of the cellModelBlock object.

example

cellModelOpt = batteryCellModelBlock(CellModelBlockPath) sets the library path of the component model block of the Cell object to a Simscape battery cell block. By default, the CellModelBlockPath property uses the Battery Equivalent Circuit block, but you can also use the Battery (Table-Based) block or specify your own custom block.

Examples

collapse all

Create a default CellModelBlock option set.

cellModelOpt = batteryCellModelBlock
  CellModelBlock with properties:

    CellModelBlockPath: "batt_lib/Cells/Battery Equivalent Circuit"
       BlockParameters: [1×1 struct]

Show all properties

Show the BlockParameters property.

cellModelOpt.BlockParameters
struct with fields:
        CurrentDependence: Disabled
    SelfDischargeResistor: Disabled
                  RCPairs: noDynamics
       CyclingAgingMethod: disabled
    CalendarAgeResistance: Disabled
      CalendarAgeCapacity: Disabled
             ThermalModel: ConstantTemperature
          HysteresisModel: none
      ReversibleHeatModel: Disabled
      CalendarAgingMethod: equation
          StorageVariable: OCV

Specify options using dot notation.

cellModelOpt.BlockParameters.ThermalModel = "LumpedThermalMass";

Any property values you do not specify retain their default values.

Create a default Cell object.

cell = batteryCell
  cell = 

    Cell with properties:

            Geometry: "None"
    CellModelOptions: [1×1 simscape.battery.builder.CellModelBlock]
                Mass: 0.1000 (kg)
            Capacity: 5 (A*hr)
              Energy: 50 (W*hr)

Show all properties

Show the BlockParameters property of the CellModelOptions object inside the Cell object.

cell.CellModelOptions.BlockParameters
   struct with fields:
        
    CurrentDependence: Disabled
    SelfDischargeResistor: Disabled
                  RCPairs: noDynamics
       CyclingAgingMethod: disabled
    CalendarAgeResistance: Disabled
      CalendarAgeCapacity: Disabled
             ThermalModel: ConstantTemperature
          HysteresisModel: none
      ReversibleHeatModel: Disabled
      CalendarAgingMethod: equation
          StorageVariable: OCV

Specify options using dot notation.

cell.CellModelOptions.BlockParameters.ThermalModel = "LumpedThermalMass";

Input Arguments

collapse all

Library path to a Simscape battery cell block, specified as a string. The default component model block is the Battery Equivalent Circuit block.

You can also use the Battery (Table-Based) or specify your own custom cell block, as long as your custom block meets all of these requirements:

  • The custom block must provide exactly two electrical conserving ports named n and p.

  • All variables must be scalar-valued.

  • The custom block cannot contain a variable or intermediate variable called power_dissipated.

You can connect the custom block to any number of thermal nodes. The software connects all nodes in parallel.

If you specify your own custom block, the fields of the BlockParameters structure depend on the parameters that you specified inside your custom block. To modify these options for your application, use dot notation.

For more information on how to build a battery model from a custom cell component, see the Build Battery Model from Custom Cell Component example. (since R2026a)

Input and Output Ports of Custom Blocks

Generated battery blocks that use a custom block as cell model block expose the same input ports (since R2026a) and output ports (since R2024b) of the custom block. Inputs and outputs are concatenated horizontally and they are physical signals for Parallel Assembly and Module generated blocks and Simulink® signals for Module Assembly and Pack generated blocks.

Note

Generated battery blocks do not expose untyped inputs. For more information about component inputs, see inputs.

For example, create a custom cell block with a voltage output port:

% ...
    outputs   
        voltageCell; %voltage
    end

    equations
        voltageCell == [ParallelAssembly1(:).voltageCell]';
    end
% ...
Use this custom cell block to create the Cell, ParallelAssembly, Module, and ModuleAssembly objects and generate the ModuleAssembly block by using the buildBattery function. Then, the generated ModuleAssembly block exposes the voltage port:

A block diagram showing a battery module called “Module1”. The module outputs a signal called “voltage”.

Version History

Introduced in R2024a

expand all