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

Revision history [back]

After much faffing, I finally got it all working.

The key points were:

  • The PyFMI on the chria channel is not being maintained. The one on conda-forge seems to be the best place to get the binary package.
  • The _fmu-export-actuator.idf simulation is in fact three days long, and differences are only visible on the third day!
  • Initialising yShade is not enough, you must pass it in to the input parameter of simulate().

I've added my final python file to a gist (with graphs of the output) as it's pretty long and I can only upload images here. The important bit is this though:

# ...

# Setup the input array.
step_size = seconds_in_hour / idf_steps_per_hour
shade_val = np.array([(i*step_size, yShade) for i in range(ncp)])
shade_val = ('yShade', shade_val)

# Set initial value of yShade
model.set(shade_val[0], shade_val[1][0][1])

res = model.simulate(start_time=0,
                     final_time=final_time,
                     input=shade_val,  # This must be passed in!
                     options=opts)

# ...

And here's a couple of graphs so that people know what to look for:

yShade = 0:

yShade=0

yShade = 7:

yShade=7

After much faffing, I finally got it all working.

The key points were:

  • FMPy doesn't work with EnergyPlusToFMU
  • The PyFMI on the chria channel is not being maintained. The one on conda-forge seems to be the best place to get the binary package.
  • The _fmu-export-actuator.idf simulation is in fact three days long, and differences are only visible on the third day!
  • Initialising yShade is not enough, you must pass it in to the input parameter of simulate().

I've added my final python file to a gist (with graphs of the output) as it's pretty long and I can only upload images here. The important bit is this though:

# ...

# Setup the input array.
step_size = seconds_in_hour / idf_steps_per_hour
shade_val = np.array([(i*step_size, yShade) for i in range(ncp)])
shade_val = ('yShade', shade_val)

# Set initial value of yShade
model.set(shade_val[0], shade_val[1][0][1])

res = model.simulate(start_time=0,
                     final_time=final_time,
                     input=shade_val,  # This must be passed in!
                     options=opts)

# ...

And here's a couple of graphs so that people know what to look for:

yShade = 0:

yShade=0

yShade = 7:

yShade=7