#*------------------------------------------------------------------- * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. * * This LIBRARY is free software; you can distribute it and/or modify * it under the therms of the ALSOC FREE LICENSE as available at * http://www.enq.ufrgs.br/alsoc. * * EMSO Copyright (C) 2004 - 2007 ALSOC, original code * from http://www.rps.eng.br Copyright (C) 2002-2004. * All rights reserved. * * EMSO is distributed under the therms of the ALSOC LICENSE as * available at http://www.enq.ufrgs.br/alsoc. * *-------------------------------------------------------------------- * FlowSheet showing how to use the 'if' conditional. *-------------------------------------------------------------------- * Author: Rafael de Pelegrini Soares * $Id: sample_if.mso 182 2007-03-06 00:02:04Z rafael $ *--------------------------------------------------------------------*# FlowSheet TestIF VARIABLES y as Real(Lower = -2); x as Real; z as Real; EQUATIONS if x < 1 then diff(y) = 1 / 's'; z = 3; else diff(y) = - 1 / 's'; if y < 1 then z = x + y; else z = 10; end end diff(x) = y / 's'; INITIAL x = 0; y = 0; OPTIONS TimeStep = 0.1; TimeEnd = 10.0; TimeUnit = 's'; end