Skip to main content

Null space algorithm for nonlinear constrained optimization

Project description

Null space optimizer

nullspace_optimizer is a package implementing the null space algorithm for nonlinear constrained optimization.

Please cite the following references when using this source:

Feppon F., Allaire G. and Dapogny C. Null space gradient flows for constrained optimization with applications to shape optimization. 2020. ESAIM: COCV, 26 90 doi:10.1051/cocv/2020015 (Open Access). HAL preprint hal-01972915.

Feppon, F. Shape and topology optimization of multiphysics systems. 2019. Université Paris-Saclay. Thèse préparée à l'École polytechnique.

Installation

With pip

# Minimal version (no extra dependencies)
pip install nullspace_optimizer

# All extra dependencies including alternate QP solver, colored output and plotting features
pip install nullspace_optimizer[osqp,colored,matplotlib]

Manual installation

Add the package to the PYTHONPATH environment variable.

Running examples

A few examples of 2-d inequality constrained optimization are available in the `examples' folder. They can be run from command line with

python -m nullspace_optimizer.examples.ex0
python -m nullspace_optimizer.examples.ex1
python -m nullspace_optimizer.examples.ex2

and so on. All the examples can be run at once with

python -m nullspace_optimizer.examples.test_all

For instance, example ex1 solves the following optimization problem:

\newcommand{\<}{\leq}
\begin{aligned} \min_{(x_0,x_1)\in\mathbb{R}^2} & \quad (x_0+1)^2+(x_1+1)^2 \\
s.t. &\quad  \left\{ \begin{aligned} x_0^2+x_1^2-1 & \< 0\\
                             x_0+x_1-1 & \< 0 \\
                             -x_1-0.7 & \<0.
                             \end{aligned}\right.
\end{aligned}

Running python -m nullspace_optimizer.examples.ex1 should produce the following figure:

Null space gradient flow trajectories

Requirements

Runs with python 3.6 and the following libraries:

  • numpy (>=1.12.1)
  • scipy (>=0.19.1)
  • cvxopt (>=1.2.1)

Optional dependencies:

  • osqp (>=0.6.1) (for an alternate QP solver instead of CVXOPT)
  • colored (>=1.3.93) (for colored output)
  • matplotlib (>=2.0.2) (for displaying figures while running examples)

Detailed documentation

A more detailed documentation is available on the DOC.md file of the git repository.

The full documentation of classes and methods is available in the python docstring of the source code.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for nullspace-optimizer, version 1.1.1
Filename, size File type Python version Upload date Hashes
Filename, size nullspace_optimizer-1.1.1.tar.gz (21.4 kB) File type Source Python version None Upload date Hashes View
Filename, size nullspace_optimizer-1.1.1-py3-none-any.whl (40.5 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page