First time here? Check our help page!
2

Variables in EnergyPlus-FMI and Modelica

Hi,

I am using EnergyPlus to create the FMI and imported to Modelica. For my model, I am "exporting" the room temperature (Troom) and external temperature(Texternal) from EnergyPlus to Modelica. However, although i have set in EnergyPlus both variables to be in an hourly interval, in Modelica i can see them in the communication timestep (900sec). Do you know if it is possible to export the variables from EnergyPlus to Modelica in an hourly interval? Also, is it possible to store those two variables (Troom, Texternal) as a matrix in Modelica?

Charalampos Angelopoulos's avatar
386
Charalampos Angelopoulos
asked 2017-11-01 12:30:31 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

2

If you set the communication step to 1 hour, then you get hourly values. Please see the external interface documentation.

I don't know what you mean by storing (Troom, Texternal) as a matrix in Modelica. These are real signals, which you can assemble into an array with Modelica.Blocks.Routing.Multiplex2. Modelica tools write their results as time series, so this is a matrix form with time in the first column and the results in the other columns. If you want to store old values in the Modelica model, such as for use in a controller, you can program a block that does this, or use Modelica.Blocks.Discrete.UnitDelay to delay the signal value by some sample period.

Michael Wetter's avatar
1.7k
Michael Wetter
answered 2017-11-01 18:55:48 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
2

thank you for the answer. Maybe i didn't explain myself very well. What i want to do is to use the real signals from Troom find the daily average of it and then use it as input to a controller. However, I am not sure how to find the daily average values from the Troom signal. I hope now it's more clear.

Charalampos Angelopoulos's avatar
386
Charalampos Angelopoulos
answered 2017-11-02 06:39:08 -0500
edit flag offensive 0 remove flag delete link

Comments

If you use the latest version of the master branch of the Buildings library, you can use Buildings.Controls.OBC.CDL.Continuous.MovingMean. Alternatively, you can copy its code from https://github.com/lbl-srg/modelica-b... to your project files.

If you need the average from midnight to midnight, you could integrate Troom, sample it at midnight, and delay it by 1 day to compute the average over the past day.

Michael Wetter's avatar Michael Wetter (2017-11-02 10:17:47 -0500) edit

Thank you,

i downloaded the latest version and i used the "Moving Mean" block and it seems to work perfectly fine for my case. Thank you again for the help.

Charalampos Angelopoulos's avatar Charalampos Angelopoulos (2017-11-02 10:57:43 -0500) edit
add a comment see more comments