Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't change lambda when no homotpy should be used (#8109)
* Don't change lambda when no homotpy should be used * Updating tests * Disabeling MSL 3.2.2 Modelica.Fluid.Examples.PumpingSystem test * Different solution in homotopy4_solver test Co-authored-by: phannebohm <phannebohm@fh-bielefeld.de>
- Loading branch information
1 parent
1250a38
commit c32c675
Showing
6 changed files
with
84 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
testsuite/simulation/libraries/msl32/Modelica.Fluid.Examples.PumpingSystem.mos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
testsuite/simulation/modelica/initialization/homotopy6.mos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// name: homotopy6 | ||
// keywords: initialization, homotopy | ||
// status: correct | ||
// cflags: | ||
// teardown_command: rm -rf initializationTests.homotopy6* _initializationTests.homotopy6* output.log TestTornHomotopy2* | ||
// cflags: -d=-newInst | ||
// | ||
// Check if equation system actually goes through all steps in the global homotopy path. | ||
// To prevent regressions like https://github.com/OpenModelica/OpenModelica/issues/8097 | ||
// | ||
|
||
loadString("model TestTornHomotopy2 | ||
Real x,y,z; | ||
equation | ||
x = homotopy(y + 0.1*y^2 - 0.001*y^3, y); | ||
y = 3*z; | ||
z + 0.1*x = 1; | ||
end TestTornHomotopy2; | ||
"); getErrorString(); | ||
|
||
simulate(TestTornHomotopy2, simflags="-lv=LOG_INIT_HOMOTOPY -s=dassl"); | ||
getErrorString(); | ||
|
||
readFile("TestTornHomotopy2_equidistant_global_homotopy.csv") | ||
|
||
// Result: | ||
// true | ||
// "" | ||
// record SimulationResult | ||
// resultFile = "TestTornHomotopy2_res.mat", | ||
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'TestTornHomotopy2', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = '-lv=LOG_INIT_HOMOTOPY -s=dassl'", | ||
// messages = "LOG_INIT_HOMOTOPY | info | Model contains homotopy operator: Use adaptive homotopy method to solve initialization problem. To disable initialization with homotopy operator use \"-noHomotopyOnFirstTry\". | ||
// LOG_INIT_HOMOTOPY | info | Global homotopy with equidistant step size started. | ||
// LOG_INIT_HOMOTOPY | info | The homotopy path will be exported to TestTornHomotopy2_equidistant_global_homotopy.csv. | ||
// LOG_INIT_HOMOTOPY | info | homotopy process | ||
// | | | | --------------------------- | ||
// LOG_INIT_HOMOTOPY | info | homotopy parameter lambda = 0 | ||
// LOG_INIT_HOMOTOPY | info | homotopy parameter lambda = 0 done | ||
// | | | | --------------------------- | ||
// LOG_INIT_HOMOTOPY | info | homotopy parameter lambda = 0.333333 | ||
// LOG_INIT_HOMOTOPY | info | homotopy parameter lambda = 0.333333 done | ||
// | | | | --------------------------- | ||
// LOG_INIT_HOMOTOPY | info | homotopy parameter lambda = 0.666667 | ||
// LOG_INIT_HOMOTOPY | info | homotopy parameter lambda = 0.666667 done | ||
// | | | | --------------------------- | ||
// LOG_INIT_HOMOTOPY | info | homotopy parameter lambda = 1 | ||
// LOG_INIT_HOMOTOPY | info | homotopy parameter lambda = 1 done | ||
// | | | | --------------------------- | ||
// LOG_SUCCESS | info | The initialization finished successfully with 3 homotopy steps. | ||
// LOG_SUCCESS | info | The simulation finished successfully. | ||
// " | ||
// end SimulationResult; | ||
// "Warning: There are nonlinear iteration variables with default zero start attribute found in NLSJac0. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->Show additional information from the initialization process, in OMNotebook call setCommandLineOptions(\"-d=initialization\"). | ||
// " | ||
// "\"lambda\",\"x\",\"y\",\"z\" | ||
// 0,2.307692307692307,2.307692307692308,0.7692307692307693 | ||
// 0.3333333333333333,2.436704982096462,2.268988505371062,0.7563295017903539 | ||
// 0.6666666666666666,2.557625806717175,2.232712257984848,0.7442374193282825 | ||
// 1,2.671349569180263,2.198595129245921,0.7328650430819735 | ||
// " | ||
// endResult |