Matlab Input Vector Issue with BCVTB and EnergyPlus

54 views
Skip to first unread message

Zachary Berzolla

unread,
Dec 10, 2019, 12:10:24 AM12/10/19
to bcvtb
Hello,

I am trying to simulate a district system in Matlab using E+ to determine the building loads and couple them via the BCVTB. I am currently using a simple example I edited from the provided BCVTB examples to test the connection but Matlab throws this error: "Error using exchangeDoubleWithSocket(line 83) Read 1 double values but expected to read 2."  I am trying to pass both relative humidity and temperature as inputs to Matlab from E+, so I define "input = [0,0]". The input definition is why it expects to read 2 doubles. I do have two output variables in my variables.cfg file so there should be two double values provided, but it does not seem to work. 

The simulation runs fine when I set the input to only 1 double, e.g. "input = [0]" however then I can only use temperature and not relative humidity. I'm running Matlab 2019b and E+ 9.1 but haven't had any compatibility issues running many other examples/test cases. 

Does anyone have any suggestions? I've attached my idf, Matlab, system, and variables.cfg files. I currently have the simulation set to run for only 3 months for testing expediency. 

Thank you in advance,
Zach 

Zachary Berzolla
Massachusetts Institute of Technology, S.M.B.T. Student
MIT Sustainable Design Lab
zbz at mit dot edu

 









BCVTBFiles.zip

Thierry Stephane Nouidui

unread,
Dec 10, 2019, 6:59:59 AM12/10/19
to bc...@googlegroups.com
I don't have Matlab so I cannot reproduce the problem. 
However I suggest to change your "input" from input=[0,0] to input=[0 0]? 
Let me know if that fixes the problem.

Thanks! 

Am Dienstag, 10. Dezember 2019, 06:10:30 MEZ hat Zachary Berzolla <zber...@gmail.com> Folgendes geschrieben:


--
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/b0da8933-3006-4d03-b76e-82d95922075f%40googlegroups.com.

Zachary Berzolla

unread,
Dec 10, 2019, 10:36:38 AM12/10/19
to bc...@googlegroups.com

Hi Thierry,

 

I made that change but it did not fix the problem. I have also tried rows instead of columns but that caused other issues.   

 

Best,

Zach

Thierry Stephane Nouidui

unread,
Dec 11, 2019, 3:32:12 AM12/11/19
to bc...@googlegroups.com
Hi Zach,

It is actually good that it works since they mean the same thing. I thought they may have been some issues with the conversion.

Now, I have looked at your system a bit more carefully and I suspect that the problem comes from the feedback you have from EnergyPlus to Matlab. 

The line which is fed back from the E+ simulator to the Matlab simulator carries only a single double value as opposed to a vector of doubles. This is the reason why Matlab is complaining (I think). 
If you were to feed the outputs of EnergyPlus (which is a vector of two doubles) straight to the input of Matlab (removing all the VectorDissambler), this may work. 

Note: You should remember that the order of the variables in your variables.cfg determines the order of the vector inputs.


Am Dienstag, 10. Dezember 2019, 16:36:39 MEZ hat Zachary Berzolla <zber...@gmail.com> Folgendes geschrieben:


Zachary Berzolla

unread,
Dec 11, 2019, 9:53:07 PM12/11/19
to bc...@googlegroups.com

Thierry,

 

Thank you! That was the issue. I was able to get the system running with both variables by deleting all the other connections and just putting in the feedback loop from E+ to Matlab.

 

Thank you again,

Zach

Cahyo Adisaputro

unread,
May 21, 2020, 11:44:01 AM5/21/20
to bcvtb
Hello Zach and Prof. Thierry

I was doing the simulation that Zach did and received this message :

Warning:.complexSystem2Share.Simulator terminated communication by sending flag = 1 at 7948800.0. Simulation will continue without updated values from client program.

Was that suppose to mean ? Is it related to NDBLMAX ?

Thank you in advance,
Cahyo Adisaputro

To unsubscribe from this group and stop receiving emails from it, send an email to bc...@googlegroups.com.

--
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 bc...@googlegroups.com.

--
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 bc...@googlegroups.com.

--
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 bc...@googlegroups.com.

Thierry Nouidui

unread,
May 22, 2020, 9:11:17 AM5/22/20
to bc...@googlegroups.com
I suggest to make sure that the simulation end time specified in all your simulator actors (EnergyPlus IDF, ...) are the same. You should also make sure that the end time defines in the SDFDirector matches those times.


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/c6b977f3-95ad-4e6c-82d3-ec7b38c0f8f9%40googlegroups.com.


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

Cahyo Adisaputro

unread,
May 28, 2020, 10:33:02 AM5/28/20
to bcvtb
Dear Dr.Thierry

Just read your suggestion, and it works very well now. Thanks a lot!

Regards
Cahyo Adisaputro

On Friday, 22 May 2020 15:11:17 UTC+2, Thierry Nouidui wrote:
I suggest to make sure that the simulation end time specified in all your simulator actors (EnergyPlus IDF, ...) are the same. You should also make sure that the end time defines in the SDFDirector matches those times.


Reply all
Reply to author
Forward
0 new messages