Skip to content

Commit

Permalink
Add test case for ticket:4061
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel committed Sep 29, 2016
1 parent 9c05703 commit 020ac7f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion simulation/modelica/equations/Makefile
Expand Up @@ -21,7 +21,7 @@ IfEquation4.mos \
IfEquation5.mos \
IfEquation6.mos \
IfEquationUnbalanced.mos \
ModelBalance1.mos ModelBalance2.mos ModelBalance3.mos \
ModelBalance1.mos ModelBalance2.mos ModelBalance3.mos ModelBalance4.mos \
ticket-2337.mos \
WatchDog1AlgorithmWhen.mos WatchDog2EquationWhen.mos \
WhenEquation.mos WhenEquation1.mos \
Expand Down
30 changes: 30 additions & 0 deletions simulation/modelica/equations/ModelBalance4.mos
@@ -0,0 +1,30 @@
// name: ModelBalance4
// keywords: balance
// status: correct
//
// Tests an unbalanced model with too many equations
// ticket 4061
//

loadString("
model ModelBalance4
Real a;
Real b=2;
equation
a = 2*b;
b = time+2;
end ModelBalance4;
"); getErrorString();
simulate(ModelBalance4); getErrorString();

// Result:
// true
// ""
// record SimulationResult
// resultFile = "",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'ModelBalance4', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "Failed to build model: ModelBalance4"
// end SimulationResult;
// "Error: Too many equations, over-determined system. The model has 3 equation(s) and 2 variable(s).
// "
// endResult

0 comments on commit 020ac7f

Please sign in to comment.