Gekko couldn't find a solution (Error code -2)

Viewed 36

I'm having trouble understanding why gekko couldn't find a solution for my optimization problem. It works on some data but for one in specifically I get this message:

     **********************************************
 Steady State Optimization with Interior Point Solver
 **********************************************

 Info: Exact Hessian

******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
 Ipopt is released as open source code under the Eclipse Public License (EPL).
         For more information visit http://projects.coin-or.org/Ipopt
******************************************************************************

This is Ipopt version 3.10.2, running with linear solver mumps.

Starting derivative checker for first derivatives.

Starting derivative checker for second derivatives.


No errors detected by derivative checker.

Number of nonzeros in equality constraint Jacobian...:     1184
Number of nonzeros in inequality constraint Jacobian.:        0
Number of nonzeros in Lagrangian Hessian.............:       98

Total number of variables............................:      533
                     variables with only lower bounds:      290
                variables with lower and upper bounds:       48
                     variables with only upper bounds:        0
Total number of equality constraints.................:      413
Total number of inequality constraints...............:        0
        inequality constraints with only lower bounds:        0
   inequality constraints with lower and upper bounds:        0
        inequality constraints with only upper bounds:        0

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
   0 2.5976772e+005 1.00e+002 1.00e+000   0.0 0.00e+000    -  0.00e+000 0.00e+000   0
WARNING: Problem in step computation; switching to emergency mode.
   1r2.5976772e+005 1.00e+002 9.99e+002   2.0 0.00e+000  20.0 0.00e+000 0.00e+000R  1
WARNING: Problem in step computation; switching to emergency mode.
Restoration phase is called at point that is almost feasible,
  with constraint violation 0.000000e+000. Abort.
Restoration phase in the restoration phase failed.

Number of Iterations....: 1

                                   (scaled)                 (unscaled)
Objective...............:  3.1661132589884342e+003   2.5976771997527982e+005
Dual infeasibility......:  1.0000000000000000e+000   8.2046250000000001e+001
Constraint violation....:  9.9990000010000003e+001   9.9990000010000003e+001
Complementarity.........:  1.0000000099999999e+000   8.2046250820462490e+001
Overall NLP error.......:  9.9990000010000003e+001   9.9990000010000003e+001


Number of objective function evaluations             = 2
Number of objective gradient evaluations             = 2
Number of equality constraint evaluations            = 2
Number of inequality constraint evaluations          = 0
Number of equality constraint Jacobian evaluations   = 2
Number of inequality constraint Jacobian evaluations = 0
Number of Lagrangian Hessian evaluations             = 2
Total CPU secs in IPOPT (w/o function evaluations)   =    179.691
Total CPU secs in NLP function evaluations           =      0.006

EXIT: Restoration Failed!

 An error occured.
 The error code is  -2


 ---------------------------------------------------
 Solver         :  IPOPT (v3.12)
 Solution time  :  179.70250000000001 sec
 Objective      :  259767.71997527982
 Unsuccessful with error code  0
 ---------------------------------------------------

 Creating file: infeasibilities.txt
 Use command apm_get(server,app,'infeasibilities.txt') to retrieve file
 Called files( 21 )
 Called files( 2 )
 Called files( 53 )
 WRITE dbs FILE
 Called files( 56 )
 WRITE json FILE
 Called files( 2 )
 Called files( 3 )
 Called files( 21 )
 Called files( 23 )
 Called files( 24 )
 Called files( 25 )
 Called files( 33 )
 WRITE latex documentation
 apm_end_timer: timer not yet started
 Called files( 11 )
 Files(11): File Read warm.t0 F
 files: warm.t0 does not exist
 Called files( 12 )
 Files(12): File Read lam.t0 F
 files: lam.t0 does not exist
Timer #     1       0.00/       0 =       0.00 Total system time
Timer #     2     179.70/       1 =     179.70 Total solve time
Timer #     3       0.01/     536 =       0.00 Objective Calc: apm_p
Timer #     4       0.01/     537 =       0.00 Objective Grad: apm_g
Timer #     5       0.01/     536 =       0.00 Constraint Calc: apm_c
Timer #     6       0.00/       2 =       0.00 Sparsity: apm_s
Timer #     7       2.14/  220133 =       0.00 1st Deriv #1: apm_a1
Timer #     8       0.00/       0 =       0.00 1st Deriv #2: apm_a2
Timer #     9       0.00/       0 =       0.00 Custom Init: apm_custom_init
Timer #    10       0.00/       0 =       0.00 Mode: apm_node_res::case 0
Timer #    11       0.00/       0 =       0.00 Mode: apm_node_res::case 1
Timer #    12       0.00/       0 =       0.00 Mode: apm_node_res::case 2
Timer #    13       0.00/       0 =       0.00 Mode: apm_node_res::case 3
Timer #    14       0.35/    1074 =       0.00 Mode: apm_node_res::case 4
Timer #    15     156.17/  220670 =       0.00 Mode: apm_node_res::case 5
Timer #    16       0.53/     417 =       0.00 Mode: apm_node_res::case 6
Timer #    17       7.22/  220134 =       0.00 Base 1st Deriv: apm_jacobian
Timer #    18       0.00/       0 =       0.00 Base 1st Deriv: apm_condensed_jacobian
Timer #    19       0.00/       2 =       0.00 Non-zeros: apm_nnz
Timer #    20       0.00/      15 =       0.00 Count: Division by zero
Timer #    21       0.00/       0 =       0.00 Count: Argument of LOG10 negative
Timer #    22       0.00/       0 =       0.00 Count: Argument of LOG negative
Timer #    23       0.00/       0 =       0.00 Count: Argument of SQRT negative
Timer #    24       0.00/       0 =       0.00 Count: Argument of ASIN illegal
Timer #    25       0.00/       0 =       0.00 Count: Argument of ACOS illegal
Timer #    26       0.00/       2 =       0.00 Extract sparsity: apm_sparsity
Timer #    27       0.00/       8 =       0.00 Variable ordering: apm_var_order
Timer #    28       0.00/       0 =       0.00 Condensed sparsity
Timer #    29       0.00/       2 =       0.00 Hessian Non-zeros
Timer #    30       0.00/       2 =       0.00 Differentials
Timer #    31       0.00/     415 =       0.00 Hessian Calculation
Timer #    32       0.01/     419 =       0.00 Extract Hessian
Timer #    33       0.00/       2 =       0.00 Base 1st Deriv: apm_jac_order
Timer #    34       0.00/       1 =       0.00 Solver Setup
Timer #    35      13.24/       1 =      13.24 Solver Solution
Timer #    36       0.01/     548 =       0.00 Number of Variables
Timer #    37       0.00/       5 =       0.00 Number of Equations
Timer #    38       0.11/      13 =       0.01 File Read/Write
Timer #    39       0.00/       0 =       0.00 Dynamic Init A
Timer #    40       0.00/       0 =       0.00 Dynamic Init B
Timer #    41       0.00/       0 =       0.00 Dynamic Init C
Timer #    42       0.00/       0 =       0.00 Init: Read APM File
Timer #    43       0.00/       0 =       0.00 Init: Parse Constants
Timer #    44       0.00/       0 =       0.00 Init: Model Sizing
Timer #    45       0.00/       0 =       0.00 Init: Allocate Memory
Timer #    46       0.00/       0 =       0.00 Init: Parse Model
Timer #    47       0.00/       0 =       0.00 Init: Check for Duplicates
Timer #    48       0.00/       0 =       0.00 Init: Compile Equations
Timer #    49       0.00/       0 =       0.00 Init: Check Uninitialized
Timer #    50       0.00/       0 =       0.00 Evaluate Expression Once
Timer #    51       0.00/       0 =       0.00 Sensitivity Analysis: LU Factorization
Timer #    52       0.00/       0 =       0.00 Sensitivity Analysis: Gauss Elimination
Timer #    53       0.00/       0 =       0.00 Sensitivity Analysis: Total Time
 @error: Solution Not Found

And I've tried reading the infeasabilities.txt file but it is quite criptic, I don't understand what each column means and what is creating the conflict.

I would appreciate any help to

1 Answers

This is a problem with the solver, IPOPT (3), in finding a solution. Try switching solvers to APOPT (1) or BPOPT (2):

m.options.SOLVER=1

If it is a problem with divide-by-zero then it will typically have a large objective or primal infeasibility. There is additional information about the solver output and options in the documentation.

To get more specific help, please post a complete and minimal problem that reproduces the issue.

Related