Hi everyone,
I'm working on a script and I found that the built-in variable Year
is not working properly. The variables YearDiff, YearBaseline, AvgElecVPSC, AvgElecVPSCBase, VPSCIncRate and HVACEnergyCost
are declared global variables, and HVACConsump
is the sensor of the output meter Facility Total HVAC Electric Demand Power. The values of YearBaseline, AvgElecVPSCBase, VPSCIncRate
are defined in the SetInputData program.
EnergyManagementSystem:Program,
SetInputData,
set AvgElecVPSCBase = 0.1226, !(Euros/kWh)
set VPSCIncRate = 1.91, !%
set YearBaseline = 2015;
EnergyManagementSystem:Sensor,
HVACConsump,
Whole Building ,
Facility Total HVAC Electric Demand Power;
EnergyManagementSystem:ProgramCallingManager,
ApplyATCCI,
InsideHVACSystemIterationLoop,
ApplyATCCI;
EnergyManagementSystem:Program,
ApplyATCCI,
set YearDiff = Year - YearBaseline,
set AvgElecVPSC = AvgElecVPSCBase*((1+(VPSCIncRate/100))^YearDiff),
set HVACEnergyCost = (HVACConsump/1000) * AvgElecVPSC,
endif;
In this case, the EPW year is 2025 and YearBaseline is 2015, so that YearDiff should be 2025-2015=10 always. However, when I run the simulation, the results show the following values: when there is a peak in HVAC consumption, for some reason, there is a peak in the built-in variable Year and in the global variable YearBaseline, and therefore the substraction is wrong. Please see screenshot below.
Does anyone know why is this happening?
Thank you so much in advance.