It is possible to run multiple times a simulation in Simulink in the same timestep?
2 views (last 30 days)
Show older comments
Hello,
I have a model in Simulink and I which have input data that changes with time. It's a pump station with 3 machines, and depending on the flow (demand) may work one, two or three pumps.
In the code, I have the rules for 1 pump which is no problem. But for the cases when I can work with two or three pumps I also want to try with one, two or three pumps, and compare the output and choose the best based in a criteria.
(Hope I explained myself)
Thank you all in advance.
switch p
case '2p' %2 installed pumps
if Qd < Qmint %Case 1
b = 1
elseif (Qmint <= Qd) && (Qd< 2*Qmint) %Case 2
b = 2
elseif (2*Qmint <= Qd) && (Qd< Qmaxt) %Case 3
b = 3
elseif (Qmaxt <= Qd) && (Qd< 2*Qmaxt) %Case 4
b = 4
elseif (2*Qmaxt<= Qd) %Case 5
b = 5
end
switch b
case 1
nf = 0
Qt = 0 % 0 pumps
case 2
nf = 1
Qt = Qd %1 pumps
case 3
nf = 2
Qt= Qd/nf %1 or 2 pumps (In this case I want to try with 1 and 2 pumps and choose the best)
case 4
nf = 2
Qt = Qd/nf %1 or 2, might work the PRV (Also in this case I want to try with 1 and 2)
case 5
nf = 2
Qt = Qmaxt % 2 pumps + PRV
1 Comment
Kirthi
on 13 Dec 2022
Hello Melvin, Im not sure I understand what you wish to do from the title of your question.
However, from the description provided, I think you can use Variant Subsystem block. The Variant Subsystem block can include three choices (design models), i.e, a model that has 1pump, other with 2pumps, and another with 3pumps. You can then set a conditions according to your usage (use a parameter that implies which works best and use it in your condition statement ). Variant Systems lets you choose a particular block design based on the criteria you set. So you will be able to choose between the three different pump models created by you. Hope this helps.
Refer to the below documentation to understand better :
Answers (0)
See Also
Categories
Find more on Component-Based 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!