Skip to content

Commit

Permalink
added testcase for simflag -imprkLS
Browse files Browse the repository at this point in the history
  • Loading branch information
Willi Braun authored and OpenModelica-Hudson committed Feb 1, 2017
1 parent 125ba9f commit 487d1cb
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions simulation/modelica/solver/Makefile
Expand Up @@ -16,6 +16,7 @@ problem2-imprk.mos \
problem2-symEuler.mos \
problem2-ida.mos \
problem2-idaLinearSolver.mos \
problem2-imprkLS.mos \
problem3-symEuler.mos \
problem4-erk_ssc.mos \
testDAEp1.mos \
Expand Down
82 changes: 82 additions & 0 deletions simulation/modelica/solver/problem2-imprkLS.mos
@@ -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

0 comments on commit 487d1cb

Please sign in to comment.