[944] | 1 | #*------------------------------------------------------------------- |
---|
| 2 | * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. |
---|
| 3 | * |
---|
| 4 | * This LIBRARY is free software; you can distribute it and/or modify |
---|
| 5 | * it under the therms of the ALSOC FREE LICENSE as available at |
---|
| 6 | * http://www.enq.ufrgs.br/alsoc. |
---|
| 7 | * |
---|
| 8 | * EMSO is distributed under the terms of the ALSOC LICENSE as |
---|
| 9 | * available at http://www.enq.ufrgs.br/alsoc. |
---|
| 10 | *----------------------------------------------------------------------- |
---|
| 11 | * Author: Jonathan Ospino P. |
---|
| 12 | * $Id: Lead_Lag.mso 2012$ |
---|
| 13 | *---------------------------------------------------------------------*# |
---|
| 14 | |
---|
| 15 | using "types"; |
---|
| 16 | |
---|
| 17 | Model Lead_Lag |
---|
| 18 | |
---|
| 19 | ATTRIBUTES |
---|
| 20 | Pallete=true; |
---|
| 21 | Icon="icon/Lead-Lag"; |
---|
| 22 | Info="== Lead-Lag Unit == |
---|
| 23 | |
---|
| 24 | It takes an input variable and computes |
---|
| 25 | the respective value of the output variable according |
---|
| 26 | to a Lead-Lag Unit Dynamics."; |
---|
| 27 | |
---|
| 28 | PARAMETERS |
---|
| 29 | TauLD as time_sec(Brief="Lead Time constant"); |
---|
| 30 | TauLG as time_sec(Brief="Lag Time constant"); |
---|
| 31 | |
---|
| 32 | VARIABLES |
---|
| 33 | in In as Real(Brief="Input variable",Protected=true,PosX=0,PosY=0.5); |
---|
| 34 | x as Real(Brief="Intermediate variable",Hidden=true); |
---|
| 35 | out Out as Real(Brief="Output variable",Protected=true,PosX=1,PosY=0.5); |
---|
| 36 | |
---|
| 37 | EQUATIONS |
---|
| 38 | |
---|
| 39 | #* A lead-lag unit can be interpreted as a pure lag unit |
---|
| 40 | followed by a pure lead unit |
---|
| 41 | *# |
---|
| 42 | |
---|
| 43 | "Pure Lag Unit Dynamics (FOD)" |
---|
| 44 | TauLG*diff(x)+x=In; |
---|
| 45 | |
---|
| 46 | "Pure Lead Unit Dynamics (FOD)" |
---|
| 47 | Out=TauLD*diff(x)+x; |
---|
| 48 | |
---|
| 49 | INITIAL |
---|
| 50 | x=0; |
---|
| 51 | end |
---|