Skip to content

Commit

Permalink
Add getErrorString calls
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel committed Oct 15, 2015
1 parent 4877229 commit f03e18c
Show file tree
Hide file tree
Showing 18 changed files with 61 additions and 37 deletions.
6 changes: 4 additions & 2 deletions simulation/modelica/others/TestSolve.mos
Expand Up @@ -12,8 +12,9 @@ equation
( y / 1 ) * 2 = 1;
4 = ( 1 / z ) * 3;
end ModelTestSolve;
");getErrorString();
simulate(ModelTestSolve, simflags="-lv LOG_NLS_V");
"); getErrorString();

simulate(ModelTestSolve, simflags="-lv LOG_NLS_V"); getErrorString();
val(x,0.5);
val(y,0.5);
val(z,0.5);
Expand All @@ -31,6 +32,7 @@ val(z,0.5);
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// ""
// 2.0
// 0.5
// 0.75
Expand Down
5 changes: 3 additions & 2 deletions simulation/modelica/others/TestSolve10.mos
Expand Up @@ -16,9 +16,9 @@ equation
sin(z) = time;
w = asin(time);
end ModelTestSolve10;
");getErrorString();
"); getErrorString();

simulate(ModelTestSolve10, simflags="-lv LOG_NLS_V");
simulate(ModelTestSolve10, simflags="-lv LOG_NLS_V"); getErrorString();
val(x,0.5);
val(y,0.5);
val(z,0.5);
Expand All @@ -37,6 +37,7 @@ val(w,0.5);
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// ""
// 0.5235987755982989
// -3.665191429188092
// -9.948376736367678
Expand Down
5 changes: 3 additions & 2 deletions simulation/modelica/others/TestSolve11.mos
Expand Up @@ -16,9 +16,9 @@ equation
tan(z) = time;
w = atan(time);
end ModelTestSolve11;
");getErrorString();
"); getErrorString();

simulate(ModelTestSolve11, simflags="-lv LOG_NLS_V");
simulate(ModelTestSolve11, simflags="-lv LOG_NLS_V"); getErrorString();
val(x,0.5);
val(y,0.5);
val(z,0.5);
Expand All @@ -37,6 +37,7 @@ val(w,0.5);
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// ""
// 0.4636476090008061
// 3.605240262590599
// 9.888425569770185
Expand Down
5 changes: 3 additions & 2 deletions simulation/modelica/others/TestSolve12.mos
Expand Up @@ -18,9 +18,9 @@ equation
cos(x+cos(v)+w) = time;
w = acos(time);
end ModelTestSolve12;
");getErrorString();
"); getErrorString();

simulate(ModelTestSolve12, simflags="-lv LOG_NLS_V");
simulate(ModelTestSolve12, simflags="-lv LOG_NLS_V"); getErrorString();
val(x,0.5);
val(y,0.5);
val(z,0.5);
Expand All @@ -40,6 +40,7 @@ val(v,0.5);
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// ""
// -0.9737008433540479
// 0.9737008433540479
// 0.2298488470659301
Expand Down
5 changes: 3 additions & 2 deletions simulation/modelica/others/TestSolve13.mos
Expand Up @@ -18,9 +18,9 @@ equation
cos(x+v+w) = time;
w = acos(time);
end ModelTestSolve13;
");getErrorString();
"); getErrorString();

simulate(ModelTestSolve13, simflags="-lv LOG_NLS_V");
simulate(ModelTestSolve13, simflags="-lv LOG_NLS_V"); getErrorString();
val(x,0.5);
val(y,0.5);
val(z,0.5);
Expand All @@ -40,6 +40,7 @@ val(v,0.5);
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// ""
// -0.2298488470659301
// 0.9737008433540479
// 0.2298488470659301
Expand Down
6 changes: 4 additions & 2 deletions simulation/modelica/others/TestSolve14.mos
Expand Up @@ -18,9 +18,9 @@ equation
abs(cos(x+v+w)) = time;
abs(w) = acos(time);
end ModelTestSolve14;
");getErrorString();
"); getErrorString();

simulate(ModelTestSolve14, simflags="-lv LOG_NLS_V");
simulate(ModelTestSolve14, simflags="-lv LOG_NLS_V"); getErrorString();
val(x,0.5);
val(y,0.5);
val(z,0.5);
Expand All @@ -40,6 +40,8 @@ val(v,0.5);
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// "Warning: There are iteration variables with default zero start attribute. Use +d=initialization for more information.
// "
// -0.2298488470659301
// 0.9737008433540479
// 0.2298488470659301
Expand Down
5 changes: 3 additions & 2 deletions simulation/modelica/others/TestSolve15.mos
Expand Up @@ -18,9 +18,9 @@ equation
(log(abs(x+v+w)))^(exp(z)+1) = exp(time);
abs(w) = exp(acos(time));
end ModelTestSolve15;
");getErrorString();
"); getErrorString();

simulate(ModelTestSolve15, simflags="-lv LOG_NLS_V");
simulate(ModelTestSolve15, simflags="-lv LOG_NLS_V"); getErrorString();
val(x,0.5);
val(y,0.5);
val(z,0.5);
Expand All @@ -40,6 +40,7 @@ val(v,0.5);
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// ""
// -1.085543757874853
// 1.151917842006256
// 1.284025416687741
Expand Down
6 changes: 4 additions & 2 deletions simulation/modelica/others/TestSolve16.mos
Expand Up @@ -21,9 +21,9 @@ equation
a1 = abs(x+z+w);
a2 = abs(x+v+w);
end ModelTestSolve16;
");getErrorString();
"); getErrorString();

simulate(ModelTestSolve16, simflags="-lv LOG_NLS_V");
simulate(ModelTestSolve16, simflags="-lv LOG_NLS_V"); getErrorString();
val(x,0.5);
val(y,0.5);
val(z,0.5);
Expand All @@ -43,6 +43,8 @@ val(v,0.5);
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// "Warning: There are iteration variables with default zero start attribute. Use +d=initialization for more information.
// "
// -3.805609927078452
// 1.151917842006256
// 1.284025416687741
Expand Down
6 changes: 4 additions & 2 deletions simulation/modelica/others/TestSolve17.mos
Expand Up @@ -19,9 +19,9 @@ equation
+ abs((exp(sqrt(1-z)))^(x) -( x^2+time+1)) + abs(log(sqrt(((v-1))+1/y))^20 - y^2*exp(-10*time-100))
+ abs((sin(1/x + 1/v + 1/(sqrt(abs(z)/(z^2))) + 1/z) + sin(1/x) + sqrt(abs(v-1))*sqrt(w-1))^x);
end ModelTestSolve17;
");getErrorString();
"); getErrorString();

simulate(ModelTestSolve17, simflags="-lv LOG_NLS_V -s euler", stopTime=0.1);
simulate(ModelTestSolve17, simflags="-lv LOG_NLS_V -s euler", stopTime=0.1); getErrorString();
val(res,0.1);
val(res,0.0);

Expand All @@ -38,6 +38,8 @@ val(res,0.0);
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// "Warning: There are iteration variables with default zero start attribute. Use +d=initialization for more information.
// "
// 0.07916290493249595
// 0.0
// endResult
9 changes: 6 additions & 3 deletions simulation/modelica/others/TestSolve18.mos
Expand Up @@ -14,10 +14,10 @@ initial equation
equation
der(z) = x-y;
end ModelTestSolve18;
");getErrorString();
"); getErrorString();

simulate(ModelTestSolve18, tolerance=0.001);
val(z,1.0)
simulate(ModelTestSolve18, tolerance=0.001); getErrorString();
val(z,1.0);

// Result:
// true
Expand All @@ -31,5 +31,8 @@ val(z,1.0)
// assert | info | simulation terminated by an assertion at initialization
// "
// end SimulationResult;
// "Warning: The initial conditions are not fully specified. Use +d=initialization for more information.
// Warning: There are iteration variables with default zero start attribute. Use +d=initialization for more information.
// "
//
// endResult
5 changes: 3 additions & 2 deletions simulation/modelica/others/TestSolve2.mos
Expand Up @@ -22,9 +22,9 @@ equation
x[11] = sqrt(delay(x[11],0.01) + time);
exp(x[12]) * y[2] + y[3] * exp(x[12]) + y[4] * exp(x[12]) * y[3] + y[5] * (x[1] * y[4]) + y[7] * y[1] * y[9] * exp(x[12]) + y[1] * exp(x[12]) ^ 1 = 10 ^ time;
end ModelTestSolve2;
");getErrorString();
"); getErrorString();

simulate(ModelTestSolve2,simflags="-lv LOG_NLS_V");
simulate(ModelTestSolve2,simflags="-lv LOG_NLS_V"); getErrorString();
val(x[1],0.0);
val(x[2],0.0);
val(x[3],0.0);
Expand Down Expand Up @@ -63,6 +63,7 @@ val(x[12],1.0);
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// ""
// 0.008849557522123894
// 0.0
// 0.0
Expand Down
5 changes: 3 additions & 2 deletions simulation/modelica/others/TestSolve3.mos
Expand Up @@ -14,9 +14,9 @@ equation
y*sinh(w) = z*cosh(w);
cosh(v*(w+1) + time*10) = sinh(v*(w+1)+time*10);
end ModelTestSolve3;
");getErrorString();
"); getErrorString();

simulate(ModelTestSolve3, simflags="-lv LOG_NLS_V");
simulate(ModelTestSolve3, simflags="-lv LOG_NLS_V"); getErrorString();
val(x,0.0);
val(y,0.0);
val(z,0.0);
Expand All @@ -41,6 +41,7 @@ val(v,0.5);
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// ""
// 1.0
// 0.5493061443340549
// -0.0
Expand Down
5 changes: 3 additions & 2 deletions simulation/modelica/others/TestSolve4.mos
Expand Up @@ -24,9 +24,9 @@ equation

der(Err) = sum(err);
end ModelTestSolve4;
");getErrorString();
"); getErrorString();

simulate(ModelTestSolve4, simflags="-lv LOG_NLS_V");
simulate(ModelTestSolve4, simflags="-lv LOG_NLS_V"); getErrorString();
val(x[1],0.5);
val(y[1],0.5);
val(z[1],0.5);
Expand All @@ -48,6 +48,7 @@ val(Err,1);
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// ""
// -0.8140001025611593
// 1.108572441796849
// 0.2554128118829954
Expand Down
5 changes: 3 additions & 2 deletions simulation/modelica/others/TestSolve5.mos
Expand Up @@ -25,9 +25,9 @@ equation

der(Err) = sum(err);
end ModelTestSolve5;
");getErrorString();
"); getErrorString();

simulate(ModelTestSolve5, simflags="-lv LOG_NLS_V");
simulate(ModelTestSolve5, simflags="-lv LOG_NLS_V"); getErrorString();
val(x[1],0.5);
val(y[1],0.5);
val(z[1],0.5);
Expand All @@ -49,6 +49,7 @@ val(Err,1);
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// ""
// -1.318116071652818
// 0.2526802551420786
// 0.2449786631268641
Expand Down
5 changes: 3 additions & 2 deletions simulation/modelica/others/TestSolve6.mos
Expand Up @@ -16,9 +16,9 @@ equation
cos(z) = time;
w = acos(time);
end ModelTestSolve6;
");getErrorString();
"); getErrorString();

simulate(ModelTestSolve6, simflags="-lv LOG_NLS_V");
simulate(ModelTestSolve6, simflags="-lv LOG_NLS_V"); getErrorString();
val(x,0.5);
val(y,0.5);
val(z,0.5);
Expand All @@ -37,6 +37,7 @@ val(w,0.5);
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// ""
// 1.047197551196598
// 5.235987755982988
// 11.51917306316257
Expand Down
5 changes: 3 additions & 2 deletions simulation/modelica/others/TestSolve7.mos
Expand Up @@ -16,9 +16,9 @@ equation
sin(z) = time;
w = asin(time);
end ModelTestSolve7;
");getErrorString();
"); getErrorString();

simulate(ModelTestSolve7, simflags="-lv LOG_NLS_V");
simulate(ModelTestSolve7, simflags="-lv LOG_NLS_V"); getErrorString();
val(x,0.5);
val(y,0.5);
val(z,0.5);
Expand All @@ -37,6 +37,7 @@ val(w,0.5);
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// ""
// 0.5235987755982989
// 2.617993877991494
// 8.901179185171081
Expand Down
5 changes: 3 additions & 2 deletions simulation/modelica/others/TestSolve8.mos
Expand Up @@ -16,9 +16,9 @@ equation
tan(z) = time;
w = atan(time);
end ModelTestSolve8;
");getErrorString();
"); getErrorString();

simulate(ModelTestSolve8, simflags="-lv LOG_NLS_V");
simulate(ModelTestSolve8, simflags="-lv LOG_NLS_V"); getErrorString();
val(x,0.5);
val(y,0.5);
val(z,0.5);
Expand All @@ -37,6 +37,7 @@ val(w,0.5);
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// ""
// 0.4636476090008061
// 3.605240262590599
// 9.888425569770185
Expand Down
5 changes: 3 additions & 2 deletions simulation/modelica/others/TestSolve9.mos
Expand Up @@ -16,9 +16,9 @@ equation
cos(z) = time;
w = acos(time);
end ModelTestSolve9;
");getErrorString();
"); getErrorString();

simulate(ModelTestSolve9, simflags="-lv LOG_NLS_V");
simulate(ModelTestSolve9, simflags="-lv LOG_NLS_V"); getErrorString();
val(x,0.5);
val(y,0.5);
val(z,0.5);
Expand All @@ -37,6 +37,7 @@ val(w,0.5);
// LOG_NLS | info | free non-linear system solvers
// "
// end SimulationResult;
// ""
// -1.047197551196598
// -5.235987755982988
// -11.51917306316257
Expand Down

0 comments on commit f03e18c

Please sign in to comment.