Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
125ba9f
commit 487d1cb
Showing
2 changed files
with
83 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// name: problem2-imprkLS | ||
// status: correct | ||
// teardown_command: rm -f testSolver.problem2* output.log | ||
|
||
stopTime := 321.8122; | ||
loadFile("testSolverPackage.mo"); getErrorString(); | ||
//order 3 | ||
simulate(testSolver.problem2, stopTime=stopTime, numberOfIntervals=3000, method="imprungekutta", simflags="-impRKOrder=3 -impRKLS=iterative", tolerance=1e-6); getErrorString(); | ||
|
||
res := OpenModelica.Scripting.compareSimulationResults("testSolver.problem2_res.mat", | ||
getEnvironmentVar("REFERENCEFILES")+"/solver/testSolver.problem2.mat", | ||
"testSolver.problem2_diff.csv",0.001,0.01, | ||
{ | ||
"y[1]", | ||
"y[2]", | ||
"y[3]", | ||
"y[4]", | ||
"y[5]", | ||
"y[6]", | ||
"y[7]", | ||
"y[8]", | ||
"der(y[1])", | ||
"der(y[2])", | ||
"der(y[3])", | ||
"der(y[4])", | ||
"der(y[5])", | ||
"der(y[6])", | ||
"der(y[7])", | ||
"der(y[8])" | ||
}); | ||
getErrorString(); | ||
|
||
|
||
//order 3 | ||
simulate(testSolver.problem2, stopTime=stopTime, numberOfIntervals=3000, method="imprungekutta", simflags="-impRKOrder=3 -impRKLS=dense", tolerance=1e-6); getErrorString(); | ||
|
||
res := OpenModelica.Scripting.compareSimulationResults("testSolver.problem2_res.mat", | ||
getEnvironmentVar("REFERENCEFILES")+"/solver/testSolver.problem2.mat", | ||
"testSolver.problem2_diff.csv",0.001,0.01, | ||
{ | ||
"y[1]", | ||
"y[2]", | ||
"y[3]", | ||
"y[4]", | ||
"y[5]", | ||
"y[6]", | ||
"y[7]", | ||
"y[8]", | ||
"der(y[1])", | ||
"der(y[2])", | ||
"der(y[3])", | ||
"der(y[4])", | ||
"der(y[5])", | ||
"der(y[6])", | ||
"der(y[7])", | ||
"der(y[8])" | ||
}); | ||
getErrorString(); | ||
|
||
// Result: | ||
// 321.8122 | ||
// true | ||
// "" | ||
// record SimulationResult | ||
// resultFile = "testSolver.problem2_res.mat", | ||
// simulationOptions = "startTime = 0.0, stopTime = 321.8122, numberOfIntervals = 3000, tolerance = 1e-06, method = 'imprungekutta', fileNamePrefix = 'testSolver.problem2', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = '-impRKOrder=3 -impRKLS=iterative'", | ||
// messages = "" | ||
// 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"). | ||
// " | ||
// {"Files Equal!"} | ||
// "" | ||
// record SimulationResult | ||
// resultFile = "testSolver.problem2_res.mat", | ||
// simulationOptions = "startTime = 0.0, stopTime = 321.8122, numberOfIntervals = 3000, tolerance = 1e-06, method = 'imprungekutta', fileNamePrefix = 'testSolver.problem2', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = '-impRKOrder=3 -impRKLS=dense'", | ||
// messages = "" | ||
// 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"). | ||
// " | ||
// {"Files Equal!"} | ||
// "" | ||
// endResult |