How to implement Battery Model into "for each subsystem" block?

Hallo,
When I try to run a simulink model with a battery model (Li-Ion) (from SimPowerSystems) integrated into a "for each subsystem" block I receive the following error message:
The block 'auto_1/For Each Subsystem/Battery/Model/Continuous/Current filter' with continuous state(s) is not supported inside subsystem 'auto_1/For Each Subsystem' because the subsystem contains a For Each block ('auto_1/For Each Subsystem').
That means the Current filter which is integrated into the battery model causes the problem.
Any suggestions how to solve that issue?
Thanks and regards, Benjamin

 Accepted Answer

The message is clear. A system with continuous state is not supported in the "For Each" block. What is your use case to implement a "For Each" block in a battery model?

More Answers (1)

Thanks for your reply. I want to simulate the charge/discharge behaviour for several time instants and several batteries without modeling each of them. Now I changed the block into a For-Iterator Subsystem. Within this block there is another problem with a GoTo/From Block of the Battery and Equivalent Circuit. The messages are the following: 1: Modell error (Source unknown) - Goto/From connections cannot cross nonvirtual subsystem boundaries. the only exception is when a goto is connected to a state output port 2: Block error (Goto1) - Invalid connection starts with 'auto_1/powergui/EquivalentModel1/Yout/Goto1' 3: Block error (source) - Invalid connection ends with 'auto_1/For Iterator Subsystem/Battery/Current Measurement/source'
Seems as if I neither can implement a battery model into for-iterator. Or is there any possibility to set up a connection between those two ports that cause the problem (2&3)?
Regards

2 Comments

I suspect you are heading to the wrong direction. If you have several batteries, I can't think a way that you can use For-Iterator subsystem instead of duplicating the model. What do you mean "several time instants"?
Seems that you're right. Whether I take a for iterator or for each iterator it doesn't make any difference. The battery model is build on continuous sample time. A loop is always based on discrete sample times. So I think I can't solve it this way. The only way to model it is to duplicate the battery block as often as I wanted it to iterate. Not a ideal solution but I think it works out. Any elegant solution how to model a huge amount of batteries with simulink?

Sign in to comment.

Communities

More Answers in the  Power Electronics Control

Community Treasure Hunt

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

Start Hunting!