source: branches/gui/sample/case_study/Test_CS.mso @ 804

Last change on this file since 804 was 804, checked in by edsoncv, 13 years ago

Added Case study (dynamic and Steady State case) examples.
Added Sensitivity (only Steady State).

File size: 4.5 KB
RevLine 
[804]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 Case Study
17*--------------------------------------------------------------------
18*
19*----------------------------------------------------------------------
20* Author: Edson Cordeiro do Valle
21*
22*--------------------------------------------------------------------*#
23
24
25#Model with degrees of freedom complete in the model: 2 vars. and 2 eqs.
26#Warning : The units must be consistent in order to convert it correctly in the
27#CaseStudy section
28Model CS1
29
30        VARIABLES
31        X as Real (Default=20,Lower=-10,Upper=1000, final Unit = 'm');
32        Y as Real (Default=200,Lower=-10000,Upper=100000000, final Unit = 'm^2');
33               
34        PARAMETERS
35        b0 as Real(Default=7, final Unit = 'm');       
36        b1 as Real(Default=3, final Unit = 'm');       
37
38        EQUATIONS
39        #Y = b0*X^2 +b1^2*X;
40        b0*Y = b1^2*X;
41        Y = X ^ 2;
42       
43end
44
45#Model with degrees of freedom UNCOMPLETE in the model: 2 vars. and 1 eqs.,
46# need to specify 1 var. in the flowsheet section.
47#Warning : The units must be consistent in order to convert it correctly in the
48#CaseStudy section
49Model CS_flow1
50
51        VARIABLES
52        X as Real (Default=2,Lower=-10,Upper=1000, final Unit = 'm');
53        Y as Real (Default=2,Lower=-10000,Upper=100000000, final Unit = 'm^2');
54               
55        PARAMETERS
56        b0 as Real(Default=7, final Unit = 'm');       
57        b1 as Real(Default=3, final Unit = 'm');       
58
59        EQUATIONS
60       
61        b0*Y = b1^2*X;
62
63       
64end
65#Model with degrees of freedom complete in the model: 3 vars. and 3 eqs.       
66#Warning : The units must be consistent in order to convert it correctly in the
67#CaseStudy section
68Model CS3
69
70        VARIABLES
71        X as Real (Default=20,Lower=-10,Upper=1000, final Unit = 'm');
72        X2 as Real (Default=20,Lower=-10,Upper=1000, final Unit = 'm');
73        Y as Real (Default=200,Lower=-10000,Upper=100000000, final Unit = 'm^3');
74               
75        PARAMETERS
76        b0 as Real(Default=7, final Unit = 'm');       
77        b1 as Real(Default=3, final Unit = 'm');       
78
79        EQUATIONS
80        Y = b0*X2^2 +b1^2*X2 -50.73*'m^3';
81        b0*Y/'m' = b1^2*X;
82        Y = X ^ 2*'m';
83       
84end
85#Model with degrees of freedom UNCOMPLETE in the model: 3 vars. and 2 eqs.,
86# need to specify 1 var. in the flowsheet section.
87#Warning : The units must be consistent in order to convert it correctly in the
88#CaseStudy section
89Model CS_flow2
90
91        VARIABLES
92        X as Real (Default=20,Lower=-10,Upper=1000, final Unit = 'm');
93        X2 as Real (Default=20,Lower=-10,Upper=1000, final Unit = 'm');
94        Y as Real (Default=200,Lower=-10000,Upper=100000000, final Unit = 'm^2');
95               
96        PARAMETERS
97        b0 as Real(Default=7, final Unit = 'm');       
98        b1 as Real(Default=3, final Unit = 'm');       
99
100        EQUATIONS
101        Y = b0*X^2/'m' +b1^2*X2/'m' -50.73*'m^2';
102        #b0*Y = b1^2*X;
103        Y = X ^ 2;
104       
105end
106#No need to specify
107FlowSheet Test_CS1 as CS1
108
109       
110        OPTIONS
111        Dynamic = false;
112       
113end
114
115FlowSheet Test_CS_flow1 as CS_flow1
116
117        SPECIFY
118        X = 5 * 'm';
119               
120        OPTIONS
121        Dynamic = false;
122       
123end
124
125#No need to specify
126FlowSheet Teste_CS3 as CS3
127
128
129               
130        OPTIONS
131        Dynamic = false;
132       
133end
134
135FlowSheet Test_CS4 as CS_flow2
136
137        SPECIFY
138        X = 2.2*'m';   
139               
140        OPTIONS
141        Dynamic = false;
142       
143end
144# Test only parameters with vectors of type: [ 0: 1: 10]
145CaseStudy CS_parameter as Test_CS1
146
147        VARY
148       
149        b0 =[ 7 : 0.1: 7.2];
150        b1 =[ 3 : 0.1: 3.1];
151
152        RESPONSE
153       
154        Y ;
155
156end
157# Test only specifications with vectors of type: [ 0, 1, 2]
158CaseStudy CS_spec as Test_CS_flow1
159
160        VARY
161       
162        X = [5, 6, 7]; 
163
164        RESPONSE
165       
166        Y ;
167
168end
169# Test mixed: par. and spec. with both type of vectors
170CaseStudy CS2_par_spec as Test_CS_flow1
171
172        VARY
173       
174        X = [5, 6, 7]; 
175        b0 =[ 7 : 1: 10];       
176
177        RESPONSE
178       
179        Y ;
180
181end
182# Test mixed: par. and spec. with both type of vectors  and units
183CaseStudy CS_Unit_Vary as Test_CS4
184
185        VARY
186       
187        b0 =[ 7 : 0.01: 7.01]*'cm';
188        X =[ 220 : 1: 221]*'cm';
189       
190        RESPONSE
191
192        Y ;
193
194end
195# Test mixed: par. and spec. with both type of vectors  and units
196CaseStudy CS_Unit_Response as Test_CS4
197
198        VARY
199
200        b0 =[ 7 : 0.01: 7.01];
201        X =[ 220 : 1: 221]*'cm';
202
203        RESPONSE
204
205        Y'cm^2' ;
206
207end
208
209
Note: See TracBrowser for help on using the repository browser.