Main Content

modifyParallelAssembly

Modify properties of parallel assemblies

Since R2023b

Description

example

updatedBattery = modifyParallelAssembly(battery,Name=Value) modifies one or more properties of the underlying ParallelAssembly objects inside the battery object battery by using one or more name-value arguments. To modify the properties of a single ParallelAssembly object, specify the Index argument. To modify the properties of all the ParallelAssembly objects, do not specify the Index argument.

Examples

collapse all

This example shows how to quickly modify the cells inside a battery pack by using the modifyParallelAssembly function.

Create a Pack object and display the underlying cell that constitutes this battery pack.

battery = batteryPack;
disp(battery.ModuleAssembly(1).Module(1).ParallelAssembly.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)

Replace all the cells inside battery with cylindrical cells with a capacity of 5 Ah. Display the updated cells.

newbatterycell = batteryCell(batteryCylindricalGeometry,Capacity=simscape.Value(5,"Ah"));
updatedbattery = modifyParallelAssembly(battery,"Cell",newbatterycell);
disp(updatedbattery.ModuleAssembly(1).Module(1).ParallelAssembly.Cell)
  Cell with properties:

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

Input Arguments

collapse all

Parent battery object of the ParallelAssembly object that you want to modify, specified as a Module, ModuleAssembly, or Pack object.

Example: modifyParallelAssembly(Pack,InterCellGap=0.005) sets the value of the InterCellGap property of all the underlying ParallelAssembly objects inside the Pack object to 0.005 m.

Name-Value Arguments

Specify pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: modifyParallelAssembly(Pack,InterCellGap=0.005)

Index of the underlying ParallelAssembly object that you want to modify inside the parent battery object battery, specified as one of these values:

  • A positive integer if battery is a ModuleAssembly object.

  • A two-element vector of positive integers if battery is a Pack object. The first and second elements of this vector define the first and second indices of the module assembly and module, respectively, that contain the ParallelAssembly object that you want to modify.

If you do not specify this argument, the modifyParallelAssembly function modifies the specified properties of all underlying parallel assemblies inside the battery object battery.

Dependencies

To enable this argument, specify the battery input as a ModuleAssembly or Pack object.

You can use the modifyParallelAssembly function to modify all properties of the ParallelAssembly object inside the parent battery object battery using name-value arguments. For a list of all supported name-value arguments, see the Properties section of the ParallelAssembly object.

Output Arguments

collapse all

Parent battery object with modified parallel assemblies, returned as a Module, ModuleAssembly, or Pack object.

Version History

Introduced in R2023b