我在用 PyFMI 模拟 EnergyPlus-FMU 时遇到了麻烦。我使用参考建筑模型创建了一个 EnergyPlus FMU。我正在使用 PyFMI2.5。如何运行 do_step() 函数?
from pyfmi import load_fmu
model = load_fmu("MyEnergyplus.fmu")
start_time = 0
final_time = 60.0 * 60 * 24 * 3 #seconds
step_size = 60 # seconds
opts = model.simulate_options()
idf_steps_per_hour = 60
ncp = (final_time - start_time)/(3600./idf_steps_per_hour)
opts['ncp'] = ncp
t = 0
status = model.do_step(current_t = t, step_size= step_size, new_step=True)
我得到的错误:
File "test_fmi2.py", line 15, in <module> status = model.do_step(current_t = t, step_size= step_size, new_step=True)
AttributeError: 'pyfmi.fmi.FMUModelME2' object has no attribute 'do_step'
我仔细检查了 PyFMI 的 API,没有发现任何问题。如何启用模拟?谢谢。