IPOPT

IPOPT (Interior Point OPTimizer) is an open source interior point optimizer, designed for large-scale nonlinear optimization. The source code can be found here. The latest version we support is 3.13.2.

Installation

IPOPT must be installed separately, then linked to pyOptSparse when building. For the full installation instructions, please see their documentation. OpenMDAO also has a very helpful script which can be used to install IPOPT with other linear solvers. Here we explain a basic setup using MUMPS as the linear solver, together with METIS adapted from the OpenMDAO script.

  1. Download the tarball and extract it to $IPOPT_DIR which could be set to for example $HOME/packages/Ipopt.

  2. Install METIS, which can be used to improve the performance of the MUMPS linear solver.

    # build METIS
    cd $IPOPT_DIR
    git clone https://github.com/coin-or-tools/ThirdParty-Metis.git
    cd ThirdParty-Metis
    ./get.Metis
    ./configure --prefix=$IPOPT_DIR
    make
    make install
    
  3. Install MUMPS

    # build MUMPS
    cd $IPOPT_DIR
    git clone https://github.com/coin-or-tools/ThirdParty-Mumps.git
    cd ThirdParty-Mumps
    ./get.Mumps
    ./configure --with-metis --with-metis-lflags="-L${IPOPT_DIR}/lib -lcoinmetis" \
         --with-metis-cflags="-I${IPOPT_DIR}/include -I${IPOPT_DIR}/include/coin-or -I${IPOPT_DIR}/include/coin-or/metis" \
         --prefix=$IPOPT_DIR CFLAGS="-I${IPOPT_DIR}/include -I${IPOPT_DIR}/include/coin-or -I${IPOPT_DIR}/include/coin-or/metis" \
         FCFLAGS="-I${IPOPT_DIR}/include -I${IPOPT_DIR}/include/coin-or -I${IPOPT_DIR}/include/coin-or/metis"
    make
    make install
    
  4. Build IPOPT

    # build IPOPT
    cd $IPOPT_DIR
    mkdir build
    cd build
    ../configure --prefix=${IPOPT_DIR} --disable-java --with-mumps --with-mumps-lflags="-L${IPOPT_DIR}/lib -lcoinmumps" \
         --with-mumps-cflags="-I${IPOPT_DIR}/include/coin-or/mumps"
    make
    make install
    
  5. You must add the IPOPT library path to the LD_LIBRARY_PATH variable for things to work right. This could be done for example by adding the following to your .bashrc:

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$IPOPT_DIR/lib
    

    Furthermore, the environment variable $IPOPT_DIR must be set correctly in order to link to pyOptSparse. Alternatively, you can manually define the variables $IPOPT_LIB and $IPOPT_INC for the lib and include paths separately.

  6. Now clean build pyOptSparse. Verify that IPOPT works by running the relevant tests.

Note

To get IPOPT working with pyOptSparse when using another linear solver, several things must be changed.

  1. The setup.py file located in pyoptsparse/pyIPOPT must be updated accordingly. In particular, the libraries= line must be changed to reflect the alternate linear solver. For example, for HSL you need to replace coinmumps and coinmetis with coinhsl.

  2. The option linear_solver in the options dictionary must be changed. The default value can be changed in pyIPOPT.py so that this option does not need to be manually set in every run script.

Options

Please refer to the IPOPT website for complete listing of options. The following are the options which are set by default within pyOptSparse. All other options take the default value with IPOPT unless specified by the user.

IPOPT Default Options

Name

Type

Default value

Description

print_level

int

0

Printing level

file_print_level

int

5

Printing level for the output file

sb

str

yes

This is an undocumented option which suppresses the IPOPT header from being printed to screen every time.

print_user_options

str

yes

Whether to print the user-modified options

output_file

str

IPOPT.out

The name of the output file from IPOPT

linear_solver

str

mumps

The linear solver used.

Informs

IPOPT Informs

Code

Description

0

Solve Succeeded

1

Solved To Acceptable Level

2

Infeasible Problem Detected

3

Search Direction Becomes Too Small

4

Diverging Iterates

5

User Requested Stop

6

Feasible Point Found

-1

Maximum Iterations Exceeded

-2

Restoration Failed

-3

Error In Step Computation

-4

Maximum CpuTime Exceeded

-10

Not Enough Degrees Of Freedom

-11

Invalid Problem Definition

-12

Invalid Option

-13

Invalid Number Detected

-100

Unrecoverable Exception

-101

NonIpopt Exception Thrown

-102

Insufficient Memory

-199

Internal Error

API

class pyoptsparse.pyIPOPT.pyIPOPT.IPOPT(*args, **kwargs)[source]

IPOPT Optimizer Class - Inherited from Optimizer Abstract Class

IPOPT Optimizer Class Initialization

__call__(optProb, sens=None, sensStep=None, sensMode=None, storeHistory=None, hotStart=None, storeSens=True)[source]

This is the main routine used to solve the optimization problem.

Parameters
optProbOptimization or Solution class instance

This is the complete description of the optimization problem to be solved by the optimizer

sensstr or python Function.

Specifiy method to compute sensitivities. To explictly use pyOptSparse gradient class to do the derivatives with finite differenes use ‘FD’. ‘sens’ may also be ‘CS’ which will cause pyOptSpare to compute the derivatives using the complex step method. Finally, ‘sens’ may be a python function handle which is expected to compute the sensitivities directly. For expensive function evaluations and/or problems with large numbers of design variables this is the preferred method.

sensStepfloat

Set the step size to use for design variables. Defaults to 1e-6 when sens is ‘FD’ and 1e-40j when sens is ‘CS’.

sensModestr

Use ‘pgc’ for parallel gradient computations. Only available with mpi4py and each objective evaluation is otherwise serial

storeHistorystr

File name of the history file into which the history of this optimization will be stored

hotStartstr

File name of the history file to “replay” for the optimziation. The optimization problem used to generate the history file specified in ‘hotStart’ must be IDENTICAL to the currently supplied ‘optProb’. By identical we mean, EVERY SINGLE PARAMETER MUST BE IDENTICAL. As soon as he requested evaluation point does not match the history, function and gradient evaluations revert back to normal evaluations.

storeSensbool

Flag sepcifying if sensitivities are to be stored in hist. This is necessay for hot-starting only.