238
6 Hierarchical Component Models
Liquid Source Regulator Program Code:
model SourceCntr
parameter Integer nComp = 2;
Interfaces.Signal signal(nSignal=nComp+2)
parameter SI.Time event1 = 180,
event2 = 840;
parameter SI.MassFlowRate flow1 = 40,
flow2 = 40;
SI.MassFlowRate totalMassFSP;
Real massFractSP[nComp];
SI.Temperature tempFSP;
equation
totalMassFSP = if time > event2 then flow2
else if time > event1 then 0
else -flow1;
massFractSP = {0.25, 0.75};
tempFSP = 300;
signal.s[1:nComp] = massFractSP;
signal.s[nComp+1] = totalMassFSP;
signal.s[nComp+2] = tempFSP;
end SourceCntr;
Heater regulator HeatCntr must maintain a constant flow of heat to heat the fluid
Q heat = 2.5 105 J/s. To do this, we introduce the heat flux parameter:
parameter SI.EnergyFlowRate heatFlowSP = 2.5E5; "heating value"
In accordance with the condition of the problem, we create two events: the
beginning and end of heating the liquid in the tank:
parameter SI.Time event1 = 360, "start heating fluid"
event2 = 720; "completion of fluid heating"
In the intervals between these events, the liquid is heated (see the equation
block in the program code) using a fixed heat flux heatFSP, the value of which is
transmitted to the heater
signal.s = {heatFSP};
Précédent

- 249/274

Suivant