NLPModels.jl documentation

This package provides general guidelines to represent optimization problems in Julia and a standardized API to evaluate the functions and their derivatives. The main objective is to be able to rely on that API when designing optimization solvers in Julia.

Introduction

The general form of the optimization problem is

\[\begin{align*} \min \quad & f(x) \\ & c_i(x) = 0, \quad i \in E, \\ & c_{L_i} \leq c_i(x) \leq c_{U_i}, \quad i \in I, \\ & \ell \leq x \leq u, \end{align*}\]

where $f:\mathbb{R}^n\rightarrow\mathbb{R}$, $c:\mathbb{R}^n\rightarrow\mathbb{R}^m$, $E\cup I = \{1,2,\dots,m\}$, $E\cap I = \emptyset$, and $c_{L_i}, c_{U_i}, \ell_j, u_j \in \mathbb{R}\cup\{\pm\infty\}$ for $i = 1,\dots,m$ and $j = 1,\dots,n$.

For computational reasons, we write

\[\begin{align*} \min \quad & f(x) \\ & c_L \leq c(x) \leq c_U \\ & \ell \leq x \leq u, \end{align*}\]

defining $c_{L_i} = c_{U_i}$ for all $i \in E$. The Lagrangian of this problem is defined as

\[L(x,\lambda,z^L,z^U;\sigma) = \sigma f(x) + c(x)^T\lambda + \sum_{i=1}^n z_i^L(x_i-l_i) + \sum_{i=1}^nz_i^U(u_i-x_i),\]

where $\sigma$ is a scaling parameter included for computational reasons. Notice that, for the Hessian, the variables $z^L$ and $z^U$ are not used.

Optimization problems are represented by an instance/subtype of AbstractNLPModel. Such instances are composed of

Install

Install NLPModels.jl with the following commands.

Pkg.add("NLPModels")

If you want the ADNLPModel or the MathProgNLPModel, you also need the

Pkg.add("ForwardDiff")
Pkg.add("MathProgBase")

respectively. In addition, if you want to create a MathProgNLPModel from a JuMP model, you'll need

Pkg.add("JuMP")

Usage

See the Models, or the Tutorial, or the API.

Internal Interfaces

External Interfaces

If you want your interface here, open a PR.

Attributes

NLPModelMeta objects have the following attributes:

AttributeTypeNotes
nvarIntnumber of variables
x0Array{Float64,1}initial guess
lvarArray{Float64,1}vector of lower bounds
uvarArray{Float64,1}vector of upper bounds
ifixArray{Int64,1}indices of fixed variables
ilowArray{Int64,1}indices of variables with lower bound only
iuppArray{Int64,1}indices of variables with upper bound only
irngArray{Int64,1}indices of variables with lower and upper bound (range)
ifreeArray{Int64,1}indices of free variables
iinfArray{Int64,1}indices of visibly infeasible bounds
nconInttotal number of general constraints
nlinIntnumber of linear constraints
nnlnIntnumber of nonlinear general constraints
nnetIntnumber of nonlinear network constraints
y0Array{Float64,1}initial Lagrange multipliers
lconArray{Float64,1}vector of constraint lower bounds
uconArray{Float64,1}vector of constraint upper bounds
linRange1{Int64}indices of linear constraints
nlnRange1{Int64}indices of nonlinear constraints (not network)
nnetRange1{Int64}indices of nonlinear network constraints
jfixArray{Int64,1}indices of equality constraints
jlowArray{Int64,1}indices of constraints of the form c(x) ≥ cl
juppArray{Int64,1}indices of constraints of the form c(x) ≤ cu
jrngArray{Int64,1}indices of constraints of the form cl ≤ c(x) ≤ cu
jfreeArray{Int64,1}indices of "free" constraints (there shouldn't be any)
jinfArray{Int64,1}indices of the visibly infeasible constraints
nnzjIntnumber of nonzeros in the sparse Jacobian
nnzhIntnumber of nonzeros in the sparse Hessian
minimizeBooltrue if optimize == minimize
islpBooltrue if the problem is a linear program
nameStringproblem name

License

This content is released under the MIT License.

Contents