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 2018-12-14 15:52:14 -0600

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2018-12-18 07:44:26 -0600

updated 2018-12-18 07:45:03 -0600

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.

edit flag offensive delete link more

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  ( 2018-12-18 16:19:03 -0600 )edit

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: 2018-12-14 15:35:14 -0600

Seen: 812 times

Last updated: Dec 18 '18