[Ipopt-tickets] [Ipopt] #312: Inaccurate calculation/reporting of infeasibility

Ipopt coin-trac at coin-or.org
Thu Nov 15 13:52:20 EST 2018


#312: Inaccurate calculation/reporting of infeasibility
---------------------+------------------------
Reporter:  nrontsis  |      Owner:  ipopt-team
    Type:  defect    |     Status:  new
Priority:  normal    |  Component:  Ipopt
 Version:  3.12      |   Severity:  normal
Keywords:            |
---------------------+------------------------
 Consider the following concave optimization problem that I attempt to
 solve with Ipopt:
 {{{
 max  x'x
 s.t    Ax >= b
         -r =< x_i <= r
 }}}
 Sometimes Ipopt terminates claiming exactly zero constraint violation,
 i.e.
 {{{
 Constraint violation....:   0.0000000000000000e+00
 0.0000000000000000e+00
 }}}
 but actually, the solution returned violates the constraints slightly
 (e.g. min(A*x - b) ~= -1e-7).

 Here is a minimal example in MATLAB. System info: IPOPT version 3.12.9
 called via mexIPOPT in MATLAB R2017b, macOS 10.13.6.
 {{{
 rng(1);
 n = 24; m = 20;
 A = randn(m, n);
 b = randn(m, 1);
 r = 10;

 x_sol = call_ipopt(A, b, r, randn(n, 1));
 fprintf("Returned solution's violation: %.5e\n", min(min(A*x_sol - b), 0))

 function x = call_ipopt(A, b, r, x0)
   % Solves the convex maximization problem
   % max  x'x
   % s.t  Ax >= b
   %      -r <= x_i <= r
   % with Ipopt

   m = size(A, 1); n = size(A, 2);
   % Bound the variables to avoid the solution going to infinity
   options.lb = -r*ones(size(x0));
   options.ub = r*ones(size(x0));

   options.cl = b';   % Lower bounds on the constraint functions.
   options.cu = inf(size(b'));   % Upper bounds on the constraint
 functions.

   % Set the IPOPT options.
   options.ipopt.jac_d_constant   = 'yes';
   options.ipopt.hessian_constant = 'yes';

   % The callback functions.
   functions.objective         = @(x) -x'*x;
   functions.constraints       = @(x) A*x;
   functions.gradient          = @(x) -2*x;
   functions.jacobian          = @(x) sparse(A);
   functions.jacobianstructure = @() sparse(ones(m,n ));
   functions.hessian           = @(x, s, l) -s*speye(n);
   functions.hessianstructure  = @() speye(n);

   [x, ~] = ipopt(x0,functions,options);
 end
 }}}

--
Ticket URL: <https://projects.coin-or.org/Ipopt/ticket/312>
Ipopt <http://projects.coin-or.org/Ipopt>
Interior-point optimizer for nonlinear programs.



More information about the Ipopt-tickets mailing list