Usage Example

Published:

In this blog post I will provide an simple example of application.

Consider the following minimization problem: [1] \begin{eqnarray} \min_x && \frac{1}{2}(x -2)^2 + \frac{1}{2}(y - \frac{1}{2})^2, \\
\text{subject to } && (x + 1)^{-1} - y - \frac{1}{4} \ge 0,\\
&& x \ge 0, \\
&& y \ge 0, \\
\end{eqnarray}

The following figure taken from [1] ilustrate this problem:

Ineq

And the code for solving it is presented next:

x* = [ 1.95281643  0.08864414]
optimality = 9.95279815706e-09
c violation = 2.95123939257e-11
niter = 17
f evals = 11
CG iters = 18
total time = 0.0374019145966

References

[1]   Jorge Nocedal, and Stephen J. Wright. “Numerical optimization” Second Edition (2006).