Skip to content

Commit

Permalink
Specify StopTime = 0 for some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rfranke committed Mar 26, 2016
1 parent 17bd66e commit 37fcc39
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion openmodelica/cppruntime/functionPointerTest.mos
Expand Up @@ -43,6 +43,7 @@ package FunctionPointer
Real y;
equation
y = feval2(function func(v = 1, w = {2, 3}), u + 4);
annotation(experiment(StopTime = 0));
end Test;
end FunctionPointer;
");
Expand All @@ -59,7 +60,7 @@ getErrorString();
// ""
// record SimulationResult
// resultFile = "FunctionPointer.Test_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'FunctionPointer.Test', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// simulationOptions = "startTime = 0.0, stopTime = 0.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'FunctionPointer.Test', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = ""
// end SimulationResult;
// 22.0
Expand Down
3 changes: 2 additions & 1 deletion openmodelica/cppruntime/mathFunctionsTest.mos
Expand Up @@ -35,6 +35,7 @@ package MathFunctions
equation
(acos, asin, atan, cos, cosh, sin, sinh, tan, tanh) = f(x);
(exp, log, log10, sqrt) = g(x);
annotation(experiment(StopTime = 0));
end Test;
end MathFunctions;
");
Expand All @@ -59,7 +60,7 @@ getErrorString();
// ""
// record SimulationResult
// resultFile = "MathFunctions.Test_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'MathFunctions.Test', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// simulationOptions = "startTime = 0.0, stopTime = 0.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'MathFunctions.Test', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = ""
// end SimulationResult;
// 1.0
Expand Down
3 changes: 2 additions & 1 deletion openmodelica/cppruntime/recordTupleReturnTest.mos
Expand Up @@ -41,6 +41,7 @@ model RecordTupleReturn
R r;
equation
(y, r) = g(u + 1);
annotation(experiment(StopTime = 0));
end Test;
end RecordTupleReturn;
");
Expand All @@ -58,7 +59,7 @@ getErrorString();
// ""
// record SimulationResult
// resultFile = "RecordTupleReturn.Test_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'RecordTupleReturn.Test', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// simulationOptions = "startTime = 0.0, stopTime = 0.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'RecordTupleReturn.Test', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = ""
// end SimulationResult;
// 2.0
Expand Down
7 changes: 4 additions & 3 deletions openmodelica/cppruntime/solveTest.mos
Expand Up @@ -14,13 +14,14 @@ model SolveTest
output Real[2] x;
equation
x = Modelica.Math.Matrices.solve(A, (u + 1) * b);
annotation(experiment(StopTime = 0));
end SolveTest;
");
getErrorString();

simulate(SolveTest);
val(x[1], 1);
val(x[2], 1);
val(x[1], 0);
val(x[2], 0);
getErrorString();

// Result:
Expand All @@ -30,7 +31,7 @@ getErrorString();
// ""
// record SimulationResult
// resultFile = "SolveTest_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'SolveTest', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// simulationOptions = "startTime = 0.0, stopTime = 0.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'SolveTest', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = ""
// end SimulationResult;
// -3.5
Expand Down

0 comments on commit 37fcc39

Please sign in to comment.