EnergyPlus/Matlab co-simulation using BCVTB

128 views
Skip to first unread message

Zakaria Ouaouja

unread,
Nov 18, 2022, 11:02:30 AM11/18/22
to bcvtb

I am trying to co-simulate EnergyPlus and Matlab using BCVTB. During this simulation, some data will be exchanged between EnergyPlus and Matlab.

I was wondering if it is possible to exchange this data at each time step of EnergyPlus. 

For example, if the number of time steps per hour in EnergyPlus is set to 60 (as shown in the screenshot), which is a time step of one hour, is it possible to exchange these variables every hour?

Also, I tried to run the examples provided by BCVTB, and I always get the following error.

Screenshot 11-18 170010.png

Screenshot 11-18 170029.png

Thierry Nouidui

unread,
Nov 23, 2022, 2:15:58 AM11/23/22
to bc...@googlegroups.com
Yes, it is possible using the BCVTB to exchange data between Matlab and EnergyPlus at the EnergyPlus timestep.
I suggest reading the BCVTB documentation to understand what you need to do to set up your system properly.

Regarding your last comment: Which version of EnergyPlus did you use to run that example model?

Thanks!

Screenshot 2022-11-18 164857.png

--
You received this message because you are subscribed to the Google Groups "bcvtb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bcvtb+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bcvtb/83fb9928-b6a5-4f2b-9a2e-edec4da2e5a1n%40googlegroups.com.


--
Prof. Thierry Nouidui
Nouidui Consulting Group
https://nouidui.com/index.php/consulting/

Zakaria Ouaouja

unread,
Dec 10, 2022, 9:40:21 AM12/10/22
to bcvtb
Thank you, Prof.  Nouidui for your reply.
To answer your question, I used EnergyPlusV8-7-0 and ran the example ''ePlus85-variable (updated to 8.7)'' and 1.6.0 version for BCVTB.
After some testing, in which I changed programArguments from "-w ../ePlusWeather/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw -p EMSWindowShadeControl -s C -x -m -r EMSWindowShadeControl.idf" to "EMSWindowShadeControl USA_CA_San.Francisco.Intl.AP.724940_TMY3" (based on the ePlus82-variable example), I got another error, as shown in the screenshot below.
I am only using the example to understand how to use BCVTB using the examples that come with it.
My goal is to exchange the air temperature inside the zone calculated by EnergyPlus and send it to Matlab. This latter used the temperature to calculate a thermal load and send it back to EnergyPlus. And these data should be exchanged every timestep.

Kınd regerds

Please find below a link to example files.

Thierry Nouidui

unread,
Dec 15, 2022, 5:28:12 AM12/15/22
to bc...@googlegroups.com
I have tried to investigate your problem and it seems somehow to be related to the version of EneryPlus you are using.

I have run your system model using EnergyPlus 8.7.0 and saw the issue you have been encountering. 
If you look at the error file you will see the following:
ExternalInterface: Simulation model has no variable "ERL SHADING CONTROL STATUS" with key "EMS".
In other words, EnergyPlus version 8.7.0 doesn't seem to find that variable though it is defined.

I then decided to use another version of EnergyPlus (e.g. 9.3.0)  to see if the error was reproducible. 
I couldn't see that problem anymore. I suspect some issues in the way ERL variables were handled in that specific version of E+.

If it is not a hard requirement to use EnergyPlus version 8.7.0, I suggest using some of the most recent versions.

If you need version 9.3.0 of the example files, you could get them 


For other versions, just change the version number in the URL above. This will avoid the nasty need of transitioning your files.


Zakaria Ouaouja

unread,
Dec 22, 2022, 7:54:11 AM12/22/22
to bcvtb
Thank you, Prof. Nouidui for your help.
Yes, indeed, the problem was related to the version of EneryPlus.
I tested the example using E+V22.2 and it worked without any problem.
Reply all
Reply to author
Forward
0 new messages