[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [EnergyPlus_Support] EP Macro Eval





Joe,

Thank you very much for your response. I was able to find that my errors were all due to a lack of a space before and after the macro operator. Most of energyplus input syntax ignores white spaces, so I wouldv'e puzzled over this without your help.

Thanks again!

Jason


On Mon, Dec 10, 2012 at 6:55 PM, Joe Huang <yjhuang@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Jason,

Assuming that the syntax of EPMacros have not changed since it was borrowed from DOE-2 macros, the syntax for what you're trying to do should be:

  ##set1 X 0
  ##set1 X #[ X[] + 1 ]

Things to keep in mind are:
 (1)  I've never used #eval[], always just #[  ... ]
 (2)  put spaces before and after the operand, i.e., before and after the "+"
 (3) use the empty bracket inside the #[ ]  so that it knows that's a macro definition
 (4) there can only be one operand per bracket, so if there are several operands, use nested brackets
 (5) macros always take more time than you'd expect to get them to work.

Joe
Joe Huang
White Box Technologies, Inc.
346 Rheem Blvd., Suite 108D
Moraga CA 94556
yjhuang@xxxxxxxxxxxxxxxxxxxxxxxx
www.whiteboxtechnologies.com
(o) (925)388-0265
(c) (510)928-2683
"building energy simulations at your fingertips"

On 12/10/2012 5:21 PM, Jason Kirkpatrick wrote:
 

I am trying to understand the use of the #eval commands in the EP Macro auxiliary program,

I have copied the example directly from the Auxiliary Programs reference (pg 148):


##set1 x 0
##set1 x #eval[ x[]+1]

According the reference, x should be set to 0, and then redefined to 1 by the second command, but when I run this example, I get this error:

      #  64 # ##set1 x 0
      #  65 # ##set1 x #eval[ x[]+1]
  *ERROR***  **************** ===== ***********************************************************macro argument missing

Could anyone help me?  I am trying to take two macro definitions and define a third macro with the first two values:

##set1 Width[] 50
##set1 Length[] 40
##set1 Area[] #eval[Width[]*Length[]]

I feel like this should work.

Also any guidance as to combining parametric variables and ep macros would be appreciated (I think you can't combine them)  or alternatives to performing calculations on macros....

Thanks,

Jason K


 




__._,_.___


Primary EnergyPlus support is found at:
http://energyplus.helpserve.com or send a message to energyplus-support@xxxxxxxx

The primary EnergyPlus web site is found at:
http://www.energyplus.gov

The group web site is:
http://groups.yahoo.com/group/EnergyPlus_Support/

Attachments are currently allowed but be mindful that not everyone has a high speed connection.  Limit attachments to small files.

EnergyPlus Documentation is searchable.  Open EPlusMainMenu.pdf under the Documentation link and press the "search" button.




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___