Clear Filters
Clear Filters

Simscape Battery - changing number of parallel and serial cells of module or pack without having to build a new library

1 view (last 30 days)
Hello,
Is it possible to change the number of serial and parallel cells of a parallel assembly or module as a runtime parameter?
Say I want to run multiple simulations of a battery behaivior whilst changing the internal configuration (number of serial and parallel cells) with every run.
To me it seems that I have to build a new library, be it for the module or a pack, when I make such andamental changes to the battery.
Is it possible to change these parameters once the library was created?
Thanks in advance!

Answers (1)

Dhruv
Dhruv on 22 May 2023
In Simscape, the internal configuration of a component, such as the number of serial and parallel cells in a battery module or pack, is typically defined during the component's creation and cannot be directly modified at runtime without rebuilding the library.
However, there are alternative approaches you can consider to achieve the desired behavior of changing the internal configuration without rebuilding the library for each simulation run. Here are a couple of options:
1. Variant Subsystems:
• Create a single battery module/pack subsystem with the maximum number of cells.
• Use variant controls to select the desired configuration at runtime.
• Define different variants representing specific configurations with varying numbers of cells.
• Switch between variants during runtime using the variant controls.
2. MATLAB Scripting:
• Create the battery module/pack subsystem with a fixed number of cells.
• Use MATLAB scripting to programmatically modify component parameters before each simulation run.
• Access and update the parameters, such as the number of serial and parallel cells, in the script.
Choose the approach that suits your model complexity and simulation requirements. Variant subsystems provide a cleaner approach for managing different configurations within a single model, while MATLAB scripting offers more flexibility at the cost of additional implementation effort.

Categories

Find more on Electrical Systems in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!