-
Notifications
You must be signed in to change notification settings - Fork 299
/
bug_2841.mos
309 lines (305 loc) · 21.3 KB
/
bug_2841.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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
// name: bug_2841
// keywords: nonlinear system solver
// status: correct
// cflags:
// teardown_command: rm -rf nonlinearSolverTests.bug_2841* _nonlinearSolverTests.bug_2841* output.log
loadString("
within ;
package nonlinearSolverTests
model bug_2841
parameter Real xn = 1e5;
parameter Real yn = 1e-5;
Real x(start=0.5*xn, nominal=xn);
Real y(start=0.5*yn, nominal=yn);
equation
0 = -(x/xn)*exp(-(x/xn)*(y/yn))-1;
0 = (y/yn)*exp(-(x/xn)+(y/yn))-1;
end bug_2841;
end nonlinearSolverTests;
"); getErrorString();
simulate(nonlinearSolverTests.bug_2841, stopTime=0.0, simflags="-lv=LOG_INIT,LOG_NLS_V"); getErrorString();
// Result:
// true
// ""
// record SimulationResult
// resultFile = "nonlinearSolverTests.bug_2841_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 0.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'nonlinearSolverTests.bug_2841', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = '-lv=LOG_INIT,LOG_NLS_V'",
// messages = "LOG_NLS | info | initialize mixed system solvers
// | | | | | 0 mixed systems
// LOG_NLS | info | initialize non-linear system solvers
// | | | | | 2 non-linear systems
// LOG_INIT | info | ### START INITIALIZATION ###
// LOG_INIT | info | updating min-values
// LOG_INIT | info | updating max-values
// LOG_INIT | info | updating nominal-values
// | | | | | y(nominal=1e-05)
// | | | | | x(nominal=100000)
// LOG_INIT | info | updating primary start-values
// | | | | | updated start value: y(start=5e-06)
// | | | | | updated start value: x(start=50000)
// LOG_NLS | info | update static data of non-linear system solvers
// LOG_INIT | info | initialization method: symbolic [solves the initialization problem symbolically - default]
// LOG_NLS_V | info | ------------------------------------------------------
// LOG_NLS_V | info | SOLVING NON-LINEAR SYSTEM USING MIXED SOLVER (Newton/Homotopy solver)
// LOG_NLS_V | info | EQUATION NUMBER: 7
// LOG_NLS_V | info | TIME: 0.0000000000e+00
// LOG_NLS_V | info | number of function calls (so far!): 0
// LOG_NLS_V | info | System values [2-dim]
// | | | | | 50000 5e-06
// LOG_NLS_V | info | Nominal values [2-dim]
// | | | | | 100000 1e-05
// LOG_NLS_V | info | Scaling values [3-dim]
// | | | | | 100000 1e-05 1
// LOG_NLS_V | info | x0 [2-dim]
// | | | | | 50000 5e-06
// LOG_NLS_V | info | regular initial point!!!
// LOG_NLS_V | info | ******************************************************
// LOG_NLS_V | info | NEWTON SOLVER STARTED! equation number: 7
// LOG_NLS_V | info | maximum number of function evaluation: 200
// LOG_NLS | info | nls status
// | | | | | variables
// | | | | | [ 1] x = 50000 nom = 100000 min = -1.7976931e+308 max = 1.7976931e+308
// | | | | | [ 2] y = 5e-06 nom = 1e-05 min = -1.7976931e+308 max = 1.7976931e+308
// LOG_NLS_V | info | Iteration: 1
// LOG_NLS_V | info | newton step
// | | | | | variables
// | | | | | [ 1] x = -205103.81 step = -255103.81 old = 50000
// | | | | | [ 2] y = -1.7012708e-07 step = -5.1701271e-06 old = 5e-06
// LOG_NLS_V | info | Need to damp, grad_f = -4.3608668960e+00
// LOG_NLS_V | info | Need to damp, error_f = 1.4766290827e+00
// LOG_NLS_V | info | Need to damp this!! lambda1 = 1.0000000000e+00
// LOG_NLS_V | info | Need to damp, error_f1 = 1.4962663898e+00
// LOG_NLS_V | info | Need to damp, forced error = 1.7443467584e+00
// LOG_NLS_V | info | Need to damp this!! lambda2 = 4.9339484000e-01
// LOG_NLS_V | info | Need to damp, error_f2 = 3.4295060947e-01
// LOG_NLS_V | info | Need to damp this!! lambda = 6.0083766485e-01
// LOG_NLS_V | info | Need to damp, error_f1 = 4.3940025040e-01
// LOG_NLS_V | info | function values: [2-dim]
// | | | | | -0.35724392 0.25583073
// LOG_NLS_V | info | scaled function values: [2-dim]
// | | | | | -0.17862196 0.32849316
// LOG_NLS_V | info | error measurements:
// LOG_NLS_V | info | delta_x = 2.5510381250e+05
// LOG_NLS_V | info | delta_x_scaled = 2.6029017761e+00
// LOG_NLS_V | info | newtonXTol = 1.0000000000e-12
// LOG_NLS_V | info | error_f = 4.3940025040e-01
// LOG_NLS_V | info | error_f_scaled = 3.7391651425e-01
// LOG_NLS_V | info | newtonFTol = 1.0000000000e-12
// LOG_NLS_V | info | Iteration: 2
// LOG_NLS_V | info | newton step
// | | | | | variables
// | | | | | [ 1] x = -73564.004 step = 29711.975 old = -103275.98
// | | | | | [ 2] y = 3.2515367e-06 step = 1.3579438e-06 old = 1.8935929e-06
// LOG_NLS_V | info | Need to damp, grad_f = -3.8614516011e-01
// LOG_NLS_V | info | Need to damp, error_f = 4.3940025040e-01
// LOG_NLS_V | info | Need to damp this!! lambda1 = 1.0000000000e+00
// LOG_NLS_V | info | Need to damp, error_f1 = 8.9380216642e-02
// LOG_NLS_V | info | Need to damp, forced error = 1.5445806404e-01
// LOG_NLS_V | info | function values: [2-dim]
// | | | | | -0.060740676 -0.06556976
// LOG_NLS_V | info | scaled function values: [2-dim]
// | | | | | -0.012979095 -0.023836877
// LOG_NLS_V | info | error measurements:
// LOG_NLS_V | info | delta_x = 2.9711975486e+04
// LOG_NLS_V | info | delta_x_scaled = 3.2668067324e-01
// LOG_NLS_V | info | newtonXTol = 1.0000000000e-12
// LOG_NLS_V | info | error_f = 8.9380216642e-02
// LOG_NLS_V | info | error_f_scaled = 2.7141364009e-02
// LOG_NLS_V | info | newtonFTol = 1.0000000000e-12
// LOG_NLS_V | info | Iteration: 3
// LOG_NLS_V | info | newton step
// | | | | | variables
// | | | | | [ 1] x = -77453.464 step = -3889.4602 old = -73564.004
// | | | | | [ 2] y = 3.3147787e-06 step = 6.3242033e-08 old = 3.2515367e-06
// LOG_NLS_V | info | Need to damp, grad_f = -1.5977646254e-02
// LOG_NLS_V | info | Need to damp, error_f = 8.9380216642e-02
// LOG_NLS_V | info | Need to damp this!! lambda1 = 1.0000000000e+00
// LOG_NLS_V | info | Need to damp, error_f1 = 2.2072982312e-03
// LOG_NLS_V | info | Need to damp, forced error = 6.3910585016e-03
// LOG_NLS_V | info | function values: [2-dim]
// | | | | | 0.0018199512 0.0012489768
// LOG_NLS_V | info | scaled function values: [2-dim]
// | | | | | 0.00038176671 0.00055228655
// LOG_NLS_V | info | error measurements:
// LOG_NLS_V | info | delta_x = 3.8894602256e+03
// LOG_NLS_V | info | delta_x_scaled = 3.9405401054e-02
// LOG_NLS_V | info | newtonXTol = 1.0000000000e-12
// LOG_NLS_V | info | error_f = 2.2072982312e-03
// LOG_NLS_V | info | error_f_scaled = 6.7139128116e-04
// LOG_NLS_V | info | newtonFTol = 1.0000000000e-12
// LOG_NLS_V | info | Iteration: 4
// LOG_NLS_V | info | newton step
// | | | | | variables
// | | | | | [ 1] x = -77390.717 step = 62.746972 old = -77453.464
// | | | | | [ 2] y = 3.3118182e-06 step = -2.9605095e-09 old = 3.3147787e-06
// LOG_NLS_V | info | Need to damp, grad_f = -9.7443309630e-06
// LOG_NLS_V | info | Need to damp, error_f = 2.2072982312e-03
// LOG_NLS_V | info | Need to damp this!! lambda1 = 1.0000000000e+00
// LOG_NLS_V | info | Need to damp, error_f1 = 1.4052454980e-06
// LOG_NLS_V | info | Need to damp, forced error = 3.8977323852e-06
// LOG_NLS_V | info | function values: [2-dim]
// | | | | | 1.2530283e-06 6.3610929e-07
// LOG_NLS_V | info | scaled function values: [2-dim]
// | | | | | 2.4931307e-07 2.6503402e-07
// LOG_NLS_V | info | error measurements:
// LOG_NLS_V | info | delta_x = 6.2746972448e+01
// LOG_NLS_V | info | delta_x_scaled = 6.9380430845e-04
// LOG_NLS_V | info | newtonXTol = 1.0000000000e-12
// LOG_NLS_V | info | error_f = 1.4052454980e-06
// LOG_NLS_V | info | error_f_scaled = 3.6386816259e-07
// LOG_NLS_V | info | newtonFTol = 1.0000000000e-12
// LOG_NLS_V | info | Iteration: 5
// LOG_NLS_V | info | newton step
// | | | | | variables
// | | | | | [ 1] x = -77390.689 step = 0.027596879 old = -77390.717
// | | | | | [ 2] y = 3.3118158e-06 step = -2.4308011e-12 old = 3.3118182e-06
// LOG_NLS_V | info | Need to damp, grad_f = -3.9494298196e-12
// LOG_NLS_V | info | Need to damp, error_f = 1.4052454980e-06
// LOG_NLS_V | info | Need to damp this!! lambda1 = 1.0000000000e+00
// LOG_NLS_V | info | Need to damp, error_f1 = 5.5523886249e-13
// LOG_NLS_V | info | Need to damp, forced error = 1.5797719278e-12
// LOG_NLS_V | info | function values: [2-dim]
// | | | | | 5.1558757e-13 2.0605739e-13
// LOG_NLS_V | info | scaled function values: [2-dim]
// | | | | | 1.0271701e-13 8.595627e-14
// LOG_NLS_V | info | error measurements:
// LOG_NLS_V | info | delta_x = 2.7596879198e-02
// LOG_NLS_V | info | delta_x_scaled = 3.6775904375e-07
// LOG_NLS_V | info | newtonXTol = 1.0000000000e-12
// LOG_NLS_V | info | error_f = 5.5523886249e-13
// LOG_NLS_V | info | error_f_scaled = 1.3393753756e-13
// LOG_NLS_V | info | newtonFTol = 1.0000000000e-12
// LOG_NLS_V | info | Iteration: 6
// LOG_NLS_V | info | newton step
// | | | | | variables
// | | | | | [ 1] x = -77390.689 step = 7.4635041e-09 old = -77390.689
// | | | | | [ 2] y = 3.3118158e-06 step = -1.0970356e-18 old = 3.3118158e-06
// LOG_NLS_V | info | Need to damp, grad_f = -6.1658038884e-25
// LOG_NLS_V | info | Need to damp, error_f = 5.5523886249e-13
// LOG_NLS_V | info | Need to damp this!! lambda1 = 1.0000000000e+00
// LOG_NLS_V | info | Need to damp, error_f1 = 1.1102230246e-16
// LOG_NLS_V | info | Need to damp, forced error = 2.4663215554e-25
// LOG_NLS_V | info | function values: [2-dim]
// | | | | | 0 -1.110223e-16
// LOG_NLS_V | info | scaled function values: [2-dim]
// | | | | | 0 -4.6312676e-17
// LOG_NLS_V | info | error measurements:
// LOG_NLS_V | info | delta_x = 7.4635040900e-09
// LOG_NLS_V | info | delta_x_scaled = 1.3268481481e-13
// LOG_NLS_V | info | newtonXTol = 1.0000000000e-12
// LOG_NLS_V | info | error_f = 1.1102230246e-16
// LOG_NLS_V | info | error_f_scaled = 4.6312676255e-17
// LOG_NLS_V | info | newtonFTol = 1.0000000000e-12
// LOG_NLS_V | info | NEWTON SOLVER DID CONVERGE TO A SOLUTION!!!
// LOG_NLS_V | info | nls status
// | | | | | variables
// | | | | | [ 1] x = -77390.689 nom = 100000 min = -1.7976931e+308 max = 1.7976931e+308
// | | | | | [ 2] y = 3.3118158e-06 nom = 1e-05 min = -1.7976931e+308 max = 1.7976931e+308
// LOG_NLS_V | info | ******************************************************
// LOG_NLS_V | info | SYSTEM SOLVED
// LOG_NLS_V | info | homotopy method: 0
// LOG_NLS_V | info | number of function calls: 9
// LOG_NLS | info | nls status
// | | | | | variables
// | | | | | [ 1] x = -77390.689 nom = 100000 min = -1.7976931e+308 max = 1.7976931e+308
// | | | | | [ 2] y = 3.3118158e-06 nom = 1e-05 min = -1.7976931e+308 max = 1.7976931e+308
// LOG_NLS_V | info | ------------------------------------------------------
// LOG_NLS_V | info | Solution [2-dim]
// | | | | | -77390.689 3.3118158e-06
// stdout | info | The initialization finished successfully without homotopy method.
// LOG_INIT | info | parameter values
// | | | | | real parameters
// | | | | | | [1] parameter Real xn(start=100000, fixed=true) = 100000
// | | | | | | [2] parameter Real yn(start=1e-05, fixed=true) = 1e-05
// LOG_SOTI | info | ### SOLUTION OF THE INITIALIZATION ###
// | | | | | other real variables
// | | | | | | [1] Real $cse3(start=0, nominal=1) = 0 (pre: 0)
// | | | | | | [2] Real $cse4(start=0, nominal=1) = 0 (pre: 0)
// | | | | | | [3] Real x(start=50000, nominal=100000) = -77390.7 (pre: 50000)
// | | | | | | [4] Real y(start=5e-06, nominal=1e-05) = 3.31182e-06 (pre: 5e-06)
// LOG_INIT | info | ### END INITIALIZATION ###
// LOG_NLS_V | info | ------------------------------------------------------
// LOG_NLS_V | info | SOLVING NON-LINEAR SYSTEM USING MIXED SOLVER (Newton/Homotopy solver)
// LOG_NLS_V | info | EQUATION NUMBER: 18
// LOG_NLS_V | info | TIME: 0.0000000000e+00
// LOG_NLS_V | info | number of function calls (so far!): 0
// LOG_NLS_V | info | System values [2-dim]
// | | | | | -77390.689 3.3118158e-06
// LOG_NLS_V | info | Nominal values [2-dim]
// | | | | | 100000 1e-05
// LOG_NLS_V | info | Scaling values [3-dim]
// | | | | | 100000 1e-05 1
// LOG_NLS_V | info | x0 [2-dim]
// | | | | | -77390.689 3.3118158e-06
// LOG_NLS_V | info | regular initial point!!!
// LOG_NLS_V | info | ******************************************************
// LOG_NLS_V | info | NEWTON SOLVER STARTED! equation number: 18
// LOG_NLS_V | info | maximum number of function evaluation: 200
// LOG_NLS | info | nls status
// | | | | | variables
// | | | | | [ 1] x = -77390.689 nom = 100000 min = -1.7976931e+308 max = 1.7976931e+308
// | | | | | [ 2] y = 3.3118158e-06 nom = 1e-05 min = -1.7976931e+308 max = 1.7976931e+308
// LOG_NLS_V | info | Iteration: 1
// LOG_NLS_V | info | newton step
// | | | | | variables
// | | | | | [ 1] x = -77390.689 step = -7.7595205e-12 old = -77390.689
// | | | | | [ 2] y = 3.3118158e-06 step = -1.9304731e-22 old = 3.3118158e-06
// LOG_NLS_V | info | Need to damp, grad_f = -2.4651903288e-32
// LOG_NLS_V | info | Need to damp, error_f = 1.1102230246e-16
// LOG_NLS_V | info | Need to damp this!! lambda1 = 1.0000000000e+00
// LOG_NLS_V | info | Need to damp, error_f1 = 4.9650683065e-16
// LOG_NLS_V | info | Need to damp, forced error = 9.8607613153e-33
// LOG_NLS_V | info | function values: [2-dim]
// | | | | | 4.4408921e-16 2.220446e-16
// LOG_NLS_V | info | scaled function values: [2-dim]
// | | | | | 8.8472946e-17 9.2625353e-17
// LOG_NLS_V | info | error measurements:
// LOG_NLS_V | info | delta_x = 7.7595205169e-12
// LOG_NLS_V | info | delta_x_scaled = 7.9960543487e-17
// LOG_NLS_V | info | newtonXTol = 1.0000000000e-12
// LOG_NLS_V | info | error_f = 4.9650683065e-16
// LOG_NLS_V | info | error_f_scaled = 1.2808949265e-16
// LOG_NLS_V | info | newtonFTol = 1.0000000000e-12
// LOG_NLS_V | info | NEWTON SOLVER DID CONVERGE TO A SOLUTION!!!
// LOG_NLS_V | info | nls status
// | | | | | variables
// | | | | | [ 1] x = -77390.689 nom = 100000 min = -1.7976931e+308 max = 1.7976931e+308
// | | | | | [ 2] y = 3.3118158e-06 nom = 1e-05 min = -1.7976931e+308 max = 1.7976931e+308
// LOG_NLS_V | info | ******************************************************
// LOG_NLS_V | info | SYSTEM SOLVED
// LOG_NLS_V | info | homotopy method: 0
// LOG_NLS_V | info | number of function calls: 2
// LOG_NLS | info | nls status
// | | | | | variables
// | | | | | [ 1] x = -77390.689 nom = 100000 min = -1.7976931e+308 max = 1.7976931e+308
// | | | | | [ 2] y = 3.3118158e-06 nom = 1e-05 min = -1.7976931e+308 max = 1.7976931e+308
// LOG_NLS_V | info | ------------------------------------------------------
// LOG_NLS_V | info | Solution [2-dim]
// | | | | | -77390.689 3.3118158e-06
// LOG_NLS_V | info | ------------------------------------------------------
// LOG_NLS_V | info | SOLVING NON-LINEAR SYSTEM USING MIXED SOLVER (Newton/Homotopy solver)
// LOG_NLS_V | info | EQUATION NUMBER: 18
// LOG_NLS_V | info | TIME: 0.0000000000e+00
// LOG_NLS_V | info | number of function calls (so far!): 2
// LOG_NLS_V | info | System values [2-dim]
// | | | | | -77390.689 3.3118158e-06
// LOG_NLS_V | info | Nominal values [2-dim]
// | | | | | 100000 1e-05
// LOG_NLS_V | info | Scaling values [3-dim]
// | | | | | 100000 1e-05 1
// LOG_NLS_V | info | x0 [2-dim]
// | | | | | -77390.689 3.3118158e-06
// LOG_NLS_V | info | NO ITERATION NECESSARY!!!
// LOG_NLS_V | info | ******************************************************
// LOG_NLS_V | info | SYSTEM SOLVED
// LOG_NLS_V | info | number of function calls: 1
// LOG_NLS_V | info | ------------------------------------------------------
// LOG_NLS_V | info | Solution [2-dim]
// | | | | | -77390.689 3.3118158e-06
// stdout | info | The simulation finished successfully.
// LOG_NLS | info | free mixed system solvers
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// ""
// endResult