Skip to content

Commit

Permalink
Test for global homotopy approach
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel authored and OpenModelica-Hudson committed Jul 24, 2017
1 parent 160b2cd commit f80d035
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion simulation/modelica/initialization/homotopy1.mos
Expand Up @@ -13,20 +13,38 @@ package initializationTests
model homotopy1
Real x; // 3
Real y; // -3

equation
homotopy(x^2, x) = 9;
homotopy(y^2, -y) = 9;
end homotopy1;
end initializationTests;
"); getErrorString();

setCommandLineOptions("--homotopyApproach=local"); getErrorString();
simulate(initializationTests.homotopy1, startTime=0.0, stopTime=0.0, simflags="-ils=2"); getErrorString();
res := OpenModelica.Scripting.readSimulationResult("initializationTests.homotopy1_res.mat", {time, x, y}, 2); getErrorString();

setCommandLineOptions("--homotopyApproach=global"); getErrorString();
simulate(initializationTests.homotopy1, startTime=0.0, stopTime=0.0, simflags="-ils=2"); getErrorString();
res := OpenModelica.Scripting.readSimulationResult("initializationTests.homotopy1_res.mat", {time, x, y}, 2); getErrorString();

// Result:
// true
// ""
// true
// ""
// record SimulationResult
// resultFile = "initializationTests.homotopy1_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 0.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'initializationTests.homotopy1', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = '-ils=2'",
// messages = ""
// end SimulationResult;
// "Warning: There are iteration variables with default zero start attribute. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").
// "
// {{0.0,0.0},{3.0,3.0},{-3.0,-3.0}}
// ""
// true
// ""
// record SimulationResult
// resultFile = "initializationTests.homotopy1_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 0.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'initializationTests.homotopy1', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = '-ils=2'",
Expand Down

0 comments on commit f80d035

Please sign in to comment.