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

Last change on this file since 8 was 1, checked in by Rafael de Pelegrini Soares, 17 years ago

Initial import of the library

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 843 bytes
Line 
1#*----------------------------------------------------------------------
2* Model Ratio
3*-----------------------------------------------------------------------
4* - Inputs
5*               - Two input signals
6*
7* - Outputs
8*               - a output signal
9*
10* - Assumptions
11*
12*
13*-----------------------------------------------------------------------
14* Author: Tiago Osório
15* $Id: ratio.mso 1 2006-06-20 17:33:53Z rafael $
16*---------------------------------------------------------------------*#
17
18using "types";
19 
20Model Ratio
21
22        PARAMETERS
23       
24        VARIABLES
25        input1 as Real (Brief="input signal 1");
26        input2 as Real (Brief="input signal 2");
27        output as Real (Brief="output signal");
28
29        EQUATIONS
30       
31        if abs(input2)>1e-5 then
32                "Calculate output"
33                output=input1*input2;
34        else
35                if input2>0 then
36                        "Calculate output"
37                        output=input1*1e-5;
38                else
39                        "Calculate output"
40                        output=-input1*1e-5;
41                end
42        end
43       
44        INITIAL
45end
Note: See TracBrowser for help on using the repository browser.