了解有关APOPT求解器的更多信息

时间:2020-02-04 17:28:11

标签: optimization nonlinear-optimization mixed-integer-programming gekko

我对APOPT如何解决MINLP有一些疑问。

  • APOPT使用哪种非线性编程方法(内部点,信任区域等)?
  • APOPT如何处理混合整数(B&B,外部逼近,广义Benders分解等)?

1 个答案:

答案 0 :(得分:3)

APOPT是使用分支和约束的活动集顺序二次规划(SQP)求解器。 APOPT使用热启动方法来加快连续的非线性编程(NLP)解决方案的速度。 WikipediaAPMonitor documentationAPOPT.com中有关于APOPT的更多信息。从2013 INFORMS演示文稿和2014 APMonitor CACE论文中可以获得基准信息。

  1. Hedengren,J.D.,Mojica,J.L.,Lewis,A.D.和Nikbakhsh,S。,MINLP with Combined Interior Point and Active Set Methods,INFORMS年会,明尼苏达州明尼阿波利斯,2013年10月。
  2. Hedengren,J. D.和Asgharzadeh Shishavan,R.,Powell,K.M.和Edgar,T.F。,Nonlinear Modeling, Estimation and Predictive Control in APMonitor,《计算机与化学工程》,第70卷,第5页。 133–148,2014年,doi:10.1016 / j.compchemeng.2014.04.013。

以下是使用pip install gekko打包后用Python Gekko解决的一个示例MINLP问题。

from gekko import GEKKO
m = GEKKO() # Initialize gekko
m.options.SOLVER=1  # APOPT is an MINLP solver

# optional solver settings with APOPT
m.solver_options = ['minlp_maximum_iterations 500', \
                    # minlp iterations with integer solution
                    'minlp_max_iter_with_int_sol 10', \
                    # treat minlp as nlp
                    'minlp_as_nlp 0', \
                    # nlp sub-problem max iterations
                    'nlp_maximum_iterations 50', \
                    # 1 = depth first, 2 = breadth first
                    'minlp_branch_method 1', \
                    # maximum deviation from whole number
                    'minlp_integer_tol 0.05', \
                    # covergence tolerance
                    'minlp_gap_tol 0.01']
# Initialize variables
x1 = m.Var(value=1,lb=1,ub=5)
x2 = m.Var(value=5,lb=1,ub=5)
# Integer constraints for x3 and x4
x3 = m.Var(value=5,lb=1,ub=5,integer=True)
x4 = m.Var(value=1,lb=1,ub=5,integer=True)
m.Equation(x1*x2*x3*x4>=25)
m.Equation(x1**2+x2**2+x3**2+x4**2==40)
m.Obj(x1*x4*(x1+x2+x3)+x3) # Objective
m.solve(disp=False) # Solve
print('x1: ' + str(x1.value))
print('x2: ' + str(x2.value))
print('x3: ' + str(x3.value))
print('x4: ' + str(x4.value))
print('Objective: ' + str(m.options.objfcnval))

迭代摘要提供了有关分支和绑定过程以查找解决方案的更多信息。

 ----------------------------------------------
 Steady State Optimization with APOPT Solver
 ----------------------------------------------
Iter:     1 I:  0 Tm:      0.00 NLPi:    7 Dpth:    0 Lvs:    3 Obj:  1.70E+01 Gap:       NaN
--Integer Solution:   1.75E+01 Lowest Leaf:   1.70E+01 Gap:   3.00E-02
Iter:     2 I:  0 Tm:      0.00 NLPi:    5 Dpth:    1 Lvs:    2 Obj:  1.75E+01 Gap:  3.00E-02
Iter:     3 I:  0 Tm:      0.00 NLPi:    6 Dpth:    1 Lvs:    2 Obj:  1.75E+01 Gap:  3.00E-02
--Integer Solution:   1.75E+01 Lowest Leaf:   1.70E+01 Gap:   3.00E-02
Iter:     4 I:  0 Tm:      0.00 NLPi:    6 Dpth:    2 Lvs:    1 Obj:  2.59E+01 Gap:  3.00E-02
Iter:     5 I:  0 Tm:      0.00 NLPi:    5 Dpth:    1 Lvs:    0 Obj:  2.15E+01 Gap:  3.00E-02
 No additional trial points, returning the best integer solution
 Successful solution

 ---------------------------------------------------
 Solver         :  APOPT (v1.0)
 Solution time  :   1.609999999345746E-002 sec
 Objective      :    17.5322673012512     
 Successful solution
 ---------------------------------------------------

x1: [1.3589086474]
x2: [4.5992789966]
x3: [4.0]
x4: [1.0]
Objective: 17.532267301