source: branches/gui/sample/controllers/tanksmodel.mso @ 554

Last change on this file since 554 was 190, checked in by Rafael de Pelegrini Soares, 16 years ago

Adapted PID models for the new language (the usage of switcher is still pending)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.1 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* Author: Rafael de Pelegrini Soares
17* $Id: tanksmodel.mso 190 2007-03-07 18:09:13Z rafael $
18*--------------------------------------------------------------------*#
19
20using "types";
21
22Model tank
23        PARAMETERS
24        A as area (Brief="Tank area", Default=2);
25
26        VARIABLES
27        k    as Real (Brief="Valve Constant", Unit = 'm^2.5/h', Default=4);
28    h    as length(Brief="Tank level");
29        Fin  as flow_vol(Brief="Input flow");
30out     Fout as flow_vol(Brief="Output flow");
31
32        EQUATIONS
33        "Mass balance"
34        diff(A*h) = Fin - Fout;
35       
36        "Valve equation"
37        Fout = k*sqrt(h);               
38end
Note: See TracBrowser for help on using the repository browser.