source: trunk/sample/miscellaneous/sample_if.mso @ 117

Last change on this file since 117 was 83, checked in by Paula Bettio Staudt, 17 years ago

Updated miscelaneous sample files header

  • 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* FlowSheet showing how to use the 'if' conditional.
17*--------------------------------------------------------------------
18* Author: Rafael de Pelegrini Soares
19* $Id: sample_if.mso 83 2006-12-08 20:29:34Z paula $
20*--------------------------------------------------------------------*#
21
22FlowSheet TestIF
23        VARIABLES
24        y as Real(Lower = -2);
25        x as Real;
26        z as Real;
27
28        EQUATIONS
29        if x < 1 then
30                diff(y) = 1 / "s";
31                z = 3;
32        else
33                diff(y) = - 1 / "s";
34                if y < 1 then
35                        z = x + y;
36                else
37                        z = 10;
38                end             
39        end
40       
41        diff(x) = y / "s";
42
43        INITIAL
44        x = 0;
45        y = 0;
46       
47        OPTIONS
48        time = [0:0.01:10];
49end
50
Note: See TracBrowser for help on using the repository browser.