Skip to content

Commit

Permalink
add test for evalFunc
Browse files Browse the repository at this point in the history
  • Loading branch information
vwaurich authored and OpenModelica-Hudson committed Aug 10, 2017
1 parent d51aef8 commit 2252051
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions simulation/modelica/functions_eval/Makefile
Expand Up @@ -4,6 +4,7 @@ FAILINGTESTFILES = \
Inverter2.mos

TESTFILES = \
partialConstArray.mos \
functionEvaluation.mos \
functionTest4.mos \
functionTest5.mos \
Expand Down
15 changes: 15 additions & 0 deletions simulation/modelica/functions_eval/partialConstArray.mo
@@ -0,0 +1,15 @@
model partialConstArray
Real x[2], y;
equation
(x,y) = f(x[1]);
end partialConstArray;

function f
input Real x1;
output Real x[2];
output Real y;
algorithm
x[1] := 2;
x[2] := x1 - 2;
y := x[1] + x[2];
end f;
21 changes: 21 additions & 0 deletions simulation/modelica/functions_eval/partialConstArray.mos
@@ -0,0 +1,21 @@
// name: partialConstArray
// keywords: evalConstFunc
// status: correct
//


loadFile("partialConstArray.mo"); getErrorString();
simulate(partialConstArray);getErrorString();

// Result:
// true
// ""
// record SimulationResult
// resultFile = "partialConstArray_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'partialConstArray', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "stdout | info | The initialization finished successfully without homotopy method.
// stdout | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// endResult

0 comments on commit 2252051

Please sign in to comment.