Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
3

EnergyPlus FMU running simulation for 1 time step

asked 6 years ago

tstesco's avatar

How can an EnergyPlus FMU (created with https://github.com/lbl-srg/EnergyPlus...) be run for the minimum timestep of 60 seconds? When attempting to run the .fmu model with PyFMI (https://github.com/modelon/PyFMI) with either

from pyfmi import load_fmu
model = load_fmu(fmu= '../fmu/test_eplus.fmu')
model.initialize()

or

from pyfmi import load_fmu
model = load_fmu(fmu= '../fmu/test_eplus.fmu')
final_time = 60.0*60*24*1+60
start_time = 60.0*60*24*1
idf_steps_per_hour = 60
ncp = (final_time-start_time)/(3600./idf_steps_per_hour)
opts['ncp'] = ncp
res = model.simulate(
    start_time=start_time,
    final_time=final_time,
    options=opts
)

both return the error: [ERROR][Slave] [error][FMU status:Error] fmiInitializeSlave: The delta between the FMU stop time 86460.000000 and the FMU start time 86400.000000 must be a multiple of 86400. This is required by EnergyPlus. The current delta is 60.000000. Instantiation of Slave failed.

How can I simulate the EnergyPlus FMU for less than 86400 seconds (1 day) as a time step? The minimal time step for EnergyPlus is 60 seconds so I'm not sure where this 1 day requirement comes in.

Edit: it appears that I can run a single 60s time step with:

start_time = 60.0*60*24*1
final_time = 60.0*60*24*3
model.initialize(start_time, final_time)
t_step = start_time
res = {}
while t_step < final_time:
    res[t_step] = model.do_step(current_t=t_step, step_size=step_size, new_step=True)
    t_step += step_size

Need to check that this works with non-dummy model. Thanks for reading this far! Anyone have better ideas?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 6 years ago

updated 6 years ago

The error is not related to the time step but to the length of the simulation. The FMU is expecting a minimum simulation length of a day (or a multiple of a day). The simulation time step can be set to 60s by adjusting the ncp parameter.

Preview: (hide)
link

Comments

Thanks for clarifying, do you know if when stepping through the time steps with model.do_stepI can pass control inputs and collect the results? The documentation doesn't show any return object other than the FMU status (https://jmodelica.org/pyfmi/pyfmi.html).

Edit: It appears to work with getting the FMU variable names with model.get_model_variables() and calling each variable by name with model.get().

tstesco's avatar tstesco  ( 6 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 6 years ago

Seen: 847 times

Last updated: Dec 18 '18