#*------------------------------------------------------------------- * 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 is distributed under the terms of the ALSOC LICENSE as * available at http://www.enq.ufrgs.br/alsoc. *----------------------------------------------------------------------- * Author: Jonathan Ospino P. * $Id: Saturation.mso 2012$ *---------------------------------------------------------------------*# using "types"; Model Saturation ATTRIBUTES Pallete=true; Icon="icon/Saturation"; Info="== Saturation block == It takes the input signal and compares it with the two limits of a range for normalizing its value between them. The resulting value is assigned to the output variable."; PARAMETERS Upper_Limit as Real(Brief="Upper limit of the range",Default=100); Lower_Limit as Real(Brief="Lower limit of the range",Default=0); VARIABLES in In as Real(Brief="Input without limiting",Protected=true,PosX=0,PosY=0.5); out Out as Real(Brief="Output once limited",Protected=true,PosX=1,PosY=0.5); EQUATIONS if In>=Upper_Limit then Out=Upper_Limit; else if In<=Lower_Limit then Out=Lower_Limit; else Out=In; end end end