// name:     Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe1
// teardown_command: rm -f Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe1_*.mat
// keywords: simulation MSL Examples
// status: correct
// cflags: 	 +simCodeTarget=Cpp
//
// Simulation Results 
// Modelica Standard Library
//

loadModel(Modelica,{"3.2.1"}); getErrorString();

setMatchingAlgorithm("PFPlusExt"); getErrorString();
setIndexReductionMethod("dynamicStateSelection"); getErrorString();

simulate(Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe1, outputFormat="mat"); getErrorString();

res := OpenModelica.Scripting.compareSimulationResults("Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe1_res.mat",
  getEnvironmentVar("REFERENCEFILES")+"/msl32/Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe1.mat",
  "Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe1_diff.csv",0.01,0.0001,
  {"tank1.level",
   "tank1.medium.T",
   "tank2.level",
   "tank2.medium.T"});

// Result:
// true
// ""
// true
// ""
// true
// ""
// record SimulationResult
//     resultFile = "Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe1_res.mat",
//     simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 0.000001, method = 'dassl', fileNamePrefix = 'Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe1', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
//     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
