source: branches/gui/eml/controllers/ratio.mso @ 870

Last change on this file since 870 was 683, checked in by gerson bicca, 15 years ago

updated PID controller

  • 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 683 2008-11-19 21:21:38Z bicca $
17*---------------------------------------------------------------------*#
18
19using "types";
20 
21Model Ratio
22       
[292]23        ATTRIBUTES
[683]24        Pallete         = false;
[306]25        Icon            = "icon/Ratio";
[292]26        Brief           = "Model Ratio.";
27        Info            =
[354]28"== Inputs ==
29* Two input signals.
[292]30       
[354]31== Outputs ==
32* One output signal.
33";
[292]34       
[1]35        VARIABLES
36        input1 as Real (Brief="input signal 1");
37        input2 as Real (Brief="input signal 2");
38        output as Real (Brief="output signal");
39
40        EQUATIONS
41       
42        if abs(input2)>1e-5 then
43                "Calculate output"
[53]44                input2*output=input1;
[1]45        else
46                if input2>0 then
47                        "Calculate output"
[53]48                        output=input1*1e5;
[1]49                else
50                        "Calculate output"
[53]51                        output=-input1*1e5;
[1]52                end
53        end
[53]54
[1]55end
Note: See TracBrowser for help on using the repository browser.