[TRNSYS-users] If-clause

Alasdair Douglas a.douglas at safety-at-sea.co.uk
Tue Sep 1 03:10:52 PDT 2009


Hi Senne

 

All logical statements in the equation block will return 1 if they are true of 0 if they are false therefore you can create if statements by using addition/subtraction and multiplication.

 

This way shows how to do it using purely GT (Greater than) and LT (less than), though there are AND, OR and EQ commands that can be used.

 

FLOW = Gt(Lt(T,20) + Gt(Hour,1000),0)*Flow1 + Lt(Lt(T,20) + Gt(Hour,1000),1)*Flow2

 

Where flow1 is if the condition is met and flow 2 is when the condition is not met.

 

Hope this helps,

 

Alasdair

 

________________________________

From: senne plessers [mailto:senne_plessers at hotmail.com] 
Sent: 01 September 2009 10:50
To: trnsys-users at cae.wisc.edu
Subject: [TRNSYS-users] If-clause

 

Dear all,
 
is it possible to create an if-clause in an equation-component that
can use to or-button in the equation?
 
For example: if T < 20°C or Hour of the day > 1000
                  than flow=...
                  else flow=...
                  end
 
Is this possible or do I have to write my own algorithm?
 
Thanks in advance.
 
Best regards,
 
Senne Plessers

________________________________

Je hele online leven op één stek? Ontdek Windows Live! <http://www.microsoft.com/belux/nl/windows/windowslive/default.aspx> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20090901/da82f39e/attachment-0001.htm>


More information about the TRNSYS-users mailing list