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

EMS in EnergyPlus: problem with the logistic regression equation

asked Jul 10

paulabf's avatar

updated Jul 11

I'm using EMS to set a logistic regression equation and predict the window status in the simulation. However, when I include the entire equation (B0 + B1 * RH + B2 * CO2 + B3 * Top * RH), the windows remain always closed (0). I tried changing the parameters, and the window status varied between 0 and 1 with these equations:

B0 + B1 * RH + B1 * CO2 + B1 * Top * RH

B0 + B1 * RH + B2 * CO2 + B1 * Top * RH

B0 + B1 * RH + B3 * CO2 + B1 * Top * RH

If I replace B1 with B2 or B3 in the interction with Top*RH or if I remove that part of the equation (B0 + B1 * RH + B2 * CO2), the window stays closed the whole time as well.

My input objects for 'EnergyManagementSystem:Program' are:

image description

Thank you for any help!

Preview: (hide)

Comments

@paulabf it doesn't look like the lines of your EMS Program were added correctly -- can you please edit your post and try to include that again?

Aaron Boranian's avatar Aaron Boranian  ( Jul 10 )

What calling point are you using (EMS:ProgramCallingManager). Also, use Output:EnergyManagementSystem with the field EnergyPlus Runtime Language Debug Output Level and look at the eplusout.edd and you'll see how each line is evaluated.

Julien Marrec's avatar Julien Marrec  ( Jul 16 )

1 Answer

Sort by » oldest newest most voted
3

answered Jul 10

updated Jul 11

This may or may not be the issue, but you should use lots of parentheses to make sure compound expressions are evaluated in the order you desire. For example, instead of:

B0 + B1 * RH + B1 * CO2 + B1 * Top * RH

use:

B0 + (B1 * RH) + (B1 * CO2) + (B1 * Top * RH)

You can read about this more in the EMS Expressions documentation where it states:

For complicated expressions, it helps to make heavy use of parentheses in your equations. By using parentheses with proper algebraic evaluation in mind to group terms, you can help the Erl parser. The language processor is simplistic compared to a full-blown programming language and sometimes has problems applying the rules of algebra. It is safer to err on the side of extra parentheses and to inspect the results of complex expressions in the EDD output.

Preview: (hide)
link

Comments

And if that doesn't help, you could try splitting the expression into multiple lines of EMS to ensure that each part is evaluating as you expect.

shorowit's avatar shorowit  ( Jul 10 )

Your Answer

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

Add Answer

Training Workshops

Careers

Question Tools

Stats

Asked: Jul 10

Seen: 161 times

Last updated: Jul 11 '24