242
6 Hierarchical Component Models
Component: Heater
Create a heater SourceHeat (Fig. 6.47).
This component is responsible for heating the second tank and is connected
with the red connector to the tank (variable heat), and the black connector with
the regulator (variable signal).
The behavior of the heater is completely determined by the regulator. If the tank
is empty mode = M Empty , then the heat flux Q = 0, otherwise Q = signal.
Heater Program Code:
model SourceHeat
Interfaces.Heat heat
Interfaces.Signal signal(nSignal=1)
equation
{heat.Q} = if noEvent(heat.mode == MODE_Empty)
then {0} else signal.s;
end SourceHeat;
Component: Pump
Create a pump PumpLiq (Fig. 6.48).
This component is responsible for transferring fluid from one tank to another and
is connected by blue connectors to the tanks (liqIn variables—the fluid that flows
Fig. 6.47 SourceHeat heater
icon
Fig. 6.48 PumpLiq pump
icon
Précédent

- 253/274

Suivant