I have following code using pyomo
in python:
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
The problem above should be fairly trivial - obvious to get optimal value just set all variables = 0.
But, the couenne solver chokes on it, and prints the same value over and over when solving. When I print mymodel_results
this is what I see inside of the Solver log:
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)
....same thing forever....
Cbc0010I After 16600 nodes, 105 on tree, 1e+50 best solution, best possible -9.99e+12 (8.51 seconds)
Why is it choking on easy problem?
I know there is a timeout feature How to set Pyomo solver timeout?, but this problem is simple and should not need it. also, problem is easily solved by ipopt, but couenne should handle it as well.