SNOPT.jl: Julia interface to the SNOPT solver

SNOPT.jl is an unofficial Julia interface to SNOPT, a commercial solver for large, sparse, constrained nonlinear optimization problems. The package wraps all three SNOPT solver interfaces, snOptA, snOptB and snOptC, and so gives access to the SNOPT features, including linear constraints, finite-difference derivatives, warm and hot starts, and specs files. For most problems, the function snopt is the simplest entry point: it takes the objective, the constraints and their first derivatives as ordinary Julia functions, manages the SNOPT workspace, and returns the solution in a SnoptResult.

SNOPT.jl solves problems of the form

\[\begin{aligned} \min_{x \in \mathbb{R}^n} \quad & f(x) \\ \text{subject to} \quad & l_x \le x \le u_x, \\ & l_c \le c(x) \le u_c, \end{aligned}\]

where $f$ is the objective, $c$ is a vector of constraint functions, and the bounds can be infinite. SNOPT uses a sequential quadratic programming (SQP) method, so $f$ and $c$ must be smooth, and their first derivatives must be supplied.

SNOPT license required

SNOPT.jl does not include SNOPT. A SNOPT license and a compatible libsnopt7 shared library are available from the SNOPT distributors. See Installation.

When to use SNOPT.jl

SNOPT.jl is the right choice for calling SNOPT directly with derivatives written by hand. Use OptimizationSNOPT.jl instead to define the problem with Optimization.jl, compute derivatives with automatic differentiation, or compare SNOPT with other solvers through one interface. OptimizationSNOPT.jl uses SNOPT.jl internally.

Installation

Install the package with the Julia package manager:

using Pkg
Pkg.add("SNOPT")

Then, before starting Julia, set SNOPTDIR to the directory of the SNOPT library:

export SNOPTDIR=/path/to/snopt/lib

Installation gives the library file names, the search order, the commands for Windows and the setup checks.

Contents

Tutorial and installation

The tutorial solves a first problem with bounds and nonlinear constraints. The installation page makes the SNOPT library available to Julia.

How-to guides

Each guide shows how to do one task with SNOPT.jl.

Concepts and reference

The concepts page explains the SNOPT terms and status codes. The API reference lists every exported function and type.

Contributing

  • Report bugs and request features on the issue tracker.
  • Before opening a pull request, run the test suite with julia --project=. -e 'using Pkg; Pkg.test()' from the repository root. The solver tests run only when Julia finds a licensed libsnopt7.
  • To build this manual, run julia --project=docs -e 'using Pkg; Pkg.instantiate()' and then SNOPT_DOCS_DEPLOY=false julia --project=docs docs/make.jl from the repository root. The build runs the examples when it finds the SNOPT library; SNOPT_DOCTESTS=false skips them. The pages are written to docs/build/.

Acknowledgements

SNOPT was written by Philip E. Gill, Walter Murray and Michael A. Saunders. SNOPT.jl draws on earlier Julia wrappers: snopt/SNOPT7.jl, byuflowlab/Snopt.jl and Yuricst/joptimise.