由于内存不足,找不到 GEKKO (IPOPT) 解决方案?
GEKKO (IPOPT) Solution Not Found due to Out of memory?
我在使用时间序列数据在动态模式 (m.options.imode=4) 下模拟具有 50 系列 CSTR 的化学反应器时出现以下错误。稳态运行得很好。此外,动态模拟似乎适用于具有 15 个 CSTR 的更简单模型。
这个问题有解决方案吗?
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
如果同步模式 (IMODE=4
) 太大而耗尽内存,那么我建议您尝试顺序模式 (IMODE=7
).
from gekko import GEKKO
m = GEKKO(remote=False)
m.options.IMODE=7
# Your model
m.solve(disp=False)
切换到 IMODE=7
时的一些其他提示:
- 使用
remote=False
在您的计算机上而不是 public 服务器上求解
- 使用
disp=False
不显示解算器输出。打印语句会降低代码速度。
IMODE=4
和 IMODE=7
应该给出相同的结果,但它们是不同的解决方法。同步模式在collocation material in the Dynamic Optimization course.
中回顾
我在使用时间序列数据在动态模式 (m.options.imode=4) 下模拟具有 50 系列 CSTR 的化学反应器时出现以下错误。稳态运行得很好。此外,动态模拟似乎适用于具有 15 个 CSTR 的更简单模型。
这个问题有解决方案吗?
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
如果同步模式 (IMODE=4
) 太大而耗尽内存,那么我建议您尝试顺序模式 (IMODE=7
).
from gekko import GEKKO
m = GEKKO(remote=False)
m.options.IMODE=7
# Your model
m.solve(disp=False)
切换到 IMODE=7
时的一些其他提示:
- 使用
remote=False
在您的计算机上而不是 public 服务器上求解 - 使用
disp=False
不显示解算器输出。打印语句会降低代码速度。
IMODE=4
和 IMODE=7
应该给出相同的结果,但它们是不同的解决方法。同步模式在collocation material in the Dynamic Optimization course.