source: trunk/eml/controllers/ratio.mso @ 301

Last change on this file since 301 was 292, checked in by gerson bicca, 16 years ago

added documentation in controllers models

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.2 KB
RevLine 
[74]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.
[1]14*-----------------------------------------------------------------------
15* Author: Tiago Osório
16* $Id: ratio.mso 292 2007-06-21 18:00:37Z bicca $
17*---------------------------------------------------------------------*#
18
19using "types";
20 
21Model Ratio
22       
[292]23        ATTRIBUTES
24        Pallete         = true;
25        Icon            = "Ratio";
26        Brief           = "Model Ratio.";
27        Info            =
28        "
29        - Inputs:
30        * Two input signals.
31       
32        - Outputs:
33        * One output signal.
34        ";
35       
[1]36        VARIABLES
37        input1 as Real (Brief="input signal 1");
38        input2 as Real (Brief="input signal 2");
39        output as Real (Brief="output signal");
40
41        EQUATIONS
42       
43        if abs(input2)>1e-5 then
44                "Calculate output"
[53]45                input2*output=input1;
[1]46        else
47                if input2>0 then
48                        "Calculate output"
[53]49                        output=input1*1e5;
[1]50                else
51                        "Calculate output"
[53]52                        output=-input1*1e5;
[1]53                end
54        end
[53]55
[1]56end
Note: See TracBrowser for help on using the repository browser.