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

EMS negative number - not a question

asked 2015-08-24 15:51:27 -0600

Rohini's avatar

updated 2017-04-02 20:05:56 -0600

It took me couple of hours to figure out that EMS (in energyplus) cannot use negative numbers. Any negative number has to be written as 0-number. For eg., -1 is 0 - 1. Since nothing showed up in unmet-hoooooours regarding this, I thought I will save some person future hours by posting this.

edit retag flag offensive close merge delete

Comments

2

Thanks @Rohini. You might want to open up a GitHub issue for this (https://github.com/NREL/EnergyPlus/is...).

__AmirRoth__'s avatar __AmirRoth__  ( 2015-08-24 15:59:33 -0600 )edit
3

Note: this is documented in the EMS Application Guide, albeit as a comment in the example file here. The issue could be submitted as a request for better Erl documentation.

ericringold's avatar ericringold  ( 2015-08-24 16:18:40 -0600 )edit
3

There are situations where the parser now throws in a zero to handle the unary minus operator as you would expect (eg. Set x = - 1,). But in general it is always safer to use ( 0 - 1) in complex expressions.

Archmage's avatar Archmage  ( 2015-08-24 16:36:18 -0600 )edit
2

Another non-intuitive EMS behavior: If you reference a variable that was never previously defined/initialized, it is automatically defaulted to zero. So, for example, if you reference an indoor temperature variable that you intend to add an EMS sensor for, but forget to add the sensor, the indoor temperature variable will have a value of zero and no error is reported. It's easy for a subtle bug like this in your EMS program to go undetected.

See https://github.com/NREL/EnergyPlus/is...

shorowit's avatar shorowit  ( 2015-08-24 17:33:00 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2015-12-18 13:31:47 -0600

FYI, the use of negative numbers has been corrected in the latest release of V8.4 and should be available for download today or very soon. Keep in mind that not all possible uses of a negative sign may have been corrected at this point in time.

edit flag offensive delete link more

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

1 follower

Stats

Asked: 2015-08-24 15:51:27 -0600

Seen: 237 times

Last updated: Dec 18 '15