Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First timestep value is always 0 #46

Closed
lymereJ opened this issue Jun 30, 2020 · 2 comments
Closed

First timestep value is always 0 #46

lymereJ opened this issue Jun 30, 2020 · 2 comments

Comments

@lymereJ
Copy link

lymereJ commented Jun 30, 2020

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.

@lymereJ
Copy link
Author

lymereJ commented Jul 1, 2020

Quick follow up - 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.]

@lymereJ
Copy link
Author

lymereJ commented Jul 1, 2020

I ended up using initialize() and do_step() instead of simulate() to get around this issue.

@lymereJ lymereJ closed this as completed Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant