The thermal port for the battery seems to be not modeled using the code.
2 views (last 30 days)
Show older comments
% IMPORT SIMSCAPE BATTERY PACKAGE
import simscape.battery.builder.*
% DEFINE FIGURE FOR VISUALIZATION
f = uifigure('Color', 'w');
% DEFINE CELL GEOMETRY
cylindricalGeometry = CylindricalGeometry();
% CREATE CELL OBJECT
batteryCell = Cell('Geometry', cylindricalGeometry);
% VISUALIZE CELL
BatteryChart('Parent', f, 'Battery', batteryCell);
% DEFINE CELL THERMAL PROPERTIES
batteryCell.CellModelOptions.BlockParameters.thermal_port = 'model';
batteryCell.CellModelOptions.BlockParameters.T_dependence = 'yes';
% DEFINE PARALLEL ASSEMBLY (4 CELLS CONNECTED IN PARALLEL)
batteryParallelAssembly = ParallelAssembly('Cell', batteryCell, 'numParallelCells', 4);
batteryParallelAssembly.StackingAxis = 'X';
% VISUALIZE PARALLEL ASSEMBLY
BatteryChart('Parent', f, 'Battery', batteryParallelAssembly);
% DEFINE MODULE (5 PARALLEL ASSEMBLIES CONNECTED IN SERIES)
batteryModule = Module('ParallelAssembly', batteryParallelAssembly, 'numSeriesAssemblies', 5);
% DEFINE SIMULATION STRATEGY
batteryModule.ModelResolution = 'Grouped';
batteryModule.SeriesGrouping = ones(1, 5);
% VISUALIZE MODULE
BatteryChart('Parent', f, 'Battery', batteryModule, 'SimulationStrategyVisible', 'on');
% DEFINE MODULE THERMAL PROPERTIES
batteryModule.AmbientThermalPath = 'CellBasedThermalResistance';
batteryModule.CoolantThermalPath = 'CellBasedThermalResistance';
% DEFINE MODULE ASSEMBLY (2 MODULES CONNECTED IN SERIES)
batteryModuleAssembly = ModuleAssembly('Module', repmat(batteryModule, 1, 2));
batteryModuleAssembly.InterModuleGap = simscape.Value(0.01, 'm');
% VISUALIZE MODULE ASSEMBLY
BatteryChart('Parent', f, 'Battery', batteryModuleAssembly, 'SimulationStrategyVisible', 'on');
% DEFINE PACK (2 MODULE ASSEMBLIES CONNECTED IN SERIES)
batteryModuleAssembly = ModuleAssembly('Module', repmat(batteryModule, 1, 2));
batteryPack.InterModuleAssemblyGap = simscape.Value(0.01, 'm');
% VISUALIZE PACK
BatteryChart('Parent', f, 'Battery', batteryPack, 'SimulationStrategyVisible', 'on');
% DEFINE BALANCING STRATEGY
batteryPack.BalancingStrategy = 'Passive';
% DEFINE THERMAL PROPERTIES
batteryPack.AmbientThermalPath = 'CellBasedThermalResistance';
batteryPack.CoolantThermalPath = 'CellBasedThermalResistance';
% BUILD SIMSCAPE MODEL OF BATTERY PACK
buildBattery(batteryPack, 'LibraryName', 'packModel',... 'MaskInitialTargets', 'VariableNames',... 'MaskParameters', 'VariableNames');
Error: Cell property ThermalEffects must be set to model.
0 Comments
Answers (1)
Javier Gazzarri
on 7 May 2024
Hello Umesh,
I cannot find the battery pack definition in your code above. I see you defined a module assembly but not a pack. Can you please check?
Thanks,
Javier
0 Comments
See Also
Categories
Find more on Battery Pack Modeling in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!