早上好,我目前正在使用Gekko进行动态优化。我运行的模拟表明它正在收敛。
from gekko import GEKKO
m = GEKKO()
x = m.Array(m.Var,3)
m.Equation(3*x[0]-2*x[1]**2==7)
m.Equation(4*x[0]-x[2]**2==11)
m.Equation(3*x[0]-2*x[1]**2-7==(3*x[0]-2*x[1]**2-7)**2)
m.Minimize(4*x[0]**2 + 2*x[1]**2 + 2*x[2]**2\
-33*x[0] + 16*x[1] - 24*x[2])
m.solve()Number of objective function evaluations = 62
Number of objective gradient evaluations = 10
Number of equality constraint evaluations = 63
Number of inequality constraint evaluations = 0
Number of equality constraint Jacobian evaluations = 30
Number of inequality constraint Jacobian evaluations = 0
Number of Lagrangian Hessian evaluations = 28
Total CPU secs in IPOPT (w/o function evaluations) = 0.024
Total CPU secs in NLP function evaluations = 0.002
EXIT: Optimal Solution Found.
The solution was found.
The final value of the objective function is 343.408879673171
---------------------------------------------------
Solver : IPOPT (v3.12)
Solution time : 4.040000001259614E-002 sec
Objective : 343.408879673171
Successful solution
---------------------------------------------------但是,当我查看IPOPT详细信息的结果时,它显示以下错误。
27r 3.4340888e+02 1.20e-06 3.85e-01 -9.0 5.66e-06 1.8 1.00e+00 8.54e-01f 1
28r 3.4340888e+02 1.20e-08 5.23e-03 -9.0 1.20e-06 1.3 1.00e+00 9.86e-01h 1
Cannot recompute multipliers for feasibility problem. Error in eq_mult_calculator我如何解释这个错误?非常感谢您的关注。
发布于 2020-06-11 04:34:54
现在有一个新的返回码(FOUND_FEASIBLE_POINT和Found_Feasible_Point),当Ipopt为正方形问题找到一个可行时返回,但乘法器可能是关闭的。
问题在于方程3是一个退化的方程,因此拉格朗日乘数的计算可能是错误的:
m.Equation(3*x[0]-2*x[1]**2-7==(3*x[0]-2*x[1]**2-7)**2)它是退化的,因为还包含了m.Equation(3*x[0]-2*x[1]**2==7)。不需要方程3来解决问题。你的问题可能也有一个退化的方程,但解决方案仍然有效。
https://stackoverflow.com/questions/62297911
复制相似问题