-
Notifications
You must be signed in to change notification settings - Fork 298
/
parameterTest8.mos
211 lines (207 loc) · 5.88 KB
/
parameterTest8.mos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
// name: parameterTest8
// keywords: parameter evaluation, structural
// status: correct
loadString("
model parameterTest8
parameter Boolean state = true;
Real v;
Real r;
equation
if state then // code which is removed during symbolic
der(v) = 1; // processing, if state=false
der(r) = 2;
else
v = time;
r = 2*time;
end if;
end parameterTest8;
"); getErrorString();
setCommandLineOptions("-d=evalParameterDump");
simulate(parameterTest8, simflags="-output=state,v,r"); getErrorString();
system("./parameterTest8 -override state=false -output=state,v,r"); getErrorString();
// Result:
// true
// ""
// true
//
// BEGINNING of preOptModule 'evaluateParameters'
// ********************************************************************************
//
//
// ########################################
// DAE before evaluating parameters
// ########################################
//
//
// unknown partition
// ========================================
//
// Variables (2)
// ========================================
// 1: r:VARIABLE() type: Real
// 2: v:VARIABLE() type: Real
//
//
// Equations (2, 2)
// ========================================
// 1/1 (1): der(v) = 1.0 [dynamic |0|0|0|0|]
// 2/2 (1): der(r) = 2.0 [dynamic |0|0|0|0|]
//
//
// no matching
//
//
//
// BackendDAEType: simulation
//
//
// Known variables only depending on parameters and constants - globalKnownVars (1)
// ========================================
// 1: state:PARAM(final = true ) = true type: Boolean
//
//
//
// Structural parameters and parameters with annotation(Evaluate=true) will be evaluated.
//
// START evaluating parameters:
// ================================================================================
// Number of parameters: 1
// Number of parameters selected for evaluation: 1
// Selected parameters for evaluation:
// 1
//
// Adjacency Matrix (row: equation)
// ========================================
// number of rows: 1
// 1:
//
// Transposed Adjacency Matrix (row: variable)
// ========================================
// number of rows: 1
// 1: 1
//
//
// After evaluating the selected parameters:
// ================================================================================
//
// All replacements:
// Replacements: (1)
// ========================================
// state -> true
//
// Replacements that will be replaced in the DAE:
// Replacements: (1)
// ========================================
// state -> true
//
// globalKnownVars (1)
// ========================================
// 1: state:PARAM(final = true ) = true type: Boolean
//
//
// mark: 1
// markarr: 1
//
//
// After sorting parameters:
// ================================================================================
// Order:
// 1
//
//
// After replacing the evaluated parameters in parameter bindings:
// ================================================================================
// All replacements:
// Replacements: (1)
// ========================================
// state -> true
//
// Replacements that will be replaced in the DAE:
// Replacements: (1)
// ========================================
// state -> true
//
// globalKnownVars (1)
// ========================================
// 1: state:PARAM(final = true ) = true type: Boolean
//
//
// mark: 1
// markarr: 1
//
//
// After replacing the evaluated parameters in variable bindings and start attributes:
// ================================================================================
// All replacements:
// Replacements: (1)
// ========================================
// state -> true
//
// Replacements that will be replaced in the DAE:
// Replacements: (1)
// ========================================
// state -> true
//
// globalKnownVars (1)
// ========================================
// 1: state:PARAM(final = true ) = true type: Boolean
//
//
// mark: 1
// markarr: 1
//
//
// ########################################
// DAE after replacing the evaluated parameters
// ########################################
//
//
// unknown partition
// ========================================
//
// Variables (2)
// ========================================
// 1: r:VARIABLE() type: Real
// 2: v:VARIABLE() type: Real
//
//
// Equations (2, 2)
// ========================================
// 1/1 (1): der(v) = 1.0 [dynamic |0|0|0|0|]
// 2/2 (1): der(r) = 2.0 [dynamic |0|0|0|0|]
//
//
// no matching
//
//
//
// BackendDAEType: simulation
//
//
// Known variables only depending on parameters and constants - globalKnownVars (1)
// ========================================
// 1: state:PARAM(final = true ) = true type: Boolean
//
//
//
// END of preOptModule 'evaluateParameters'
// ********************************************************************************
//
// record SimulationResult
// resultFile = "parameterTest8_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'parameterTest8', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = '-output=state,v,r'",
// messages = "LOG_SUCCESS | info | The initialization finished successfully without homotopy method.
// time=1,state=1,v=1,r=2
// LOG_SUCCESS | info | The simulation finished successfully.
// "
// end SimulationResult;
// "Warning: The initial conditions are not fully specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions(\"-d=initialization\").
// "
// stdout | warning | It is not possible to override the following quantity: state
// | | | | It seems to be structural, final, protected or evaluated or has a non-constant binding.
// LOG_SUCCESS | info | The initialization finished successfully without homotopy method.
// time=1,state=1,v=1,r=2
// LOG_SUCCESS | info | The simulation finished successfully.
// 0
// ""
// endResult