MINLP with Couenne or Bonmin

1,281 views
Skip to first unread message

Jan Stampfli

unread,
Dec 9, 2017, 11:00:29 PM12/9/17
to Pyomo Forum
Hello

I have installed the COIN-OR suite because I want to optimize a MINLP problem. Thereby I tried to use the solver on my computer and on the NEOS server as well.
I have constructed an example  which I wanted to test both solvers:
from __future__ import division                                
from pyomo.environ import*

model = ConcreteModel()
model.x = Var(within=NonNegativeIntegers)
model.y = Var(within=NonNegativeReals)
model.maximizeZ = Objective(expr=model.x,sense=maximize)

model.Constraint1 = Constraint(expr=model.x*model.y<=100)
model.Constraint2 = Constraint(expr=model.x**model.y==20) 

If I try to run it on my computer I get the following errors:

Couenne: 
ERROR: "[base]/site-packages/pyomo/opt/base/solvers.py", 616, solve
       
Solver (asl) returned non-zero return code (-6)
ERROR
: "[base]/site-packages/pyomo/opt/base/solvers.py", 621, solve
       
Solver log:
       
Couenne 0.5 -- an Open-Source solver for Mixed Integer Nonlinear Optimization
       
Mailing list: couenne@list.coin-or.org
       
Instructions: http://www.coin-or.org/Couenne
        couenne
:
        ANALYSIS TEST
: Exception of type: OPTION_INVALID in file "../../../../Ipopt/src/Algorithm/IpAlgBuilder.cpp" at line 271:
         
Exception message: Selected linear solver MA27 not available.
       
Tried to obtain MA27 from shared library "libhsl.so", but the following error occured:
        libhsl
.so: cannot open shared object file: No such file or directory


        EXIT
: Invalid option encountered.
       
Loaded instance "/tmp/tmph4CTkG.pyomo.nl"
       
Constraints:            2
       
Variables:              2 (1 integer)
       
Auxiliaries:            5 (1 integer)


       
Coin0506I Presolve 11 (-2) rows, 4 (-3) columns and 26 (-8) elements
       
Clp0006I 0  Obj -2 Primal inf 7.0209757 (2) Dual inf 3.5738309 (1)
       
Clp0006I 2  Obj -171
       
Clp0000I Optimal - objective value -171
       
Clp0032I Optimal objective -171 - 2 iterations time 0.002, Presolve 0.00
       
Clp0000I Optimal - objective value -171
       
Couenne: new cutoff value -1.7100000000e+02 (0 seconds)
        NLP
Heuristic: terminate called after throwing an instance of 'Ipopt::INVALID_WARMSTART'
[    0.34] Pyomo Finished
ERROR
: Unexpected exception while running model:
       
Solver (asl) did not exit normally


Bonmin:
ERROR: Unexpected exception while running model:
       
Cannot load a SolverResults object with bad status: error


If I try to run the solvers on the NEOS server I get the following errors:
Couenne:
ERROR: Error parsing NEOS solution file  NEOS log:
       
Job 5741310 dispatched
        password
: VNnMQexW
       
---------- Begin Solver Output -----------
       
Condor submit: 'neos.submit'
       
Condor submit: 'watchdog.submit'
       
Job submitted to NEOS HTCondor pool.
ERROR
: ERROR: An error occured with your submission.
[   22.25] Pyomo Finished
ERROR
: Unexpected exception while running model:
       
Problem executing an event.  No results are available.


Bonmin:
ERROR: Error parsing NEOS solution file  NEOS log:
       
Job 5741308 dispatched
        password
: eZtrAWlu
       
---------- Begin Solver Output -----------
       
Condor submit: 'neos.submit'
       
Condor submit: 'watchdog.submit'
       
Job submitted to NEOS HTCondor pool.
ERROR
: ERROR: An error occured with your submission.
[    7.75] Pyomo Finished
ERROR
: Unexpected exception while running model:
       
Problem executing an event.  No results are available.

In the end, I want to use the NEOS server to solve my problem.

Jan Stampfli

unread,
Dec 11, 2017, 7:36:46 PM12/11/17
to pyomo...@googlegroups.com
Due to the fact, that I could not find out the problem I installed all my stuff now on windows. All solver of the COIN-OR suite work now. But the connection to the NEOS server does not work anymore.  If i try to run for e.g.
pyomo solve --solver=ipopt  --solver-manager=neos rosenbrock.py
i get the error 
pyomo-script.py solve: error: unrecognized arguments: --solver-manager=neos
Does anyone know why pyomo the command --solver-manager not recognizes?

When I edit my script to include the solver-manager as follows
from pyomo.environ import *

model = AbstractModel()
model.x = Var(initialize=1.5)
model.y = Var(initialize=1.5)

def rosenbrock(model):
        return (1.0-model.x)**2 + 100.0*(model.y - model.x**2)**2 
model.obj = Objective(rule=rosenbrock, sense=minimize)

with SolverManagerFactory("neos") as manager:
        manager.solve(model, opt="ipopt")

and then run 
python rosenbrock.py
 
I get the following error:
Job 5743071 submitted to NEOS, password='zvxLrndZ'
Check the following URL for progress report :
Job 5743071 dispatched
password: zvxLrndZ
---------- Begin Solver Output -----------
Condor submit: 'neos.submit'
Condor submit: 'watchdog.submit'
Job submitted to NEOS HTCondor pool.
Traceback (most recent call last):
  File "rosenbrock.py", line 16, in <module>
    manager.solve(model, opt="ipopt")
  File "C:\Users\janst\AppData\Roaming\Python\Python27\site-packages\pyomo\opt\parallel\async_solver.py", line 33, in solve
    return self.execute(*args, **kwds)
  File "C:\Users\janst\AppData\Roaming\Python\Python27\site-packages\pyomo\opt\parallel\manager.py", line 107, in execute
    results = self.wait_for(ah)
  File "C:\Users\janst\AppData\Roaming\Python\Python27\site-packages\pyomo\opt\parallel\manager.py", line 170, in wait_for
    tmp = self.wait_any()
  File "C:\Users\janst\AppData\Roaming\Python\Python27\site-packages\pyomo\opt\parallel\manager.py", line 159, in wait_any
    ah = self._perform_wait_any()
  File "C:\Users\janst\AppData\Roaming\Python\Python27\site-packages\pyomo\neos\plugins\kestrel_plugin.py", line 185, in _perform_wait_any
    solver_results = opt.process_output(rc)
  File "C:\Users\janst\AppData\Roaming\Python\Python27\site-packages\pyomo\opt\solver\shellcmd.py", line 348, in process_output
    suffixes=self._suffixes)
  File "C:\Users\janst\AppData\Roaming\Python\Python27\site-packages\pyomo\opt\plugins\sol.py", line 54, in __call__
    % (filename, str(e), fdata))
ValueError: Error reading 'c:\users\janst\appdata\local\temp\tmpcuvsva.neos.sol': no Options line found.
SOL File Output:
ERROR: An error occured with your submission.

I also tried 
from pyomo.environ import *

model = AbstractModel()
model.x = Var(initialize=1.5)
model.y = Var(initialize=1.5)

def rosenbrock(model):
        return (1.0-model.x)**2 + 100.0*(model.y - model.x**2)**2 
model.obj = Objective(rule=rosenbrock, sense=minimize)

#with SolverManagerFactory("neos") as manager:
#        manager.solve(model, opt="ipopt")

opt = SolverFactory('ipopt')
solver_manager = SolverManagerFactory('neos')
results = solver_manager.solve(model, opt=opt)
results.write()
which gives me the following error:
Traceback (most recent call last):
  File "rosenbrock.py", line 20, in <module>
    results = solver_manager.solve(model, opt=opt)
  File "C:\Users\janst\AppData\Roaming\Python\Python27\site-packages\pyomo\opt\parallel\async_solver.py", line 33, in solve
    return self.execute(*args, **kwds)
  File "C:\Users\janst\AppData\Roaming\Python\Python27\site-packages\pyomo\opt\parallel\manager.py", line 106, in execute
    ah = self.queue(*args, **kwds)
  File "C:\Users\janst\AppData\Roaming\Python\Python27\site-packages\pyomo\opt\parallel\manager.py", line 121, in queue
    return self._perform_queue(ah, *args, **kwds)
  File "C:\Users\janst\AppData\Roaming\Python\Python27\site-packages\pyomo\neos\plugins\kestrel_plugin.py", line 96, in _perform_queue
    % (solver_name, str(sorted(self._solvers.keys()))))
pyomo.opt.parallel.manager.ActionManagerError: Solver 'couenne.exe' is not recognized by NEOS. Solver names recognized:
['bonmin', 'cbc', 'conopt', 'couenne', 'cplex', 'filmint', 'filter', 'ipopt', 'knitro', 'l-bfgs-b', 'lancelot', 'loqo', 'minlp', 'minos', 'minto', 'mosek', 'ooqp', 'path', 'pcx', 'snopt']




fant...@gmail.com

unread,
May 12, 2018, 12:57:52 PM5/12/18
to Pyomo Forum
Hi Jan,

May I please ask have you solved this issue? I'm solving an MINLP too, with minimization of a log-sum-exp example (using Baron on Pyomo though), and I run into similar error. So I'm just wondering if you have found a solution to it. 

Thanks!

Jan Stampfli

unread,
May 13, 2018, 4:15:42 AM5/13/18
to pyomo...@googlegroups.com
Hi fantian93

I could not solve this issue with NEOS. I had the opportunity to solve my optimization on a server from my university.

Regards
Jan

--
You received this message because you are subscribed to a topic in the Google Groups "Pyomo Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyomo-forum/mzTWTnqQ_HQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyomo-forum+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages