Cite Us

Table Of Contents

Previous topic


Next topic

Code Structure


This is the documentation for pyOpt, an object-oriented framework for formulating and solving optimization problems in an efficient, reusable and portable manner. The goal is to provide an easy-to-use optimization framework with access to a variety of integrated optimization algorithms which are accessible through a common interface.

The focus is on formulating and solving nonlinear constrained optimization problems, be they large or small. But the formulation of unconstrained, integer or mixed-integer and discrete optimization problems is also supported. The framework also allows for easy integration of additional optimization software that is programmed in Fortran, C, C++, and other languages.


Some of the main features of the pyOpt framework are:

  • Problem-Optimizer Independence: Object-oriented constructs allow for true separation between the optimization problem formulation and its solution by different optimizers.
  • Flexible Optimizer Integration : The interface allows for easy integration of gradient-based, gradient-free, and population-based optimization algorithms.
  • Parallelization Capability: The framework can solve optimization problems where the function evaluations from the model applications run in parallel environments. For gradient-based optimizers, it can also automate the evaluation of gradients in parallel, and for gradient-free optimizers it can distribute function evaluations.
  • History and Warm-Restart Capability: The user has the option to store the solver evaluation history during the optimization process. A partial history can also be used to ‘’warm-restart’’ the optimization.


pyOpt requires at least Python 2.4 to run, as well as the numpy ,1.0 or higher, package. Most optimizers supported by the framework require a C or Fortran compiler compatible with f2py . To link C based optimizers swig 1.3 or higher is also required. To take advantage of the parallel computing capabilities build into pyOpt the python package mpi4py is needed.


See the Quickguide for an introduction on how to use the pyOpt framework. Examples showing how to use some of the special features can be found in Examples .