Skip to content

Commit eaa8f3f

Browse files
committed
- set a uniform stop criterion for all initialization methods
- always prompt an error, if the initialization fails git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13764 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 310bc20 commit eaa8f3f

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

SimulationRuntime/c/simulation/solver/initialization/method_kinsol.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@
104104
int kinsol_initialization(INIT_DATA *initData)
105105
{
106106
long i;
107-
double fnormtol = 1.e-9; /* function tolerance */
108-
double scsteptol = 1.e-9; /* step tolerance */
107+
double fnormtol = 1.e-12; /* function tolerance */
108+
double scsteptol = 1.e-12; /* step tolerance */
109109

110110
long int nni = 0, nfe = 0, nje = 0, nfeD = 0;
111111

SimulationRuntime/c/simulation/solver/initialization/method_newuoa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ static void leastSquare(long *nz, double *z, double *funcValue)
104104
int newuoa_initialization(INIT_DATA *initData)
105105
{
106106
long IPRINT = DEBUG_STREAM(LOG_INIT) ? 1000 : 0;
107-
long MAXFUN = 5000 * initData->nVars;
108-
double RHOEND = 1.0e-6;
107+
long MAXFUN = 1000 * initData->nVars;
108+
double RHOEND = 1.0e-12;
109109
double RHOBEG = 10; /* This should be about one tenth of the greatest
110110
expected value of a variable. Perhaps the nominal
111111
value can be used for this. */

SimulationRuntime/c/simulation/solver/initialization/method_simplex.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ int simplex_initialization(INIT_DATA* initData)
127127

128128
/* Set max. no. of function evaluations = 5000, print every 100. */
129129

130-
MAXF = 5000 * initData->nVars;
131-
IPRINT = DEBUG_STREAM(LOG_INIT) ? 1000 : -1;
130+
MAXF = 1000 * initData->nVars;
131+
IPRINT = DEBUG_STREAM(LOG_INIT) ? MAXF/10 : -1;
132132

133133
/* Set value for stopping criterion. Stopping occurs when the
134134
* standard deviation of the values of the objective function at

SimulationRuntime/c/simulation/solver/solver_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,13 @@ int solver_main(DATA* data, const char* init_initMethod,
172172

173173
if(initialization(data, init_initMethod, init_optiMethod, init_file, init_time))
174174
{
175-
WARNING(LOG_SOLVER, "| solver | Error in initialization. Storing results and exiting.");
175+
WARNING(LOG_STDOUT, "Error in initialization. Storing results and exiting.\nUse -lv LOG_INIT for more information.");
176176
simInfo->stopTime = simInfo->startTime;
177177
}
178178

179179
/* adrpo: write the parameter data in the file once again after bound parameters and initialization! */
180180
sim_result_writeParameterData(&(data->modelData));
181-
INFO(LOG_SOLVER, "| solver | Wrote parameters to the file after initialization (for output formats that support this)");
181+
INFO(LOG_SOLVER, "Wrote parameters to the file after initialization (for output formats that support this)");
182182
if (DEBUG_STREAM(LOG_DEBUG))
183183
printParameters(data);
184184

0 commit comments

Comments
 (0)