Skip to content

Commit

Permalink
- added flag: swtch hesse in ipopt e.g. BFGS
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18921 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Vitalij Ruge committed Feb 1, 2014
1 parent 3c5c7da commit 1fd7d44
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion SimulationRuntime/c/optimization/mainOptimizer/ipoptODE.c
Expand Up @@ -118,7 +118,13 @@ int startIpopt(DATA* data, SOLVER_INFO* solverInfo, int flag)
AddIpoptIntOption(nlp, "file_print_level", 0);

AddIpoptStrOption(nlp, "mu_strategy", "adaptive");
/*AddIpoptStrOption(nlp, "hessian_approximation", "limited-memory");*/


cflags = (char*)omc_flagValue[FLAG_IPOPT_HESSE];
if(cflags){
if(!strcmp(cflags,"BFGS"))
AddIpoptStrOption(nlp, "hessian_approximation", "limited-memory");
}


cflags = (char*)omc_flagValue[FLAG_LS_IPOPT];
Expand Down
4 changes: 4 additions & 0 deletions SimulationRuntime/c/util/simulation_options.c
Expand Up @@ -43,6 +43,7 @@ const char *FLAG_NAME[FLAG_MAX+1] = {
/* FLAG_ILS */ "ils",
/* FLAG_INTERACTIVE */ "interactive",
/* FLAG_IOM */ "iom",
/* FLAG_IPOPT_HESSE*/ "ipopt_hesse",
/* FLAG_L */ "l",
/* FLAG_LOG_FORMAT */ "logFormat",
/* FLAG_LS */ "ls",
Expand Down Expand Up @@ -76,6 +77,7 @@ const char *FLAG_DESC[FLAG_MAX+1] = {
/* FLAG_ILS */ "[int] default: 1",
/* FLAG_INTERACTIVE */ "specify interactive simulation",
/* FLAG_IOM */ "value specifies the initialization optimization method",
/* FLAG_IPOPT_HESSE */ "value specifies the hessematrix for Ipopt",
/* FLAG_L */ "value specifies a time where the linearization of the model should be performed",
/* FLAG_LOG_FORMAT */ "value specifies the log format of the executable. -logFormat=text (default) or -logFormat=xml",
/* FLAG_LS */ "value specifies the linear solver method",
Expand Down Expand Up @@ -109,6 +111,7 @@ const char *FLAG_DETAILED_DESC[FLAG_MAX+1] = {
/* FLAG_ILS */ "value specifies the number of steps for homotopy method (required: -iim=symbolic) or\n'start value homotopy' method (required: -iim=numeric -iom=nelder_mead_ex)",
/* FLAG_INTERACTIVE */ "specify interactive simulation",
/* FLAG_IOM */ "value specifies the initialization optimization method",
/* FLAG_IPOPT_HESSE */ "value specifies the hessematrix for Ipopt(OMC, BFGS)",
/* FLAG_L */ "value specifies a time where the linearization of the model should be performed",
/* FLAG_LOG_FORMAT */ "value specifies the log format of the executable. -logFormat=text (default) or -logFormat=xml",
/* FLAG_LS */ "value specifies the linear solver method\n lapack, lis",
Expand Down Expand Up @@ -142,6 +145,7 @@ const int FLAG_TYPE[FLAG_MAX] = {
/* FLAG_ILS */ FLAG_TYPE_OPTION,
/* FLAG_INTERACTIVE */ FLAG_TYPE_FLAG,
/* FLAG_IOM */ FLAG_TYPE_OPTION,
/* FLAG_IPOPT_HESSE */ FLAG_TYPE_OPTION,
/* FLAG_L */ FLAG_TYPE_OPTION,
/* FLAG_LOG_FORMAT */ FLAG_TYPE_OPTION,
/* FLAG_LS */ FLAG_TYPE_OPTION,
Expand Down
1 change: 1 addition & 0 deletions SimulationRuntime/c/util/simulation_options.h
Expand Up @@ -50,6 +50,7 @@ enum _FLAG
FLAG_ILS,
FLAG_INTERACTIVE,
FLAG_IOM,
FLAG_IPOPT_HESSE,
FLAG_L,
FLAG_LOG_FORMAT,
FLAG_LS,
Expand Down

0 comments on commit 1fd7d44

Please sign in to comment.