Skip to content

Commit

Permalink
New test and expected output
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaeuber authored and OpenModelica-Hudson committed Oct 5, 2017
1 parent 118b3d0 commit 64ace5b
Show file tree
Hide file tree
Showing 22 changed files with 183 additions and 54 deletions.
Expand Up @@ -16,16 +16,6 @@ simulate(ThermoPower.Test.DistributedParameterComponents.TestFlow1D2phDB_hf); ge
// stdout | info | The simulation finished successfully.
// "
// end SimulationResult;
// "Notification: The following equation is consistent and got removed from the initialization problem: $DER.hex.p = 0.0
// Notification: The following equation is consistent and got removed from the initialization problem: $DER.hex.htilde[1] = 0.0
// Notification: The following equation is consistent and got removed from the initialization problem: $DER.hex.htilde[2] = 0.0
// Notification: The following equation is consistent and got removed from the initialization problem: $DER.hex.htilde[3] = 0.0
// Notification: The following equation is consistent and got removed from the initialization problem: $DER.hex.htilde[4] = 0.0
// Notification: The following equation is consistent and got removed from the initialization problem: $DER.hex.htilde[5] = 0.0
// Notification: The following equation is consistent and got removed from the initialization problem: $DER.hex.htilde[6] = 0.0
// Notification: The following equation is consistent and got removed from the initialization problem: $DER.hex.htilde[7] = 0.0
// Notification: The following equation is consistent and got removed from the initialization problem: $DER.hex.htilde[8] = 0.0
// Notification: The following equation is consistent and got removed from the initialization problem: $DER.hex.htilde[9] = 0.0
// Warning: The initial conditions are over specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").
// "Warning: The initial conditions are over specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").
// "
// endResult
Expand Up @@ -24,7 +24,7 @@ res := OpenModelica.Scripting.compareSimulationResults("Modelica.Mechanics.Multi
// "
// end SimulationResult;
// "[Modelica 3.1/Mechanics/MultiBody/Joints.mo:2345:5-2348:81:writable] Warning: The parameter universalSpherical.rodLength has fixed = false and a binding equation universalSpherical.rodLength = 1.048808848170152, which is probably redundant. The binding equation will be ignored, as it is expected for Modelica 3.1.
// Notification: It was not possible to analyze the given system symbolically, because the relevant equations are part of an algebraic loop. This is not supported yet.
// Notification: It was not possible to check the given initialization system for consistency symbolically, because the relevant equations are part of an algebraic loop. This is not supported yet.
// 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").
// Warning: The initial conditions are over specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").
// "
Expand Down
1 change: 1 addition & 0 deletions simulation/modelica/initialization/Makefile
Expand Up @@ -74,6 +74,7 @@ OverdeterminedInitialization.Mechanical.TwoMassesFullSteadyState.mos \
OverdeterminedInitialization.Fluid.TwoVolumesFullInitialInconsistent.mos \
OverdeterminedInitialization.Fluid.TwoVolumesFullInitial.mos \
OverdeterminedInitialization.Fluid.TwoVolumesFullSteadyStatePressureAndTemperature.mos \
redundantInitialEquations.mos \

# test that currently fail. Move up when fixed.
# Run make failingtest
Expand Down
Expand Up @@ -5,15 +5,21 @@
loadModel(Modelica); getErrorString();
loadFile("OverdeterminedInitialization.mo"); getErrorString();

setCommandLineOptions("-d=initialization"); getErrorString();
buildModel(OverdeterminedInitialization.Electrical.Test3PhaseSystemsFullInitial); getErrorString();

// Result:
// true
// ""
// true
// ""
// true
// ""
// {"OverdeterminedInitialization.Electrical.Test3PhaseSystemsFullInitial","OverdeterminedInitialization.Electrical.Test3PhaseSystemsFullInitial_init.xml"}
// "Notification: It was not possible to analyze the given system symbolically, because the relevant equations are part of an algebraic loop. This is not supported yet.
// Warning: The initial conditions are over specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").
// "Notification: It was not possible to check the given initialization system for consistency symbolically, because the relevant equations are part of an algebraic loop. This is not supported yet.
// Warning: The initial conditions are over specified. The following 3 initial equations are redundant, so they are removed from the initialization sytem:
// $DER.LR1.i_dq0[2] = 0.0
// $DER.LR2.i_dq0[3] = 0.0
// LR2.R1.R_actual = LR2.R1.R * (1.0 + LR2.R1.alpha * (LR2.R1.T - LR2.R1.T_ref)).
// "
// endResult
Expand Up @@ -5,22 +5,26 @@
loadModel(Modelica); getErrorString();
loadFile("OverdeterminedInitialization.mo"); getErrorString();

setCommandLineOptions("-d=initialization"); getErrorString();
simulate(OverdeterminedInitialization.Fluid.DynamicPipeInitialValues); getErrorString();

// Result:
// true
// ""
// true
// ""
// true
// ""
// record SimulationResult
// resultFile = "OverdeterminedInitialization.Fluid.DynamicPipeInitialValues_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 4.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'OverdeterminedInitialization.Fluid.DynamicPipeInitialValues', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "stdout | info | The initialization finished successfully without homotopy method.
// stdout | info | The simulation finished successfully.
// "
// end SimulationResult;
// "Notification: The following equation is consistent and got removed from the initialization problem: pipe.mediums[1].p = 10000000.0
// 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").
// Warning: The initial conditions are over specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").
// "Warning: Assuming fixed start value for the following 1 variables:
// m_flow_initial:DISCRETE(unit = "kg/s" fixed = false ) type: Real
// Warning: The initial conditions are over specified. The following 1 initial equations are redundant, so they are removed from the initialization sytem:
// pipe.mediums[1].p = 10000000.0.
// "
// endResult
Expand Up @@ -5,19 +5,23 @@
loadModel(Modelica); getErrorString();
loadFile("OverdeterminedInitialization.mo"); getErrorString();

setCommandLineOptions("-d=initialization"); getErrorString();
buildModel(OverdeterminedInitialization.Fluid.DynamicPipeLumpedPressureInitialization); getErrorString();

// Result:
// true
// ""
// true
// ""
// true
// ""
// {"OverdeterminedInitialization.Fluid.DynamicPipeLumpedPressureInitialization","OverdeterminedInitialization.Fluid.DynamicPipeLumpedPressureInitialization_init.xml"}
// "Notification: The following equation is consistent and got removed from the initialization problem: $DER.pipe.mediums[2].p = 0.0
// Notification: The following equation is consistent and got removed from the initialization problem: $DER.pipe.mediums[3].p = 0.0
// Notification: The following equation is consistent and got removed from the initialization problem: $DER.pipe.mediums[4].p = 0.0
// Notification: The following equation is consistent and got removed from the initialization problem: $DER.pipe.mediums[1].p = 0.0
// 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").
// Warning: The initial conditions are over specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").
// "Warning: Assuming fixed start value for the following 1 variables:
// m_flow_initial:DISCRETE(unit = "kg/s" fixed = false ) type: Real
// Warning: The initial conditions are over specified. The following 4 initial equations are redundant, so they are removed from the initialization sytem:
// $DER.pipe.mediums[2].p = 0.0
// $DER.pipe.mediums[3].p = 0.0
// $DER.pipe.mediums[4].p = 0.0
// $DER.pipe.mediums[1].p = 0.0.
// "
// endResult
Expand Up @@ -5,15 +5,19 @@
loadModel(Modelica); getErrorString();
loadFile("OverdeterminedInitialization.mo"); getErrorString();

setCommandLineOptions("-d=initialization"); getErrorString();
buildModel(OverdeterminedInitialization.Fluid.DynamicPipesSeriesLargeNSteadyStateInitial); getErrorString();

// Result:
// true
// ""
// true
// ""
// true
// ""
// {"OverdeterminedInitialization.Fluid.DynamicPipesSeriesLargeNSteadyStateInitial","OverdeterminedInitialization.Fluid.DynamicPipesSeriesLargeNSteadyStateInitial_init.xml"}
// "Notification: The following equation is consistent and got removed from the initialization problem: $DER.pipe1.mediums[50].p = 0.0
// Warning: The initial conditions are over specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").
// "Notification: The following initial equation is redundant and consistent due to simplifications in RemoveSimpleEquations and therefore removed from the initialization problem: der(pipe1.mediums[1].p) = 0.0 -> 0.0 = 0.0
// Warning: The initial conditions are over specified. The following 1 initial equations are redundant, so they are removed from the initialization sytem:
// $DER.pipe1.mediums[50].p = 0.0.
// "
// endResult
Expand Up @@ -5,15 +5,19 @@
loadModel(Modelica); getErrorString();
loadFile("OverdeterminedInitialization.mo"); getErrorString();

setCommandLineOptions("-d=initialization"); getErrorString();
buildModel(OverdeterminedInitialization.Fluid.DynamicPipesSeriesSteadyStateInitial); getErrorString();

// Result:
// true
// ""
// true
// ""
// true
// ""
// {"OverdeterminedInitialization.Fluid.DynamicPipesSeriesSteadyStateInitial","OverdeterminedInitialization.Fluid.DynamicPipesSeriesSteadyStateInitial_init.xml"}
// "Notification: The following equation is consistent and got removed from the initialization problem: $DER.pipe1.mediums[5].p = 0.0
// Warning: The initial conditions are over specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").
// "Notification: The following initial equation is redundant and consistent due to simplifications in RemoveSimpleEquations and therefore removed from the initialization problem: der(pipe1.mediums[1].p) = 0.0 -> 0.0 = 0.0
// Warning: The initial conditions are over specified. The following 1 initial equations are redundant, so they are removed from the initialization sytem:
// $DER.pipe1.mediums[5].p = 0.0.
// "
// endResult
Expand Up @@ -5,15 +5,18 @@
loadModel(Modelica); getErrorString();
loadFile("OverdeterminedInitialization.mo"); getErrorString();

setCommandLineOptions("-d=initialization"); getErrorString();
buildModel(OverdeterminedInitialization.Fluid.TwoVolumesEquationsFullInitial); getErrorString();

// Result:
// true
// ""
// true
// ""
// true
// ""
// {"OverdeterminedInitialization.Fluid.TwoVolumesEquationsFullInitial","OverdeterminedInitialization.Fluid.TwoVolumesEquationsFullInitial_init.xml"}
// "Notification: The following equation is consistent and got removed from the initialization problem: p1 = 100000.0
// Warning: The initial conditions are over specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").
// "Warning: The initial conditions are over specified. The following 1 initial equations are redundant, so they are removed from the initialization sytem:
// p1 = 100000.0.
// "
// endResult
Expand Up @@ -5,15 +5,19 @@
loadModel(Modelica); getErrorString();
loadFile("OverdeterminedInitialization.mo"); getErrorString();

setCommandLineOptions("-d=initialization"); getErrorString();
buildModel(OverdeterminedInitialization.Fluid.TwoVolumesEquationsFullInitialInconsistent); getErrorString();

// Result:
// true
// ""
// true
// ""
// true
// ""
// {"OverdeterminedInitialization.Fluid.TwoVolumesEquationsFullInitialInconsistent","OverdeterminedInitialization.Fluid.TwoVolumesEquationsFullInitialInconsistent_init.xml"}
// "Error: The initialization problem is inconsistent due to the following equation: p1 = 100000.0 (200000.0 = 100000.0)
// Warning: The initial conditions are over specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").
// Warning: The initial conditions are over specified. The following 1 initial equations are redundant, so they are removed from the initialization sytem:
// p1 = 100000.0.
// "
// endResult
Expand Up @@ -5,16 +5,25 @@
loadModel(Modelica); getErrorString();
loadFile("OverdeterminedInitialization.mo"); getErrorString();

setCommandLineOptions("-d=initialization"); getErrorString();
buildModel(OverdeterminedInitialization.Fluid.TwoVolumesEquationsFullSteadyStateMassAndEnergy); getErrorString();

// Result:
// true
// ""
// true
// ""
// true
// ""
// {"OverdeterminedInitialization.Fluid.TwoVolumesEquationsFullSteadyStateMassAndEnergy","OverdeterminedInitialization.Fluid.TwoVolumesEquationsFullSteadyStateMassAndEnergy_init.xml"}
// "Notification: It was not possible to analyze the given system symbolically, because the relevant equations are part of an algebraic loop. This is not supported yet.
// Warning: The initial conditions are over specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").
// 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").
// "Notification: It was not possible to check the given initialization system for consistency symbolically, because the relevant equations are part of an algebraic loop. This is not supported yet.
// Warning: The initial conditions are over specified. The following 1 initial equations are redundant, so they are removed from the initialization sytem:
// $DER.M2 = 0.0.
// Warning: Iteration variables with default zero start attribute in torn nonlinear equation system:
// T2:VARIABLE(stateSelect=StateSelect.prefer ) type: Real
// $DER.T1:VARIABLE(stateSelect=StateSelect.prefer ) type: Real
// $DER.p1:VARIABLE(stateSelect=StateSelect.prefer ) type: Real
// $DER.T2:VARIABLE(stateSelect=StateSelect.prefer ) type: Real
// p1:VARIABLE(stateSelect=StateSelect.prefer ) type: Real
// "
// endResult
Expand Up @@ -5,16 +5,22 @@
loadModel(Modelica); getErrorString();
loadFile("OverdeterminedInitialization.mo"); getErrorString();

setCommandLineOptions("-d=initialization"); getErrorString();
buildModel(OverdeterminedInitialization.Fluid.TwoVolumesEquationsFullSteadyStatePressureAndTemperature); getErrorString();

// Result:
// true
// ""
// true
// ""
// true
// ""
// {"OverdeterminedInitialization.Fluid.TwoVolumesEquationsFullSteadyStatePressureAndTemperature","OverdeterminedInitialization.Fluid.TwoVolumesEquationsFullSteadyStatePressureAndTemperature_init.xml"}
// "Notification: The following equation is consistent and got removed from the initialization problem: $DER.p1 = 0.0
// Warning: The initial conditions are over specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").
// 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").
// "Warning: The initial conditions are over specified. The following 1 initial equations are redundant, so they are removed from the initialization sytem:
// $DER.p1 = 0.0.
// Warning: Iteration variables with default zero start attribute in torn nonlinear equation system:
// T1:VARIABLE(stateSelect=StateSelect.prefer ) type: Real
// T2:VARIABLE(stateSelect=StateSelect.prefer ) type: Real
// p2:VARIABLE(stateSelect=StateSelect.prefer ) type: Real
// "
// endResult
Expand Up @@ -5,16 +5,21 @@
loadModel(Modelica); getErrorString();
loadFile("OverdeterminedInitialization.mo"); getErrorString();

setCommandLineOptions("-d=initialization"); getErrorString();
buildModel(OverdeterminedInitialization.Fluid.TwoVolumesFullInitial); getErrorString();

// Result:
// true
// ""
// true
// ""
// true
// ""
// {"OverdeterminedInitialization.Fluid.TwoVolumesFullInitial","OverdeterminedInitialization.Fluid.TwoVolumesFullInitial_init.xml"}
// "Warning: It was not possible to determine if the initialization problem is consistent, because of not evaluable parameters/start values during compile time: V1.medium.p = V1.p_start (V2.p_start = V1.p_start)
// Warning: The initial conditions are over specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").
// 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").
// Warning: The initial conditions are over specified. The following 1 initial equations are redundant, so they are removed from the initialization sytem:
// V1.medium.p = V1.p_start.
// Warning: Iteration variables with default zero start attribute in torn nonlinear equation system:
// V1.ports[2].m_flow:VARIABLE(flow=true min = -100000.0 max = 100000.0 unit = "kg/s" ) "Mass flow rate from the connection point into the component" type: Real [2]
// "
// endResult

0 comments on commit 64ace5b

Please sign in to comment.