source: branches/newlanguage/sample/miscellaneous/sample_manipulation.mso @ 182

Last change on this file since 182 was 182, checked in by Rafael de Pelegrini Soares, 15 years ago

More updates on samples to run on the new language

File size: 1.9 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* Sample file for some useful functions.
17*--------------------------------------------------------------------
18* Author: Gerson Balbueno Bicca
19* $Id: manipulation.mso 83 2006-12-14 20:29:34Z bicca $
20*--------------------------------------------------------------------*#
21using "types";
22 
23#++++++++++++++++++++++++++++++++++++++++++++++++++++
24#
25#               EMSO sample file of some useful functions
26#
27#      --------------------------------------------
28#               Function                        |         EMSO Built-In
29#      --------------------------------------------
30#               absolute value                  |       abs(x)
31#               maximum value                   |       max(x)
32#               minimum value                   |   min(x)
33#               sign of a real number   |       sign(x)  : -1 if x < 0
34#                                                                                          1  if x > 0
35#               smallest integer        |       round(x)
36#
37#++++++++++++++++++++++++++++++++++++++++++++++++++++
38
39FlowSheet Functions
40
41        PARAMETERS
42       
43        Number(2)      as Real;
44       
45        VARIABLES
46       
47        absolute(2)     as Real  (Brief ="abs function");
48        maximum(2)      as Real  (Brief ="max function");
49        minimum(2)              as Real  (Brief ="Natural log function");
50        signal(2)       as Real  (Brief ="square root function");
51        rounds(2)       as Real  (Brief ="square root function");
52       
53        SET
54       
55        Number  = [-10.3,5.001];
56       
57        EQUATIONS
58       
59        absolute        = abs(Number);
60        maximum         = max(Number);
61        minimum         = min(Number);
62        signal          = sign(Number);
63        rounds          = round(Number);
64
65        OPTIONS
66        Dynamic = false;
67       
68end
Note: See TracBrowser for help on using the repository browser.