source: mso/sample/miscellaneous/sample_if.mso @ 51

Last change on this file since 51 was 32, checked in by Argimiro Resende Secchi, 16 years ago

clean up.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 858 bytes
Line 
1#*---------------------------------------------------------------------
2* This file is property of the author and cannot be used, copyed
3* or modified without permission.
4*
5* Copyright (C) 2002-2005  the author
6*----------------------------------------------------------------------
7* Author: Rafael de Pelegrini Soares
8* $Id: sample_if.mso 32 2006-09-23 00:16:00Z arge $
9*----------------------------------------------------------------------
10*
11* EMSO sample file.
12*
13* FlowSheet showing how to use the 'if' conditional.
14*
15*-------------------------------------------------------------------*#
16
17FlowSheet TestIF
18        VARIABLES
19        y as Real(Lower = -2);
20        x as Real;
21        z as Real;
22
23        EQUATIONS
24        if x < 1 then
25                diff(y) = 1 / "s";
26                z = 3;
27        else
28                diff(y) = - 1 / "s";
29                if y < 1 then
30                        z = x + y;
31                else
32                        z = 10;
33                end             
34        end
35       
36        diff(x) = y / "s";
37
38        INITIAL
39        x = 0;
40        y = 0;
41       
42        OPTIONS
43        time = [0:0.01:10];
44end
45
Note: See TracBrowser for help on using the repository browser.