Main Content

CellModelBlock

Set of conditional parameters for Cell object

Since R2022b

Description

Use CellModelBlock 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.

By default, the CellModelBlockPath property uses the Battery (Table-Based) block, but you can also use the Battery Equivalent Circuit 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.

Creation

Description

Note

To quickly create a CellModelBlock object, use the batteryCellModelBlock 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.

cellModelOpt = CellModelBlock sets default model options for the Cell object. To modify these options for your application, use dot notation.

example

Properties

expand all

Library path to a Simscape battery cell block, specified as a string. The default component model block is the Battery (Table-Based) block.

You can also use the Battery Equivalent Circuit 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.

Generated battery blocks that use a custom block as cell model block expose the same output ports of the custom block. For example, you create a custom cell block with a voltage output port:

% ...
    outputs   
        voltageCell; %voltage
    end

    equations
        voltageCell == [ParallelAssembly1(:).voltageCell]';
    end
% ...
You 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:

Conditional parameters of the cell block that you specify in the CellModelBlockPath property. These conditional parameters control the visibility of the component members of the cell block, such as parameters, variables, nodes, inputs, and outputs.

Note

This property does not include the run-time parameters of the specified cell block.

These are the conditional parameters for the default Battery (Table-Based) block:

If you specify a custom block in the CellModelBlockPath property, these fields might differ.

Example: cellModelOpt.BlockParameters.thermal_port = "model"

Since R2024a

This property is read-only.

Flag that states whether the cell block exposes at least one thermal node, returned as true or false. To change conditionally exposed thermal nodes, update the relevant properties inside the BlockParameters property.

Examples

collapse all

Create a default CellModelBlock option set.

cellModelOpt = CellModelBlock
  CellModelBlock with properties:

    CellModelBlockPath: "batt_lib/Cells/Battery↵(Table-Based)"
       BlockParameters: [1×1 struct]

Show the BlockParameters property.

cellModelOpt.BlockParameters
    struct with fields:

          T_dependence: no
          thermal_port: omit
           prm_age_OCV: OCV
      prm_age_capacity: disabled
    prm_age_resistance: disabled
      prm_age_modeling: equation
               prm_dyn: off
               prm_dir: noCurrentDirectionality
              prm_fade: disabled
              prm_leak: disabled

Specify options using dot notation.

cellModelOpt.BlockParameters.thermal_port = "model";

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

Create a default Cell object.

batteryCell = Cell
  batteryCell = 

  Cell with properties:

            Geometry: []
    CellModelOptions: [1×1 simscape.battery.builder.CellModelBlock]
                Mass: [1×1 simscape.Value]

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

batteryCell.CellModelOptions.BlockParameters
      struct with fields:

          T_dependence: no
          thermal_port: model
           prm_age_OCV: OCV
      prm_age_capacity: disabled
    prm_age_resistance: disabled
      prm_age_modeling: equation
               prm_dyn: off
               prm_dir: noCurrentDirectionality
              prm_fade: disabled
              prm_leak: disabled

Specify options using dot notation.

batteryCell.CellModelOptions.BlockParameters.thermal_port = "model";

Version History

Introduced in R2022b

expand all