#*------------------------------------------------------------------- * 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. * *-------------------------------------------------------------------- * Sample file for some useful functions. *-------------------------------------------------------------------- * Author: Gerson Balbueno Bicca * $Id: manipulation.mso 83 2006-12-14 20:29:34Z bicca $ *--------------------------------------------------------------------*# using "types"; #++++++++++++++++++++++++++++++++++++++++++++++++++++ # # EMSO sample file of some useful functions # # -------------------------------------------- # Function | EMSO Built-In # -------------------------------------------- # absolute value | abs(x) # maximum value | max(x) # minimum value | min(x) # sign of a real number | sign(x) : -1 if x < 0 # 1 if x > 0 # smallest integer | round(x) # #++++++++++++++++++++++++++++++++++++++++++++++++++++ FlowSheet Functions PARAMETERS Number(2) as Real; VARIABLES absolute(2) as Real (Brief ="abs function"); maximum(2) as Real (Brief ="max function"); minimum(2) as Real (Brief ="min function"); signal(2) as Real (Brief ="sign function"); # rounds(2) as Real (Brief ="round function"); SET Number = [-10.3,5.001]; EQUATIONS absolute = abs(Number); maximum = max(Number); minimum = min(Number); signal = sign(Number); # rounds = round(Number); OPTIONS Dynamic = false; end