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

Changing schedule based on Artificial Neural Network using values from energy plus

asked 2022-01-14 10:06:48 -0600

prp92's avatar

updated 2022-01-14 14:55:37 -0600


Is it possible to supply the indoor temperature, indoor RH and other values to the ANN model that can predict the opening and closing of the windows? I already have the model. I have to figure out how can I supply the indoor air parameters like temperature and RH from the energy plus to my ANN model. And also how to replace the Window Open/Close values predicted by ANN model as the schedule to window opening?

I believe this can be done using python but I am not sure how to start.

Thank you so much for your time.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-01-16 18:54:51 -0600

mechyai's avatar

I would check out the new EMS Python API and see if it suits your needs. It provides the EMS feature of EnergyPlus with a nice Python API for actuating and sensing simulation objects at runtime. I'd check out the EMS Application Guide from the EnergyPlus documentation and the Python API

Using the Python API you can fetch sensor values of indoor parameters at each timestep, feed them to your ANN, then use actuators to implement the output. You should first check if EMS provides actuators for window opening/closing. I know window shading is possible, but unfamiliar with the rest. If window open/close is schedule driven, you can actuate the schedule itself.

edit flag offensive delete link more


Hi @mechyai,

thank you so much for replying. I spend last two weeks trying to understand EMS python API and it is still super hard to understand it.

I found that using plugin method 'EnergyPlusPlugin' might be easier for a beginner like me. Is it possible to do all the process like sensing, reading ANN models and actuating using the python plugin mode?


prp92's avatar prp92  ( 2022-01-29 12:09:50 -0600 )edit

@prp92 I am not sure as I have only used used EnergyPlus as a "library" with the Python EMS API, not Python as a plugin in EnergyPlus. I made this workflow decision a while ago so I don't remember all my motivations, but I think I remember choosing running E+ as a library in Python because of the ability to keep my namespace (for instance NN model params) in Python for the longevity of the simulation and Python script. If I remember correctly, Python plugin's namespace only persist within the individual call, you would have to read/write your NN model params at each call.

mechyai's avatar mechyai  ( 2022-01-30 12:18:06 -0600 )edit

@prp92, also I believe if using Python as a plugin you have to bottle your ENTIRE Python workflow into the single plugin script. When using EnergyPlus as a library in Python, I can have a normal programming workflow, say with a bunch of PyTorch NN stuff, in Python, then only pass EnergyPlus specific things via a callback function at specific calling points. If I take an OOP approach in Python, I can pass a whole slew of variables and objects (.ie NN models, etc.) into EnergyPlus, preserving namespace inside and outside E+ for the entire simulation run period.

mechyai's avatar mechyai  ( 2022-01-30 12:23:46 -0600 )edit

@prp92 using E+ as a library in Python with the EMS Python API should make sense once you understand how to pass callback functions and calling points. The callback function is the single piece of Python code that gets passed to E+ at runtime, the calling point is specifically when this happens.

mechyai's avatar mechyai  ( 2022-01-30 12:25:10 -0600 )edit

@prp92 see @jmarrec great notebook at "Run EnergyPlus in API mode" to see examples of how to use E+ as a library/API

mechyai's avatar mechyai  ( 2022-01-30 12:27:57 -0600 )edit

Your Answer

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

Add Answer


Question Tools



Asked: 2022-01-14 10:06:48 -0600

Seen: 590 times

Last updated: Feb 01 '22