Skip to content
/ pyipopt Public
forked from b45ch1/pyipopt

Python bindings to Ipopt Non-Linear Solver.

Notifications You must be signed in to change notification settings

syarra/pyipopt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# pyipopt


## Install


In order to use this package, you have to have at least those packages on your computer:

* Ipopt:
  Download it from https://projects.coin-or.org/Ipopt

* Numpy:
  http://numpy.scipy.org/ or `pip install numpy`


Modifiy setup.py to reflect your environment

The install is very simple, just use

    python setup.py install


USE:
    If everything is OK by now, you can just issue

    python example.py

Ipopt will solve a toy application for you. This python file is self-documented. You can also check the document in the python interactive shell. This module is extensively documented.

Ipopt can also solve problems w/o hessian estimation. `example.py` demonstrates the idea. If you provide the pyipopt.create function with the eval_h callback function as well as the apply_new callback function, ipopt will delegate the Hessian matrix calculation to you. Otherwise Ipopt will use it's own approximate hessian calculation.


## AMPL

For people that use AMPL, the amplipopt is a very easy client that connect ampl and ipopt. Although it's also available in the ipopt package, here you can manipulate the model much easier in Python instead of in C/C++;

To use that, you have to download NLPy from github or `pip install nlpy`.

The sparse matrix is stored as the triple (row, col, values). Nlpy return the row, col tuple in the row-wise manner but AMPL set the values in a col-wise manner according to goff. The way to fix that is to output the row-col tuple also in the col-wise manner.

Another way to fix this is to set AMPL's goff value to make it row-wise.

`trimloss.nl` and `test.nl` are all test samples. You can just
    
    python amplipopt.py trimloss.nl

to test if everything is OK



About

Python bindings to Ipopt Non-Linear Solver.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 63.0%
  • Python 34.3%
  • C++ 2.7%