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

[TRNSYS-users] if elseif else statement in equations



Hey everyone,

 

i found this entry about implementing if else statements: http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/2013-February/024732.html

I’m wondering if ist possible to extend this to an if elseif else statement.

I want the output X to be X=1 if the temperature is t<5, X=2 for t>=5.and.t<15 and X=3 for t>=15.

 

I tried this, but it’s wrong and doesnt work:
X = GT(T,GT(T,15)*S+(1-GT(T,15))*U)*U+(1-GT(T,5))*W with S=3,U=2and W=1.

 

If anyone knows a solution i’d appreciate it.

 

Best regards
Jan