First timestep value is always 0

89 views
Skip to first unread message

Jeremy L.

unread,
Jul 1, 2020, 12:49:54 PM7/1/20
to energyplus-fmu
I'm setting a thermostat schedule using an ExternalInterface:FunctionalMockupUnitExport:To:Schedule object in an EnergyPlus model and running the FMU using pyfmi, it almost works.

The initial value in the IDF is set to 24 and I'm setting it to 23 using my python script. I output the schedule value using an Output:Variable and a ExternalInterface:FunctionalMockupUnitExport:From:Variable. After the simulation is completed, I am able to retrieve the individual schedule value. When running the simulation for a single day, I get the following array:

[24.  0. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23.
 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23.
 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23.
 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23.
 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23.
 23. 23. 23. 23. 23. 23. 23.]

24 is the initial value and 23 the one set by the script, but 0 is unexpected. When comparing the array with the content of the output variable csv file produced by EnergyPlus, I see that 0 correspond to the value for the first timestep.

Why am I getting a value of 0 for the first timestep?

I tried with EnergyPlus 9.0, EnergyPlus 9.3 and version 2 and 3 of EnergyPlusToFMU. I get the same result every time. I'm setting an initial value for the model variable (model.set()) as well as passing values for each timestep (via the input argument of the model.simulate() function) using pyfmi.

the third item in the array appears to correspond to the first simulation time step (t = 900 s, 4 time steps per hour).

I've reproduced the same case but using ExternalInterface:FunctionalMockupUnitExport:To:Actuator and I get the following array. The initial value seem to not be retrieved.

[0.  0. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23.
 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23.
 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23.
 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23.
 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23. 23.
 23. 23. 23. 23. 23. 23. 23.]

Jeremy L.

unread,
Jul 1, 2020, 1:05:50 PM7/1/20
to energyplus-fmu
Moved over from GitHub:  https://github.com/lbl-srg/EnergyPlusToFMU/issues/46 which explains the lack of greetings, sorry about that. Any help would be greatly appreciated!

Jeremy L.

unread,
Jul 1, 2020, 5:26:31 PM7/1/20
to energyplus-fmu
I ended up using initialize() and do_step() instead of simulate() to get around this issue.  
Reply all
Reply to author
Forward
0 new messages