First time here? Check out the Help page!

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 9 years ago

Rohini's avatar

updated 8 years ago

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.

Preview: (hide)

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__  ( 9 years ago )
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  ( 9 years ago )
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  ( 9 years ago )
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  ( 9 years ago )

1 Answer

Sort by » oldest newest most voted
3

answered 9 years ago

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.

Preview: (hide)
link

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: 9 years ago

Seen: 248 times

Last updated: Dec 18 '15