forked from cvxpy/cvxpy
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Hi,
I've transcribed your instance (see #119 (comment)):
def test_qcp(self, solver):
# Use IPM for UNO on this test, SQP converges to a suboptimal point: (0, 0, 1)
if solver == 'UNO':
solver = 'UNO_IPM'
x = cp.Variable(1)
y = cp.Variable(1, bounds=[0, np.inf])
z = cp.Variable(1, bounds=[0, np.inf])
objective = cp.Maximize(x)
constraints = [
x + y + z == 1,
x**2 + y**2 - z**2 <= 0,
x**2 - cp.multiply(y, z) <= 0
]
problem = cp.Problem(objective, constraints)
problem.solve(solver=solver, nlp=True)
assert problem.status == cp.OPTIMAL
assert np.allclose(x.value, np.array([0.32699284]))
assert np.allclose(y.value, np.array([0.25706586]))
assert np.allclose(z.value, np.array([0.4159413]))in AMPL:
var x;
var y >= 0;
var z >= 0;
maximize obj: x;
subject to c1: x + y + z = 1;
subject to c2: x^2 + y^2 - z^2 <= 0;
subject to c3: x^2 - y*z <= 0;and I get (the initial point is all zeros):
Uno 2.3.1 (TR Fletcher-filter restoration inequality-constrained method with exact Hessian and no regularization)
Thu Jan 8 19:51:58 2026
────────────────────────────────────────
Optimization status: Success
Solution status: Feasible KKT point
Objective value: 0.3269928
Primal feasibility: 2.775558e-17
┌ Stationarity residual: 3.060693e-11
│ Primal feasibility: 2.775558e-17
└ Complementarity residual: 3.015461e-18
Primal solution: 0.3269928 0.2570659 0.4159413
┌ Constraint multipliers: 0.1086434 0.9204421 0.3269928
│ Lower bound multipliers: -0 -0 -0
└ Upper bound multipliers: -0 -0 -0
which is the expected solution.
One difference between CVXPY and AMPL is that through AMPL, the first constraint is labeled as "linear", but I don't see why it should change the result.
Could you run Uno's filtersqp preset on this instance with the options logger=DEBUG3 and print_solution=true, and paste the log here?
Thanks,
Charlie
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels