GEKKO (IPOPT) Solution Not Found due to Out of memory?

Viewed 442

I am getting following error while simulating a chemical reactor with 50 series CSTRs in Dynamic mode (m.options.imode=4) with time-series data. The steady-state runs just fine. Also, dynamic simulation seems to work for a simpler model with 15 CSTRs.

Is there a solution for this issue?

MUMPS returned INFO(1) =-13 - out of memory when trying to allocate 219104583 bytes.
In some cases it helps to decrease the value of the option "mumps_mem_percent".
WARNING: Problem in step computation; switching to emergency mode.
   1r0.0000000e+000 2.87e+001 9.99e+002   1.5 0.00e+000    -  0.00e+000 0.00e+000R  1
MUMPS returned INFO(1) =-13 - out of memory when trying to allocate 219104583 bytes.
In some cases it helps to decrease the value of the option "mumps_mem_percent".
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...............:  0.0000000000000000e+000   0.0000000000000000e+000
Dual infeasibility......:  0.0000000000000000e+000   0.0000000000000000e+000
Constraint violation....:  2.8680600237259355e+001   2.8680600237259355e+001
Complementarity.........:  0.0000000000000000e+000   0.0000000000000000e+000
Overall NLP error.......:  2.8680600237259355e+001   2.8680600237259355e+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)   =      1.672
Total CPU secs in NLP function evaluations           =      4.237

EXIT: Restoration Failed!

 An error occured.
 The error code is  -2
1 Answers

If the simultaneous mode (IMODE=4) is too large and runs out of memory then I recommend that you try the sequential mode with (IMODE=7).

from gekko import GEKKO
m = GEKKO(remote=False)
m.options.IMODE=7

# Your model

m.solve(disp=False)

A couple other tips when switching to IMODE=7:

  • Use remote=False to solve on your computer instead of a public server
  • Use disp=False to not show the solver output. Print statements can slow down the code.

IMODE=4 and IMODE=7 should give equivalent results but they are different solution methods. The simultaneous mode is reviewed in the collocation material in the Dynamic Optimization course.

Related