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.

Installation

IPOPT and its Python interface cyipopt <https://github.com/mechmotum/cyipopt> must be installed separately. There are several ways to install IPOPT and its Python bindings: #. The simplest option is to use conda-forge to install cyipopt. This is recommended for most people. #. Either compile IPOPT yourself or use a pre-built binary, then install cyipopt from source.

Follow the instructions here.

  1. Use the helper script build_pyoptsparse <https://github.com/OpenMDAO/build_pyoptsparse/> by the team at OpenMDAO. This will install IPOPT and cyipopt for you.

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 and cyipopt 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.

save_major_iteration_variables

list

[]

This option is unique to the Python wrapper, and takes a list of values which can be saved at each major iteration to the History file. The possible values are

  • alg_mod: algorithm mode (0 for regular, 1 for restoration)

  • d_norm: infinity norm of the primal step

  • regularization_size: regularization term for the Hessian of the Lagrangian

  • ls_trials: number of backtracking line search iterations

  • g_violation: vector of constraint violations

  • grad_lag_x: gradient of Lagrangian

In addition, a set of default parameters are saved to the history file and cannot be changed. These are

  • inf_pr: primal infeasibility

  • inf_du: dual infeasibility (optimality measure)

  • mu: barrier parameter

  • alpha_pr: step size for primal variables

  • alpha_du: step size for dual variables

pyOptSparse uses the same parameter names as IPOPT and cyipopt. Detailed descriptions of these parameter can be found in their documentations.

Note

There are several options that significantly affect the IPOPT performance, and IPOPT’s default values are not always the best depending on the problem characteristics. Here are several noteworthy options based on our experience, and users are encouraged to explore non-default values if needed. pyOptSparse does not override the default value for these options.

  • nlp_scaling_method: by default, IPOPT internally applies the scaling based on the gradient at the initial point. If the problem is already well scaled at pyOptSparse level, you may set this to none to disable IPOPT scaling.

  • hessian_approximation: since pyOptSparse does not support the Hessian callback yet, cyipopt automatically sets this to limited-memory. pyOptSparse users do not need to set this option manually.

  • limited_memory_max_history: this determines the number of most recent iterations that are used for the Hessian approximation. IPOPT’s default is 6, but it is often better to set this to a larger value so the Hessian approximation can utilize more information.

  • mu_init: this is the initial value for the barrier parameter, and IPOPT’s default is 0.1. This parameter has a significant impact on the search path, especially when you have a lot of constraints. If the initial point is good (i.e., feasible or close to feasible), setting a smaller value (e.g., 1e-5) often accelerates convergence.

  • mu_strategy: This controls the strategy for updating the barrier parameter, and the IPOPT’s default is monotone. The other option is adaptive, which may accelerate the convergence, but monotone tends to be more robust.

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.