modifyParallelAssembly
Description
modifies one or more properties of the underlying updatedBattery
= modifyParallelAssembly(battery
,Name=Value
)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
Modify Cells Inside Pack
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
battery
— Parent battery object to modify
Module
object | ModuleAssembly
object | Pack
object
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
— Index of underlying object to modify
positive integer | two-element vector of positive integers
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 aModuleAssembly
object.A two-element vector of positive integers if
battery
is aPack
object, where the first element specifies the parent module assembly and the second element specifies the parent module of theParallelAssembly
object that you want to modify. For example, if you have aPack
object,pack
, that comprises twoModuleAssembly
objects and fourModule
objects,pack.modifyParallelAssembly(...,Index=[2,3])
modifies the third module in the second module assembly.
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
updatedBattery
— Parent battery object with modified parallel assemblies
Module
object | ModuleAssembly
object | Pack
object
Parent battery object with modified parallel assemblies, returned as a
Module
, ModuleAssembly
, or Pack
object.
Version History
Introduced in R2023b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)