modifyBattery
Description
modifies one or more properties of the battery object updatedBattery
= modifyBattery(battery
,Name=Value
)battery
by using
one or more name-value arguments.
Unlike the modifyCell
,
modifyParallelAssembly
, modifyModule
,
and modifyModuleAssembly
functions, you do not need to know which battery object
contains the property you want to modify.
Examples
Modify Number of Series-Connected Parallel Assemblies Inside Pack
This example shows how to quickly modify the number of
series-connected parallel assemblies inside a battery pack by using the
modifyBattery
function.
Create a Pack
object and display the number of series-connected
parallel assemblies.
battery = batteryPack; disp(battery.ModuleAssembly(1).Module(1).NumSeriesAssemblies)
1
Change this value to 100 series-connected parallel assemblies and display the updated value.
updatedbattery = modifyBattery(battery,NumSeriesAssemblies=100); disp(updatedbattery.ModuleAssembly(1).Module(1).NumSeriesAssemblies)
100
Input Arguments
battery
— Battery to modify
ParallelAssembly
object | Module
object | ModuleAssembly
object | Pack
object
Battery to modify, specified as a ParallelAssembly
, Module
,
ModuleAssembly
, or Pack
object.
Example: modifyBattery(Pack,CellMass=10)
sets the value of the
Mass
property of all the underlying Cell
objects
inside the Pack
object to 10
.
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:
modifyBattery(Pack,CellMass=10)
Cell
— Cell component in parallel assembly
Cell
object
Cell component in the parallel assembly, specified as a Cell
object.
Example: modifyBattery(Pack,Cell=Cell(Geometry=CylindricalGeometry))
CellCapacity
— Capacity of battery cell
simscape.Value
object | positive scalar
Capacity of the battery cell, specified as a positive scalar or a simscape.Value
object that represents a scalar with the specified unit of
measurement. The value of this property must be strictly positive.
If you set this argument directly with a positive scalar value instead of using a
simscape.Value
object, the function converts the value to a
simscape.Value
object with A*hr
as its
physical unit.
Example:
modifyBattery(Pack,CellCapacity=8)
CellMass
— Mass of battery cell
simscape.Value
object | scalar in the range (0, 100]
Mass of the battery cell, specified as a scalar in the range (0, 100] or a simscape.Value
object that represents a scalar with the specified unit of
measurement. The value of this property must be strictly positive and lower than 100
kg.
If you set this property directly with a positive scalar value instead of using a
simscape.Value
object, the object converts the value to a
simscape.Value
object with kg
as its
physical unit.
Example: modifyBattery(Pack,CellMass=10)
InterModuleGap
— Shortest distance between modules
simscape.Value
object | scalar in the range (0, 0.1]
Shortest distance between modules inside the module assembly, specified as a
scalar in the range (0, 0.1] 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.
Example:
modifyBattery(Pack,InterModuleGap=simscape.Value(0.01,"m"))
Dependencies
To enable this name-value argument, the input argument
battery
must be a ModuleAssembly
object.
NumParallelCells
— Number of parallel-connected cells inside parallel assembly
integer in the range (0, 150]
Number of parallel-connected cells inside the parallel assembly, specified as an integer in the range (0, 150].
You can also modify this name-value argument by using the name
P
.
Example:
modifyBattery(Pack,NumParallelCells=48)
Example:
modifyBattery(Pack,P=48)
NumSeriesAssemblies
— Number of series-connected parallel assemblies
1
(default) | integer in the range (0, 150]
Number of series-connected parallel assemblies inside the module, specified as an integer in the range (0, 150].
You can also modify this name-value argument by using the name
S
.
Example:
modifyBattery(Pack,NumSeriesAssemblies=48)
Example:
modifyBattery(Pack,S=48)
Dependencies
To enable this name-value argument, specify the battery
as
a Module
, ModuleAssembly
, or Pack
object.
Output Arguments
updatedBattery
— Updated battery
ParallelAssembly
object | Module
object | ModuleAssembly
object | Pack
object
Updated battery, returned as a ParallelAssembly
,
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)