为什么在迭代后不退出的couenne反复显示相同的结果?

时间:2017-05-28 19:08:28

标签: python pyomo

我在python中使用pyomo跟随代码:

from pyomo.environ import *

mymodel=ConcreteModel()    
var_x = Var([1,2], [0,1,2,3], domain=Reals)
var_y = Var([1,2], [0,1,2,3], domain=Reals)
var_z = Var([0,1,2,3], domain=Reals)
mymodel.q = var_x
mymodel.p = var_y
mymodel.u = var_z

express=(var_z[0] ** 2) + (var_y[1,0] * var_x[2,0]) + (var_y[2,0] * var_x[1,0])

cost_fn = Objective(expr=express)

mymodel.objective=cost_fn
sf = SolverFactory('couenne')
mymodel_results = sf.solve(mymodel)
print mymodel_results

上面的问题应该是相当微不足道的 - 显而易见的是获得最佳值只需设置所有变量= 0.

但是,couenne解算器会扼杀它,并在解决时一遍又一遍地打印相同的值。当我打印mymodel_results时,这就是我在Solver日志中看到的内容:

ERROR: "[base]/site-packages/pyomo/opt/base/solvers.py", 583, solve
    Solver log:
    Couenne 0.5.6 -- an Open-Source solver for Mixed Integer Nonlinear Optimization
    Mailing list: couenne@list.coin-or.org
    Instructions: http://www.coin-or.org/Couenne

    Couenne: new cutoff value 0.0000000000e+00 (0.005058 seconds)
    NLP0012I 
                  Num      Status      Obj             It       time                 Location
    NLP0014I             1         OPT 0        0 0.000188
    Loaded instance "/var/folders/4f/z25gj3_d29b45_2nx87p8rvr0000gn/T/tmpsL5BN4.pyomo.nl"
    Constraints:            0
    Variables:              5 (0 integer)
    Auxiliaries:            4 (0 integer)

    Coin0506I Presolve 0 (-5) rows, 0 (-9) columns and 0 (-12) elements
    Clp0000I Optimal - objective value -9.99e+12
    Clp0032I Optimal objective -9.99e+12 - 0 iterations time 0.002, Presolve 0.00
    Clp0000I Optimal - objective value -9.99e+12
    NLP Heuristic: NLP0014I             2         OPT 0        0 0.000229
    no solution.
    Clp0000I Optimal - objective value -9.99e+12
    Optimality Based BT: 0 improved bounds
    Probing: 7 improved bounds
    NLP Heuristic: no solution.
    Cbc0013I At root node, 0 cuts changed objective from -9.99e+12 to -9.99e+12 in 1 passes
    Cbc0014I Cut generator 0 (Couenne convexifier cuts) - 0 row cuts average 0.0 elements, 2 column cuts (2 active)
    Cbc0010I After 0 nodes, 1 on tree, 1e+50 best solution, best possible -1.7976931e+308 (0.00 seconds)
    Optimality Based BT: 1 improved bounds
    Cbc0010I After 100 nodes, 50 on tree, 1e+50 best solution, best possible -9.99e+12 (4.52 seconds)
    Cbc0010I After 200 nodes, 100 on tree, 1e+50 best solution, best possible -9.99e+12 (4.53 seconds)

....永远一样......

    Cbc0010I After 16600 nodes, 105 on tree, 1e+50 best solution, best possible -9.99e+12 (8.51 seconds)

为什么容易出问题?

我知道有一个超时功能How to set Pyomo solver timeout?,但这个问题很简单,不需要它。此外,问题很容易通过ipopt解决,但couenne也应该处理它。

0 个答案:

没有答案