Why is the result of plantloop operation incompatible with the strategy specified in EMS:Program?
I used an EMS:Program(see the following blockquote) to control the operation of PlantLoop. In short, the program will decide the number of chillers to stage on according the cooling demand. ( 1chiller if demand is between [0,Cap], and 2 chillers if demand is between [Cap, 2Cap]) Cap here means the rated capacity of the chiller and is 1481477 in this case.
EnergyManagementSystem:Program,
Cooling_dispatch_Values, !- Name
IF CoolSys1_LoopDmnd < -1481477, !- Program Line 1
SET Chil1_Disptch = CoolSys1_LoopDmnd/2, !- Program Line 2
SET Chil2_Disptch = CoolSys1_LoopDmnd/2, !- A4
ELSEIF CoolSys1_LoopDmnd < 0, !- A5
SET Chil1_Disptch = CoolSys1_LoopDmnd, !- A6
SET Chil2_Disptch = 0.0, !- A7
ELSE, !- A8
SET Chil1_Disptch = 0.0, !- A9
SET Chil2_Disptch = 0.0, !- A10
ENDIF; !- A11
However, the result is confusing in that even if the cooling demand is larger than 1481477(rated cap), there are still some moments when only one chiller is turned on. Parts of these inconsistencies are shown in the following table.
----------------Table1-----------------------------------------------------------
Date/Time coolingDmnd Ele-PowerOfchil1 Ele-PowerOfchil2
01/01 08:35:00 1484323.003 106556.5292 0
01/01 10:11:15 1493364.145 110266.0414 0
01/01 10:15:00 1488649.626 109615.4136 0
01/01 11:12:16 1499195.511 110652.2023 0
01/01 11:53:10 1502321.217 110640.5195 0
01/01 12:26:15 1514519.749 111723.4092 0
01/01 12:43:38 1502297.995 110866.6415 0
01/01 13:03:19 1506863.348 109632.451 0
01/01 15:17:08 1514534.598 110532.2262 0
01/01 16:12:30 1515863.384 112271.376 0
01/02 05:45:00 1490389.698 107734.7433 0
01/02 06:10:00 1508263.231 109458.4895 0
So why do these situations occur, and how can I avoid these situations?
Any help will be greatly appreciated.
Updated
I have uploaded the .idf file to Github(ASHRAE90.1_OfficeLarge_STD2013_Miami_V1.idf in this repository: https://github.com/faithefeng/EnergyP...) . This model is a prototypical building in Miami as indicated by file name, and I have modified the control scheme for Plant Loop using EMS.
Updated 2
I have used the EDD to trace the Erl Program. Here is one record of these inconsistencies.
COOLING_DISPATCH_VALUES,Line 1,SET AA = COOLSYS1_LOOPDMND,-1484323.002751, Occurrence info=Miami Intl Ap FL USA TMY3 WMO#=722020, 01/01 08:32 - 08:35
COOLING_DISPATCH_VALUES,Line 2,IF COOLSYS1_LOOPDMND < -1481477,1.000000, Occurrence info=Miami Intl
Ap FL USA TMY3 WMO#=722020, 01/01 08:32 - 08:35
COOLING_DISPATCH_VALUES,Line 3,SET CHIL1_DISPTCH = COOLSYS1_LOOPDMND/2,-742161.501375, Occurrence info=Miami Intl Ap FL USA TMY3 WMO#=722020, 01/01 08:32 - 08:35
COOLING_DISPATCH_VALUES,Line 4,SET CHIL2_DISPTCH = COOLSYS1_LOOPDMND/2,-742161.501375, Occurrence info=Miami Intl Ap FL USA TMY3 WMO#=722020, 01/01 08:32 - 08:35
As shown, both ChIL1_DISPTCH and ChIL2_DISPTCH are -742161.501375, which means at this moment(01/01 08:32 - 08:35), both these two chillers are turned on. But the confusing part is that in the output files only chiller1 is used ...
@Faithefeng it would be helpful if you also included the input fields for the other EMS objects (Actuators, Sensors, Program Calling Manager, Output Variable, etc.) to help people provide a better answer.
Have you tried using
> 1481477
instead of< -1481477
in your IF / ELSE logic?I think @Aaron Boranian is correct that you need to revise your IF/ELSE expressions. Both the IF and ELSEIF expressions evaluate to TRUE for cooling loads < -1481477. The EMS application guide indicates that the first ELSEIF clause that evaluates to TRUE will execute. You could fix this by swapping the IF <expression> with the ELSEIF <expression> to swap the order of evaluation.
@Aaron Boranian, I have uploaded the .idf file (see the updated question). Thanks for you help.
I came to same conclusion as you. The EMS program is doing what it is supposed to do. I do not understand either why chiller2 stays off. I tried to see if an availabilityManager or another EMS program could be the problem, but I couldn't find anything that would turn it off. This might be a bug.
Just to note, my comment above is incorrect. I ran your file and looked at the EDD line trace. Once the IF expression evaluated to true, the program exits the IF/ELSEIF/ELSE. I got an incorrect impression from the EMS Application Guide documentation on IF statements. Also, I don't have an answer to your question, but will post an "answer" below so I can share an observation.