Kalorimer (GCL)

//VYKON v kW
Variable TepVyst As Real
Variable TepVrat As Real
Variable Prietok As Real   // l/h
Variable Vykon As Real     // kW
Variable KoefH2O As Real
Constant MTC20 = 4180      // Merna Tepelna Kapacita H2O (20°C)

DoEvery 15S
   TepVyst = AI.x1
   TepVrat = AI.x2

   Call  TabTepHustH2O
   Prietok = AI.x3
   Vykon = ((TepVyst - TepVrat) * (Prietok * KoefH2O * MTC20)) / 1000 / 3600
End Do

Sub TabTepHustH2O
   If TepVrat <= 40 Then KoefH2O = (((992.220 - 995.651) / 10) *
       (TepVrat - 30) + 995.651) / 1000 End If
   If TepVrat > 40 And TepVrat <= 50 Then KoefH2O = (((988.040 - 992.220) / 10) *
       (TepVrat - 40) + 992.220) / 1000 End If
   If TepVrat > 50 And TepVrat <= 60 Then KoefH2O = (((983.200 - 988.040) / 10) *
       (TepVrat - 50) + 988.040) / 1000 End If
   If TepVrat > 60 And TepVrat <= 70 Then KoefH2O = (((977.760 - 983.200) / 10) *
       (TepVrat - 60) + 983.200) / 1000 End If
   If TepVrat > 70 Then KoefH2O = (((971.790 - 977.760) / 10) *
       (TepVrat - 70) + 977.760) / 1000 End If
End Sub