| 1 | package TestAutoSparseSolvers
|
|---|
| 2 | package Linear
|
|---|
| 3 | package DefaultSolver
|
|---|
| 4 | model Test_N_10
|
|---|
| 5 | parameter Integer N = 10;
|
|---|
| 6 | Real x[N];
|
|---|
| 7 | equation
|
|---|
| 8 | x[1] + 0.1*x[2] = 1;
|
|---|
| 9 | for i in 2:N - 1 loop
|
|---|
| 10 | 0.1*x[i-1] + x[i] + 0.1*x[i+1] = 1;
|
|---|
| 11 | end for;
|
|---|
| 12 | 0.1*x[N-1] + x[N] = 1;
|
|---|
| 13 | annotation(
|
|---|
| 14 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 15 | __OpenModelica_simulationFlags(lv="LOG_LS"),
|
|---|
| 16 | experiment(StopTime = 0));
|
|---|
| 17 | end Test_N_10;
|
|---|
| 18 |
|
|---|
| 19 | model Test_N_20
|
|---|
| 20 | extends Test_N_10(N = 20);
|
|---|
| 21 | annotation(
|
|---|
| 22 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 23 | __OpenModelica_simulationFlags(lv="LOG_LS"),
|
|---|
| 24 | experiment(StopTime = 0));
|
|---|
| 25 | end Test_N_20;
|
|---|
| 26 |
|
|---|
| 27 | model Test_N_40
|
|---|
| 28 | extends Test_N_10(N = 40);
|
|---|
| 29 | annotation(
|
|---|
| 30 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 31 | __OpenModelica_simulationFlags(lv="LOG_LS"),
|
|---|
| 32 | experiment(StopTime = 0));
|
|---|
| 33 | end Test_N_40;
|
|---|
| 34 |
|
|---|
| 35 | model Test_N_80
|
|---|
| 36 | extends Test_N_10(N = 80);
|
|---|
| 37 | annotation(
|
|---|
| 38 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 39 | __OpenModelica_simulationFlags(lv="LOG_LS"),
|
|---|
| 40 | experiment(StopTime = 0));
|
|---|
| 41 | end Test_N_80;
|
|---|
| 42 |
|
|---|
| 43 | model Test_N_160
|
|---|
| 44 | extends Test_N_10(N = 160);
|
|---|
| 45 | annotation(
|
|---|
| 46 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 47 | __OpenModelica_simulationFlags(lv="LOG_LS"),
|
|---|
| 48 | experiment(StopTime = 0));
|
|---|
| 49 | end Test_N_160;
|
|---|
| 50 |
|
|---|
| 51 | model Test_N_320
|
|---|
| 52 | extends Test_N_10(N = 320);
|
|---|
| 53 | annotation(
|
|---|
| 54 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 55 | __OpenModelica_simulationFlags(lv="LOG_LS"),
|
|---|
| 56 | experiment(StopTime = 0));
|
|---|
| 57 | end Test_N_320;
|
|---|
| 58 |
|
|---|
| 59 | model Test_N_640
|
|---|
| 60 | extends Test_N_10(N = 640);
|
|---|
| 61 | annotation(
|
|---|
| 62 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 63 | __OpenModelica_simulationFlags(lv="LOG_LS"),
|
|---|
| 64 | experiment(StopTime = 0));
|
|---|
| 65 | end Test_N_640;
|
|---|
| 66 |
|
|---|
| 67 | model Test_N_1280
|
|---|
| 68 | extends Test_N_10(N = 1280);
|
|---|
| 69 | annotation(
|
|---|
| 70 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 71 | __OpenModelica_simulationFlags(lv="LOG_LS"),
|
|---|
| 72 | experiment(StopTime = 0));
|
|---|
| 73 | end Test_N_1280;
|
|---|
| 74 |
|
|---|
| 75 | model Test_N_2560
|
|---|
| 76 | extends Test_N_10(N = 2560);
|
|---|
| 77 | annotation(
|
|---|
| 78 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 79 | __OpenModelica_simulationFlags(lv="LOG_LS"),
|
|---|
| 80 | experiment(StopTime = 0));
|
|---|
| 81 | end Test_N_2560;
|
|---|
| 82 |
|
|---|
| 83 | model Test_N_5120
|
|---|
| 84 | extends Test_N_10(N = 5120);
|
|---|
| 85 | annotation(
|
|---|
| 86 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 87 | __OpenModelica_simulationFlags(lv="LOG_LS"),
|
|---|
| 88 | experiment(StopTime = 0));
|
|---|
| 89 | end Test_N_5120;
|
|---|
| 90 |
|
|---|
| 91 | model Test_N_10240
|
|---|
| 92 | extends Test_N_10(N = 10240);
|
|---|
| 93 | annotation(
|
|---|
| 94 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 95 | __OpenModelica_simulationFlags(lv="LOG_LS"),
|
|---|
| 96 | experiment(StopTime = 0));
|
|---|
| 97 | end Test_N_10240;
|
|---|
| 98 | end DefaultSolver;
|
|---|
| 99 |
|
|---|
| 100 | package SparseSolver
|
|---|
| 101 | model Test_N_10
|
|---|
| 102 | parameter Integer N = 10;
|
|---|
| 103 | Real x[N];
|
|---|
| 104 | equation
|
|---|
| 105 | x[1] + 0.1*sin(x[2]) = 1;
|
|---|
| 106 | for i in 2:N - 1 loop
|
|---|
| 107 | 0.1 * sin(x[i-1]) + x[i] + 0.1*sin(x[i+1]) = 1;
|
|---|
| 108 | end for;
|
|---|
| 109 | 0.1*sin(x[N-1]) + x[N] = 1;
|
|---|
| 110 | annotation(
|
|---|
| 111 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 112 | __OpenModelica_simulationFlags(ls="klu", lv="LOG_LS"),
|
|---|
| 113 | experiment(StopTime = 0));
|
|---|
| 114 | end Test_N_10;
|
|---|
| 115 |
|
|---|
| 116 | model Test_N_20
|
|---|
| 117 | extends Test_N_10(N = 20);
|
|---|
| 118 | annotation(
|
|---|
| 119 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 120 | __OpenModelica_simulationFlags(ls="klu", lv="LOG_LS"),
|
|---|
| 121 | experiment(StopTime = 0));
|
|---|
| 122 | end Test_N_20;
|
|---|
| 123 |
|
|---|
| 124 | model Test_N_40
|
|---|
| 125 | extends Test_N_10(N = 40);
|
|---|
| 126 | annotation(
|
|---|
| 127 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 128 | __OpenModelica_simulationFlags(ls="klu", lv="LOG_LS"),
|
|---|
| 129 | experiment(StopTime = 0));
|
|---|
| 130 | end Test_N_40;
|
|---|
| 131 |
|
|---|
| 132 | model Test_N_80
|
|---|
| 133 | extends Test_N_10(N = 80);
|
|---|
| 134 | annotation(
|
|---|
| 135 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 136 | __OpenModelica_simulationFlags(ls="klu", lv="LOG_LS"),
|
|---|
| 137 | experiment(StopTime = 0));
|
|---|
| 138 | end Test_N_80;
|
|---|
| 139 |
|
|---|
| 140 | model Test_N_160
|
|---|
| 141 | extends Test_N_10(N = 160);
|
|---|
| 142 | annotation(
|
|---|
| 143 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 144 | __OpenModelica_simulationFlags(ls="klu", lv="LOG_LS"),
|
|---|
| 145 | experiment(StopTime = 0));
|
|---|
| 146 | end Test_N_160;
|
|---|
| 147 |
|
|---|
| 148 | model Test_N_320
|
|---|
| 149 | extends Test_N_10(N = 320);
|
|---|
| 150 | annotation(
|
|---|
| 151 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 152 | __OpenModelica_simulationFlags(ls="klu", lv="LOG_LS"),
|
|---|
| 153 | experiment(StopTime = 0));
|
|---|
| 154 | end Test_N_320;
|
|---|
| 155 |
|
|---|
| 156 | model Test_N_640
|
|---|
| 157 | extends Test_N_10(N = 640);
|
|---|
| 158 | annotation(
|
|---|
| 159 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 160 | __OpenModelica_simulationFlags(ls="klu", lv="LOG_LS"),
|
|---|
| 161 | experiment(StopTime = 0));
|
|---|
| 162 | end Test_N_640;
|
|---|
| 163 |
|
|---|
| 164 | model Test_N_1280
|
|---|
| 165 | extends Test_N_10(N = 1280);
|
|---|
| 166 | annotation(
|
|---|
| 167 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 168 | __OpenModelica_simulationFlags(ls="klu", lv="LOG_LS"),
|
|---|
| 169 | experiment(StopTime = 0));
|
|---|
| 170 | end Test_N_1280;
|
|---|
| 171 |
|
|---|
| 172 | model Test_N_2560
|
|---|
| 173 | extends Test_N_10(N = 2560);
|
|---|
| 174 | annotation(
|
|---|
| 175 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 176 | __OpenModelica_simulationFlags(ls="klu", lv="LOG_LS"),
|
|---|
| 177 | experiment(StopTime = 0));
|
|---|
| 178 | end Test_N_2560;
|
|---|
| 179 |
|
|---|
| 180 | model Test_N_5120
|
|---|
| 181 | extends Test_N_10(N = 5120);
|
|---|
| 182 | annotation(
|
|---|
| 183 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 184 | __OpenModelica_simulationFlags(ls="klu", lv="LOG_LS"),
|
|---|
| 185 | experiment(StopTime = 0));
|
|---|
| 186 | end Test_N_5120;
|
|---|
| 187 |
|
|---|
| 188 | model Test_N_10240
|
|---|
| 189 | extends Test_N_10(N = 10240);
|
|---|
| 190 | annotation(
|
|---|
| 191 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 192 | __OpenModelica_simulationFlags(ls="klu", lv="LOG_LS"),
|
|---|
| 193 | experiment(StopTime = 0));
|
|---|
| 194 | end Test_N_10240;
|
|---|
| 195 | end SparseSolver;
|
|---|
| 196 | end Linear;
|
|---|
| 197 |
|
|---|
| 198 | package Nonlinear
|
|---|
| 199 | package DefaultSolver
|
|---|
| 200 | model Test_N_10
|
|---|
| 201 | parameter Integer N = 10;
|
|---|
| 202 | Real x[N];
|
|---|
| 203 | equation
|
|---|
| 204 | x[1] + 0.1 * sin(x[2]) = 1;
|
|---|
| 205 | for i in 2:N - 1 loop
|
|---|
| 206 | 0.1 * sin(x[i - 1]) + x[i] + 0.1 * sin(x[i + 1]) = 1;
|
|---|
| 207 | end for;
|
|---|
| 208 | 0.1 * sin(x[N - 1]) + x[N] = 1;
|
|---|
| 209 | annotation(
|
|---|
| 210 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 211 | __OpenModelica_simulationFlags(lv="LOG_NLS"),
|
|---|
| 212 | experiment(StopTime = 0));
|
|---|
| 213 | end Test_N_10;
|
|---|
| 214 |
|
|---|
| 215 | model Test_N_20
|
|---|
| 216 | extends Test_N_10(N = 20);
|
|---|
| 217 | annotation(
|
|---|
| 218 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 219 | __OpenModelica_simulationFlags(lv="LOG_NLS"),
|
|---|
| 220 | experiment(StopTime = 0));
|
|---|
| 221 | end Test_N_20;
|
|---|
| 222 |
|
|---|
| 223 | model Test_N_40
|
|---|
| 224 | extends Test_N_10(N = 40);
|
|---|
| 225 | annotation(
|
|---|
| 226 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 227 | __OpenModelica_simulationFlags(lv="LOG_NLS"),
|
|---|
| 228 | experiment(StopTime = 0));
|
|---|
| 229 | end Test_N_40;
|
|---|
| 230 |
|
|---|
| 231 | model Test_N_80
|
|---|
| 232 | extends Test_N_10(N = 80);
|
|---|
| 233 | annotation(
|
|---|
| 234 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 235 | __OpenModelica_simulationFlags(lv="LOG_NLS"),
|
|---|
| 236 | experiment(StopTime = 0));
|
|---|
| 237 | end Test_N_80;
|
|---|
| 238 |
|
|---|
| 239 | model Test_N_160
|
|---|
| 240 | extends Test_N_10(N = 160);
|
|---|
| 241 | annotation(
|
|---|
| 242 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 243 | __OpenModelica_simulationFlags(lv="LOG_NLS"),
|
|---|
| 244 | experiment(StopTime = 0));
|
|---|
| 245 | end Test_N_160;
|
|---|
| 246 |
|
|---|
| 247 | model Test_N_320
|
|---|
| 248 | extends Test_N_10(N = 320);
|
|---|
| 249 | annotation(
|
|---|
| 250 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 251 | __OpenModelica_simulationFlags(lv="LOG_NLS"),
|
|---|
| 252 | experiment(StopTime = 0));
|
|---|
| 253 | end Test_N_320;
|
|---|
| 254 |
|
|---|
| 255 | model Test_N_640
|
|---|
| 256 | extends Test_N_10(N = 640);
|
|---|
| 257 | annotation(
|
|---|
| 258 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 259 | __OpenModelica_simulationFlags(lv="LOG_NLS"),
|
|---|
| 260 | experiment(StopTime = 0));
|
|---|
| 261 | end Test_N_640;
|
|---|
| 262 |
|
|---|
| 263 | model Test_N_1280
|
|---|
| 264 | extends Test_N_10(N = 1280);
|
|---|
| 265 | annotation(
|
|---|
| 266 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 267 | __OpenModelica_simulationFlags(lv="LOG_NLS"),
|
|---|
| 268 | experiment(StopTime = 0));
|
|---|
| 269 | end Test_N_1280;
|
|---|
| 270 |
|
|---|
| 271 | model Test_N_2560
|
|---|
| 272 | extends Test_N_10(N = 2560);
|
|---|
| 273 | annotation(
|
|---|
| 274 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 275 | __OpenModelica_simulationFlags(lv="LOG_NLS"),
|
|---|
| 276 | experiment(StopTime = 0));
|
|---|
| 277 | end Test_N_2560;
|
|---|
| 278 |
|
|---|
| 279 | model Test_N_5120
|
|---|
| 280 | extends Test_N_10(N = 5120);
|
|---|
| 281 | annotation(
|
|---|
| 282 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 283 | __OpenModelica_simulationFlags(lv="LOG_NLS"),
|
|---|
| 284 | experiment(StopTime = 0));
|
|---|
| 285 | end Test_N_5120;
|
|---|
| 286 |
|
|---|
| 287 | model Test_N_10240
|
|---|
| 288 | extends Test_N_10(N = 10240);
|
|---|
| 289 | annotation(
|
|---|
| 290 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 291 | __OpenModelica_simulationFlags(lv="LOG_NLS"),
|
|---|
| 292 | experiment(StopTime = 0));
|
|---|
| 293 | end Test_N_10240;
|
|---|
| 294 | end DefaultSolver;
|
|---|
| 295 |
|
|---|
| 296 | package SparseSolver
|
|---|
| 297 | model Test_N_10
|
|---|
| 298 | parameter Integer N = 10;
|
|---|
| 299 | Real x[N];
|
|---|
| 300 | equation
|
|---|
| 301 | x[1] + 0.1 * sin(x[2]) = 1;
|
|---|
| 302 | for i in 2:N - 1 loop
|
|---|
| 303 | 0.1 * sin(x[i - 1]) + x[i] + 0.1 * sin(x[i + 1]) = 1;
|
|---|
| 304 | end for;
|
|---|
| 305 | 0.1 * sin(x[N - 1]) + x[N] = 1;
|
|---|
| 306 | annotation(
|
|---|
| 307 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 308 | __OpenModelica_simulationFlags(nls="kinsol", nlsLS="klu", lv="LOG_NLS"),
|
|---|
| 309 | experiment(StopTime = 0));
|
|---|
| 310 | end Test_N_10;
|
|---|
| 311 |
|
|---|
| 312 | model Test_N_20
|
|---|
| 313 | extends Test_N_10(N = 20);
|
|---|
| 314 | annotation(
|
|---|
| 315 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 316 | __OpenModelica_simulationFlags(nls="kinsol", nlsLS="klu", lv="LOG_NLS"),
|
|---|
| 317 | experiment(StopTime = 0));
|
|---|
| 318 | end Test_N_20;
|
|---|
| 319 |
|
|---|
| 320 | model Test_N_40
|
|---|
| 321 | extends Test_N_10(N = 40);
|
|---|
| 322 | annotation(
|
|---|
| 323 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 324 | __OpenModelica_simulationFlags(nls="kinsol", nlsLS="klu", lv="LOG_NLS"),
|
|---|
| 325 | experiment(StopTime = 0));
|
|---|
| 326 | end Test_N_40;
|
|---|
| 327 |
|
|---|
| 328 | model Test_N_80
|
|---|
| 329 | extends Test_N_10(N = 80);
|
|---|
| 330 | annotation(
|
|---|
| 331 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 332 | __OpenModelica_simulationFlags(nls="kinsol", nlsLS="klu", lv="LOG_NLS"),
|
|---|
| 333 | experiment(StopTime = 0));
|
|---|
| 334 | end Test_N_80;
|
|---|
| 335 |
|
|---|
| 336 | model Test_N_160
|
|---|
| 337 | extends Test_N_10(N = 160);
|
|---|
| 338 | annotation(
|
|---|
| 339 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 340 | __OpenModelica_simulationFlags(nls="kinsol", nlsLS="klu", lv="LOG_NLS"),
|
|---|
| 341 | experiment(StopTime = 0));
|
|---|
| 342 | end Test_N_160;
|
|---|
| 343 |
|
|---|
| 344 | model Test_N_320
|
|---|
| 345 | extends Test_N_10(N = 320);
|
|---|
| 346 | annotation(
|
|---|
| 347 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 348 | __OpenModelica_simulationFlags(nls="kinsol", nlsLS="klu", lv="LOG_NLS"),
|
|---|
| 349 | experiment(StopTime = 0));
|
|---|
| 350 | end Test_N_320;
|
|---|
| 351 |
|
|---|
| 352 | model Test_N_640
|
|---|
| 353 | extends Test_N_10(N = 640);
|
|---|
| 354 | annotation(
|
|---|
| 355 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 356 | __OpenModelica_simulationFlags(nls="kinsol", nlsLS="klu", lv="LOG_NLS"),
|
|---|
| 357 | experiment(StopTime = 0));
|
|---|
| 358 | end Test_N_640;
|
|---|
| 359 |
|
|---|
| 360 | model Test_N_1280
|
|---|
| 361 | extends Test_N_10(N = 1280);
|
|---|
| 362 | annotation(
|
|---|
| 363 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 364 | __OpenModelica_simulationFlags(nls="kinsol", nlsLS="klu", lv="LOG_NLS"),
|
|---|
| 365 | experiment(StopTime = 0));
|
|---|
| 366 | end Test_N_1280;
|
|---|
| 367 |
|
|---|
| 368 | model Test_N_2560
|
|---|
| 369 | extends Test_N_10(N = 2560);
|
|---|
| 370 | annotation(
|
|---|
| 371 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 372 | __OpenModelica_simulationFlags(nls="kinsol", nlsLS="klu", lv="LOG_NLS"),
|
|---|
| 373 | experiment(StopTime = 0));
|
|---|
| 374 | end Test_N_2560;
|
|---|
| 375 |
|
|---|
| 376 | model Test_N_5120
|
|---|
| 377 | extends Test_N_10(N = 5120);
|
|---|
| 378 | annotation(
|
|---|
| 379 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 380 | __OpenModelica_simulationFlags(nls="kinsol", nlsLS="klu", lv="LOG_NLS"),
|
|---|
| 381 | experiment(StopTime = 0));
|
|---|
| 382 | end Test_N_5120;
|
|---|
| 383 |
|
|---|
| 384 | model Test_N_10240
|
|---|
| 385 | extends Test_N_10(N = 10240);
|
|---|
| 386 | annotation(
|
|---|
| 387 | __OpenModelica_commandLineOptions = "--tearingMethod=minimalTearing",
|
|---|
| 388 | __OpenModelica_simulationFlags(nls="kinsol", nlsLS="klu", lv="LOG_NLS"),
|
|---|
| 389 | experiment(StopTime = 0));
|
|---|
| 390 | end Test_N_10240;
|
|---|
| 391 | end SparseSolver;
|
|---|
| 392 | end Nonlinear;
|
|---|
| 393 | end TestAutoSparseSolvers;
|
|---|