Hi Raksit,<br><br>yes, by using an equation editor in the simulation studio. IF-THEN-ELSE can be described using GT (greater than), LT (less than), EQ (equal to), OR, and NOT.<br><br><b>As Mr. Michaël Kummert wrote:</b><br>
<i>'For example, let's assume you would like to use the following "if-then-else"<br>statement:<br><br>if (Z>0) then<br>X=Y1<br>else<br>X=Y2<br>endif<br>The following equation will do the same:<br><br>
X=GT(Z,0)*Y1+(1-GT(Z,0))*Y2<br><br>Please refer to the TRNSYS manual (p 2-8) for a description of available functions. <br>Please also note that if-then-else tests can lead to oscillations due to the<br>iterative nature of TRNSYS. E.g. you could implement a controller similar to<br>
Type 2 with equations. However, you have no way to tell TRNSYS to stop<br>changing a variable if the number of iterations is beyond a certain value<br>(which Type 2 does with the NSTICK parameter).'</i><br><br>Regards,<div>
<br></div><div>Miroslava<br><br>On 28 February 2013 00:31, leen peeters <<a href="mailto:l.f.r.peeters@gmail.com">l.f.r.peeters@gmail.com</a>> wrote:<br>> Raksit,<br>> <br>> you can 'translate it'...<br>
> say<br>> if A=1 then B else C<br>> <br>> you can make it<br>> (eql(A,1)*B)+(not(eql(A,1)*C)<br>> <br>> Leen<br>><br>><br>> On Thu, Feb 28, 2013 at 12:20 AM, Raksit Pattanapitoon <<a href="mailto:rp327@cornell.edu">rp327@cornell.edu</a>><br>
> wrote:<br>>><br>>> Dear all,<br>>><br>>> Does anyone know if there's TRNSYS component that can implement the<br>>> if-elseif statements? Any direction would be helpful. Thank you in advance!<br>
>><br>>> Best,<br>>> Raksit<br>>><br>>> --<br>>> Raksit Pattanapitoon<br>>> Cornell University Mechanical Engineering <br>>> B.S. 2012, M.Eng. 2013<br>>><br>>> _______________________________________________<br>
>> TRNSYS-users mailing list<br>>> <a href="mailto:TRNSYS-users@cae.wisc.edu">TRNSYS-users@cae.wisc.edu</a><br>>> <a href="https://mailman.cae.wisc.edu/listinfo/trnsys-users">https://mailman.cae.wisc.edu/listinfo/trnsys-users</a><br>
>><br>><br>><br>> _______________________________________________<br>> TRNSYS-users mailing list<br>> <a href="mailto:TRNSYS-users@cae.wisc.edu">TRNSYS-users@cae.wisc.edu</a><br>> <a href="https://mailman.cae.wisc.edu/listinfo/trnsys-users">https://mailman.cae.wisc.edu/listinfo/trnsys-users</a><br>
><br><br><br><br>-- <br>Miroslava Kavgic Dipling, MSc<br>PhD Candidate<br> <br>Bartlett School of Graduate Studies<br>University College London (UCL)<br>Central House<br>14 Upper Woburn Place<br>London WC1H 0NN UK<br>
<br><a href="mailto:E-mail%3Amiroslava.kavgic@gmail.com">E-mail:miroslava.kavgic@gmail.com</a></div>