Create an internal loop in Simulink simulation
Afficher commentaires plus anciens
I am trying to create an internal loop (without using the if-loop blocks, because these seem to significantly slow down my model) to allow one part of my simulation to run for a specified number of times, and then output this so the rest of the simulation can continue. This would be the equivalent of a for loop inside a for loop, such as:
for(1:end of simulink simulation)
for(1:specified number of loops)
Run small part of simulation over and over
end
Run the rest of simulation
end
For a little context, this is for an iterative heat pump model, so that the heat pump portion can run several times to reduce error, and then the rest of the simulation can continue.
I was attempting to use a switch that is only thrown after a counter reaches a specified value, but I am unsure what to connect to the other side of the switch to prevent the rest of the simulation from continuing.
Réponse acceptée
Plus de réponses (1)
Guy Rouleau
le 18 Juil 2013
Modifié(e) : Guy Rouleau
le 18 Juil 2013
0 votes
It looks like you need the While Iterator Subsystem:
1 commentaire
Benjamin
le 18 Juil 2013
Catégories
En savoir plus sur Simulink dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!