Last change
on this file since 998 was
944,
checked in by Argimiro Resende Secchi, 10 years ago
|
Adding Block-Oriented library by Jonathan Ospino Pinedo
|
File size:
1.4 KB
|
Line | |
---|
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: Saturation.mso 2012$ |
---|
13 | *---------------------------------------------------------------------*# |
---|
14 | |
---|
15 | using "types"; |
---|
16 | |
---|
17 | Model Saturation |
---|
18 | |
---|
19 | ATTRIBUTES |
---|
20 | Pallete=true; |
---|
21 | Icon="icon/Saturation"; |
---|
22 | Info="== Saturation block == |
---|
23 | |
---|
24 | It takes the input signal and compares it with the two limits |
---|
25 | of a range for normalizing its value between them. |
---|
26 | The resulting value is assigned to the output variable."; |
---|
27 | |
---|
28 | PARAMETERS |
---|
29 | Upper_Limit as Real(Brief="Upper limit of the range",Default=100); |
---|
30 | Lower_Limit as Real(Brief="Lower limit of the range",Default=0); |
---|
31 | |
---|
32 | VARIABLES |
---|
33 | in In as Real(Brief="Input without limiting",Protected=true,PosX=0,PosY=0.5); |
---|
34 | out Out as Real(Brief="Output once limited",Protected=true,PosX=1,PosY=0.5); |
---|
35 | |
---|
36 | EQUATIONS |
---|
37 | if In>=Upper_Limit then |
---|
38 | Out=Upper_Limit; |
---|
39 | else |
---|
40 | if In<=Lower_Limit then |
---|
41 | Out=Lower_Limit; |
---|
42 | else |
---|
43 | Out=In; |
---|
44 | end |
---|
45 | end |
---|
46 | |
---|
47 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.