|
|||||
#Description
HIGH LEVEL COMPONENT Heating SUBCOMPONENTS Room, Controller, Comparator INPUT CONNECTIONS TOut --> (Controller.TOut, Room.TOut);
TNom --> Comparator.TNom; OUTPUT EQUIVALENCES TAct := Room.TRoom;
COMPONENT CONNECTIONS
TAct --> Comparator.TAct;
Comparator.TDev --> Controller.TDev; Controller.IVol --> Room.IVol; Controller.TSupply --> Room.TSupply; INITIALIZE TOut := - 10;
TNom := + 20; END OF Heating
CONSTANTS
KapAir (REAL) := 1.0 E+3, # spec. heat capacity of air [J/(kg*K)]
KapWater (REAL) := 4.2 E+3, # spec. heat capacity of water [J/(kg*K)] RhoAir (REAL) := 1.3 , # density of air [kg/m^3] RhoWater (REAL) := 1000 , # density of water [kg/m^3] VolRoom (REAL) := 40.0 , # volume of room [m^3] VolRad (REAL) := 10.0 E-3, # content of radiator [m^3] KWall (REAL) := 2.0 , # heat transfer coeff. wall [W/(K*m^2)] KRad (REAL) := 60.0 , # heat transfer coeff. radiator [W/(K*m^2)] AWall (REAL) := 20.0 , # area wall [m^2] ARad (REAL) := 6.0 , # area radiator [m^2] STATE VARIABLES CONTINUOUS
QRoom (REAL) := 0 , # heat quantity in room [J]
QRad (REAL) := 0 # heat quantity in radiator [J] # (heat quantity with respect to 0 degree Celsius) DEPENDENT VARIABLES CONTINUOUS
TRoom (REAL) , # air temperature in room [Degree Celsius]
TRad (REAL) , # avg. water temp. in radiator [Degree Celsius] TOutflow (REAL) # water temp. at outflow of radiator [Degree Celsius] SENSOR VARIABLES CONTINUOUS
TOut (REAL) := 0 , # outside temperature [Degree Celsius]
TSupply (REAL) := 60 , # supply temperature of radiator [Degree Celsius] IVol (REAL) := 0.001 # volume flow through radiator [m^3/sec] DYNAMIC BEHAVIOUR
TRoom := QRoom / (KapAir * VolRoom * RhoAir );
TRad := QRad / (KapWater * VolRad * RhoWater); TOutflow := 0.5 * (TRad + TRoom); DIFFERENTIAL EQUATIONS
QRoom' := KWall * AWall * (TRad - TRoom)
- KRad * ARad * (TRoom - TOut); QRad' := KapWater * IVol * (TSupply - TOutflow) - KRad * ARad * (TRad - TRoom);
END
END OF Room
TABULAR FUNCTION CtrlSup (REAL --> REAL) # supply temperature [Degree Celsius]
CONTINUOUS # in dependence on the BY LINEAR INTERPOLATION # outside temperature [Degree Celsius] ON ( -100, -20, 0, 20, 100 ) --> ( 80, 80, 60, 50, 50 ) TABULAR FUNCTION CtrlVol (REAL --> REAL) # controller value CONTINUOUS # in dependence on the BY LINEAR INTERPOLATION # temperature deviation [Degree Celsius] ON ( -100, -5, 0.0, 5, 100 ) --> ( 1, 1, 0.5, 0, 0 ) DECLARATION OF ELEMENS CONSTANTS
A (REAL) := 4.0 E-4 # tube cross section [m^2]
v (REAL) := 2.5 # flow velocity [m/sec] DEPENDENT VARIABLES CONTINUOUS
IVol (REAL) , # volume flow hot water [m^3/sec]
TSupply (REAL) # supply temperature hot water [Degree Celsius] SENSOR VARIABLES CONTINUOUS
TDev (REAL) , # deviation from nominal temp. [Degree Celsius]
TOut (REAL) # outside temperature [Degree Celsius] DYNAMIC BEHAVIOUR
IVol := CtrlVol (TDev) * A * v;
TSupply := CtrlSup (TOut); END OF Controller DEPENDENT VARIABLES CONTINUOUS
TDev (REAL) # deviation of temperature [Degree Celsius]
SENSOR VARIABLES CONTINUOUS
TNom (REAL) , # nominal temperature [Degree Celsius]
TAct (REAL) # actual temperature [Degree Celsius] DYNAMIC BEHAVIOUR TDev := TAct - TNom; END OF Comparator |