Opened 5 months ago

Closed 3 months ago

#312 closed defect (migrated)

Inaccurate calculation/reporting of infeasibility

Reported by: nrontsis Owned by: ipopt-team
Priority: normal Component: Ipopt
Version: 3.12 Severity: normal
Keywords: Cc:

Description

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

Change History (2)

comment:1 Changed 5 months ago by nrontsis

Also, I observed the same issue when calling Ipopt via JuMP in Julia 1.0.1.

Last edited 5 months ago by nrontsis (previous) (diff)

comment:2 Changed 3 months ago by stefan

  • Resolution set to migrated
  • Status changed from new to closed

This ticket has been migrated to GitHub and will be followed up there: https://github.com/coin-or/Ipopt/issues/312

Note: See TracTickets for help on using tickets.