diff --git a/simulation/libraries/msl32/Modelica.Fluid.Examples.Tanks.TanksWithOverflow.mos b/simulation/libraries/msl32/Modelica.Fluid.Examples.Tanks.TanksWithOverflow.mos index 92e2e64ffd2..a050f3599da 100644 --- a/simulation/libraries/msl32/Modelica.Fluid.Examples.Tanks.TanksWithOverflow.mos +++ b/simulation/libraries/msl32/Modelica.Fluid.Examples.Tanks.TanksWithOverflow.mos @@ -33,6 +33,9 @@ runScript(modelTesting);getErrorString(); // assert | warning | The following assertion has been violated at time 5.000000 // | | | | overflow.flowModel.states[1].p >= 0.0 and overflow.flowModel.states[1].p <= 100000000.0 // assert | warning | Variable violating min/max constraint: 0.0 <= overflow.flowModel.states[1].p <= 100000000.0, has value: -93465.5 +// assert | warning | The following assertion has been violated at time 70.000000 +// | | | | lowerTank.ports[2].p >= 0.0 and lowerTank.ports[2].p <= 100000000.0 +// assert | warning | Variable violating min/max constraint: 0.0 <= lowerTank.ports[2].p <= 100000000.0, has value: -14378 // stdout | info | The simulation finished successfully. // // "true diff --git a/simulation/modelica/nonlinear_system/Makefile b/simulation/modelica/nonlinear_system/Makefile index e212f127a1e..4a05d6ae14e 100644 --- a/simulation/modelica/nonlinear_system/Makefile +++ b/simulation/modelica/nonlinear_system/Makefile @@ -47,6 +47,7 @@ problem11.mos \ problem12.mos \ TestInputIteration.mos \ TestFalseIterationNLS.mos \ +ScalingTest1.mos \ # test that currently fail. Move up when fixed. # Run make testfailing diff --git a/simulation/modelica/nonlinear_system/ScalingTest1.mos b/simulation/modelica/nonlinear_system/ScalingTest1.mos new file mode 100644 index 00000000000..447147c2fb5 --- /dev/null +++ b/simulation/modelica/nonlinear_system/ScalingTest1.mos @@ -0,0 +1,59 @@ +// name: ScalingTest1 +// status: correct +// +// + +loadModel(Modelica); getErrorString(); +loadString(" +model ScalingTest1 + parameter Real nom1 = 1e30; + parameter Real nom2 = 1e-12; + parameter Real fnom1 = 1e25; + parameter Real fnom2 = 1e-13; + Real x1(start=4*nom1,nominal=nom1); + Real x2(start=2*nom2,nominal=nom2); +equation + 0 = sin(x1/nom1)*cos(x2/nom2)*fnom2 - cos(x1/nom1)*sin(x2/nom2)*fnom2; + 0 = log(x1/nom1)*log(x2/nom2)*fnom1 - log(3)^2*fnom1; +end ScalingTest1; +"); getErrorString(); + +simulate(ScalingTest1); getErrorString(); +val(x1, 0.0); getErrorString(); +val(x2, 0.0); getErrorString(); + +simulate(ScalingTest1, simflags="-override nom1=1,nom2=1,fnom1=1,fnom2=1"); getErrorString(); +val(x1, 0.0); getErrorString(); +val(x2, 0.0); getErrorString(); + + +// Result: +// true +// "" +// true +// "" +// record SimulationResult +// resultFile = "ScalingTest1_res.mat", +// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'ScalingTest1', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''", +// messages = "stdout | info | The initialization finished successfully without homotopy method. +// stdout | info | The simulation finished successfully. +// " +// end SimulationResult; +// "" +// 5.217839301454226e+30 +// "" +// 2.076246647864433e-12 +// "" +// record SimulationResult +// resultFile = "ScalingTest1_res.mat", +// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'ScalingTest1', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = '-override nom1=1,nom2=1,fnom1=1,fnom2=1'", +// messages = "stdout | info | The initialization finished successfully without homotopy method. +// stdout | info | The simulation finished successfully. +// " +// end SimulationResult; +// "" +// 5.217839301454226 +// "" +// 2.076246647864433 +// "" +// endResult diff --git a/simulation/modelica/nonlinear_system/bug_2841.mos b/simulation/modelica/nonlinear_system/bug_2841.mos index 15bb00e4c11..9e48d225fbd 100644 --- a/simulation/modelica/nonlinear_system/bug_2841.mos +++ b/simulation/modelica/nonlinear_system/bug_2841.mos @@ -81,13 +81,13 @@ simulate(nonlinearSolverTests.bug_2841, stopTime=0.0, simflags="-lv=LOG_INIT,LOG // LOG_NLS_V | info | function values: [2-dim] // | | | | | -0.35724392 0.25583073 // LOG_NLS_V | info | scaled function values: [2-dim] -// | | | | | -0.17862196 0.25583073 +// | | | | | -0.17862196 0.32849316 // LOG_NLS_V | info | error measurements: // LOG_NLS_V | info | delta_x = 2.5510381250e+05 -// LOG_NLS_V | info | delta_x_scaled = 2.5510381250e+00 +// LOG_NLS_V | info | delta_x_scaled = 2.6029017761e+00 // LOG_NLS_V | info | newtonXTol = 1.0000000000e-12 // LOG_NLS_V | info | error_f = 4.3940025040e-01 -// LOG_NLS_V | info | error_f_scaled = 3.1201789440e-01 +// LOG_NLS_V | info | error_f_scaled = 3.7391651425e-01 // LOG_NLS_V | info | newtonFTol = 1.0000000000e-12 // LOG_NLS_V | info | Iteration: 2 // LOG_NLS_V | info | newton step @@ -105,7 +105,7 @@ simulate(nonlinearSolverTests.bug_2841, stopTime=0.0, simflags="-lv=LOG_INIT,LOG // | | | | | -0.012979095 -0.023836877 // LOG_NLS_V | info | error measurements: // LOG_NLS_V | info | delta_x = 2.9711975486e+04 -// LOG_NLS_V | info | delta_x_scaled = 2.9711975486e-01 +// LOG_NLS_V | info | delta_x_scaled = 3.2668067324e-01 // LOG_NLS_V | info | newtonXTol = 1.0000000000e-12 // LOG_NLS_V | info | error_f = 8.9380216642e-02 // LOG_NLS_V | info | error_f_scaled = 2.7141364009e-02 @@ -126,7 +126,7 @@ simulate(nonlinearSolverTests.bug_2841, stopTime=0.0, simflags="-lv=LOG_INIT,LOG // | | | | | 0.00038176671 0.00055228655 // LOG_NLS_V | info | error measurements: // LOG_NLS_V | info | delta_x = 3.8894602256e+03 -// LOG_NLS_V | info | delta_x_scaled = 3.8894602256e-02 +// LOG_NLS_V | info | delta_x_scaled = 3.9405401054e-02 // LOG_NLS_V | info | newtonXTol = 1.0000000000e-12 // LOG_NLS_V | info | error_f = 2.2072982312e-03 // LOG_NLS_V | info | error_f_scaled = 6.7139128116e-04 @@ -147,7 +147,7 @@ simulate(nonlinearSolverTests.bug_2841, stopTime=0.0, simflags="-lv=LOG_INIT,LOG // | | | | | 2.4931307e-07 2.6503402e-07 // LOG_NLS_V | info | error measurements: // LOG_NLS_V | info | delta_x = 6.2746972448e+01 -// LOG_NLS_V | info | delta_x_scaled = 6.2746972448e-04 +// LOG_NLS_V | info | delta_x_scaled = 6.9380430845e-04 // LOG_NLS_V | info | newtonXTol = 1.0000000000e-12 // LOG_NLS_V | info | error_f = 1.4052454980e-06 // LOG_NLS_V | info | error_f_scaled = 3.6386816259e-07 @@ -168,7 +168,7 @@ simulate(nonlinearSolverTests.bug_2841, stopTime=0.0, simflags="-lv=LOG_INIT,LOG // | | | | | 1.0271701e-13 8.595627e-14 // LOG_NLS_V | info | error measurements: // LOG_NLS_V | info | delta_x = 2.7596879198e-02 -// LOG_NLS_V | info | delta_x_scaled = 2.7596879199e-07 +// LOG_NLS_V | info | delta_x_scaled = 3.6775904375e-07 // LOG_NLS_V | info | newtonXTol = 1.0000000000e-12 // LOG_NLS_V | info | error_f = 5.5523886249e-13 // LOG_NLS_V | info | error_f_scaled = 1.3393753756e-13 @@ -189,7 +189,7 @@ simulate(nonlinearSolverTests.bug_2841, stopTime=0.0, simflags="-lv=LOG_INIT,LOG // | | | | | 0 -4.6312676e-17 // LOG_NLS_V | info | error measurements: // LOG_NLS_V | info | delta_x = 7.4635040900e-09 -// LOG_NLS_V | info | delta_x_scaled = 7.4635040908e-14 +// LOG_NLS_V | info | delta_x_scaled = 1.3268481481e-13 // LOG_NLS_V | info | newtonXTol = 1.0000000000e-12 // LOG_NLS_V | info | error_f = 1.1102230246e-16 // LOG_NLS_V | info | error_f_scaled = 4.6312676255e-17 @@ -259,7 +259,7 @@ simulate(nonlinearSolverTests.bug_2841, stopTime=0.0, simflags="-lv=LOG_INIT,LOG // | | | | | 8.8472946e-17 9.2625353e-17 // LOG_NLS_V | info | error measurements: // LOG_NLS_V | info | delta_x = 7.7595205169e-12 -// LOG_NLS_V | info | delta_x_scaled = 7.7595205169e-17 +// LOG_NLS_V | info | delta_x_scaled = 7.9960543487e-17 // LOG_NLS_V | info | newtonXTol = 1.0000000000e-12 // LOG_NLS_V | info | error_f = 4.9650683065e-16 // LOG_NLS_V | info | error_f_scaled = 1.2808949265e-16 diff --git a/simulation/modelica/tearing/dynamicTearing1.mos b/simulation/modelica/tearing/dynamicTearing1.mos index 75970f14612..fafa0011e14 100644 --- a/simulation/modelica/tearing/dynamicTearing1.mos +++ b/simulation/modelica/tearing/dynamicTearing1.mos @@ -596,8 +596,6 @@ val(z2,1.1); getErrorString(); // LOG_DT | info | Constraints of the casual tearing set are violated! Now the strict tearing set is used. // LOG_DT | info | Solving nonlinear system 18 (STRICT TEARING SET if tearing enabled) at time = 1.0000000000e+00 // LOG_DT | info | Solving nonlinear system 33 (CASUAL TEARING SET, strict: 28) at time = 1.0000000000e+00 -// LOG_DT | info | The determinant of the casual tearing set is vanishing, let's fail if this is not the solution... -// LOG_DT | info | It is not the solution. // LOG_DT | info | Solving the casual tearing set failed! Now the strict tearing set is used. // LOG_DT | info | Solving nonlinear system 28 (STRICT TEARING SET if tearing enabled) at time = 1.0000000000e+00 // LOG_DT | info | Solving nonlinear system 23 (CASUAL TEARING SET, strict: 18) at time = 1.0040000000e+00