Creating if loop connecting output of subsystem to input of main system
2 views (last 30 days)
Show older comments
I am modifying a model of a 6s2p battery pack. The current model has a drive cycle input where the file consists of time and current input.
I would like to modify the drive cycle such that it starts charging with 0.1C constant current until one of the cells in the subsystem of the pack reaches 4.2V, then a constant voltage drive cycle is inputted for 7200s. Next, the pack is discharged at 0.1C constant current until it reaches 2.5V.
After conducting this, I would like to cycle the pack. This is done by introducing the same profile as above but at 0.5C. After 50 cycles, I would like it to rerun the initial 0.1C test.
I am new to Simulink and Simscape and appreciate any help in terms of code and advice.
I have attached pictures of the model.
Answers (1)
Animesh
on 25 Aug 2023
Hello Yaashiene,
I understand that you wish to modify the “drive_cycle” input in your battery pack model according to your requirements.
You can modify the “drive_cycle” input according to your desired values and conditions using a MATLAB function block in Simulink and then connecting it to the “variable load” block using Simulink-PS Converter. A MATLAB function block, in your case, would enable you to modify the current supplied by “drive_cycle” input depending on the voltage of cells in the subsystem.
For more information on using a function block and Simulink-PS converter, please consider going through the following resources:
- Implement MATLAB Functions in Simulink with MATLAB Function Blocks: https://in.mathworks.com/help/simulink/ug/what-is-a-matlab-function-block.html
- Connecting Simscape Diagrams to Simulink Sources and Scopes: https://in.mathworks.com/help/simscape/ug/connecting-simscape-diagrams-to-simulink-sources-and-scopes.html
I hope this helps!
0 Comments
See Also
Categories
Find more on Creating Custom Components and Libraries in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!