It is possible to run multiple times a simulation in Simulink in the same timestep?

조회 수: 2 (최근 30일)
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
Kirthi
Kirthi 2022년 12월 13일
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 :

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Component-Based Modeling에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by