#*------------------------------------------------------------------- * 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: Lead_Lag.mso 2012$ *---------------------------------------------------------------------*# using "types"; Model Lead_Lag ATTRIBUTES Pallete=true; Icon="icon/Lead-Lag"; Info="== Lead-Lag Unit == It takes an input variable and computes the respective value of the output variable according to a Lead-Lag Unit Dynamics."; PARAMETERS TauLD as time_sec(Brief="Lead Time constant"); TauLG as time_sec(Brief="Lag Time constant"); VARIABLES in In as Real(Brief="Input variable",Protected=true,PosX=0,PosY=0.5); x as Real(Brief="Intermediate variable",Hidden=true); out Out as Real(Brief="Output variable",Protected=true,PosX=1,PosY=0.5); EQUATIONS #* A lead-lag unit can be interpreted as a pure lag unit followed by a pure lead unit *# "Pure Lag Unit Dynamics (FOD)" TauLG*diff(x)+x=In; "Pure Lead Unit Dynamics (FOD)" Out=TauLD*diff(x)+x; INITIAL x=0; end