source: mso/eml/controllers/ratio.mso @ 74

Last change on this file since 74 was 74, checked in by Paula Bettio Staudt, 16 years ago

Updated controllers files header

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.3 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 Copyright (C) 2004 - 2007 ALSOC, original code
9* from http://www.rps.eng.br Copyright (C) 2002-2004.
10* All rights reserved.
11*
12* EMSO is distributed under the therms of the ALSOC LICENSE as
13* available at http://www.enq.ufrgs.br/alsoc.
14*
15*----------------------------------------------------------------------
16* Model Ratio
17*-----------------------------------------------------------------------
18* - Inputs
19*               - Two input signals
20*
21* - Outputs
22*               - a output signal
23*
24*
25*-----------------------------------------------------------------------
26* Author: Tiago Osório
27* $Id: ratio.mso 74 2006-12-08 18:43:02Z paula $
28*---------------------------------------------------------------------*#
29
30using "types";
31 
32Model Ratio
33       
34        VARIABLES
35        input1 as Real (Brief="input signal 1");
36        input2 as Real (Brief="input signal 2");
37        output as Real (Brief="output signal");
38
39        EQUATIONS
40       
41        if abs(input2)>1e-5 then
42                "Calculate output"
43                input2*output=input1;
44        else
45                if input2>0 then
46                        "Calculate output"
47                        output=input1*1e5;
48                else
49                        "Calculate output"
50                        output=-input1*1e5;
51                end
52        end
53
54end
Note: See TracBrowser for help on using the repository browser.