My use case is a chi-square minimization with multiple nonlinear equality based constraints. I started first with derivative free COBYLA, and then switched to SLSQP with analytical gradients implemented. In both cases, I saw the solvers declaring success even when the constraints had not been with within the specified tolerance, sometimes with very large violations.
To set up a toy test with a known function, I turned to the Rosenbrock function, with a single nonlinear equality constraint (x1^2 + x2^2 = 0), with the constraint intentionally scaled by 1e10 to give a large value. In the example below, I specify a constraint tolerance of 1e-6, and ftol_rel of 1e-4. But the solver exits with a successful status code of 3, with the constraint evaluated at the minimum being 3e-5, which is larger than my specified tolerance.
When I use LN_COBYLA instead of LD_SLSQP with all else being the same, the constraint violation seen on the successful exit (code 3) is even larger, equal to 246. I see that this has been reported before also.
Any advice on how to deal with these issues would be greatly appreciated. Thank you for the work that went into creating and maintaining NLopt!
I also have this exact issue: successful termination of SLSQP, but with constraints violated (above their tolerance value). I've also reproduced the example above.
My use case is a chi-square minimization with multiple nonlinear equality based constraints. I started first with derivative free COBYLA, and then switched to SLSQP with analytical gradients implemented. In both cases, I saw the solvers declaring success even when the constraints had not been with within the specified tolerance, sometimes with very large violations.
To set up a toy test with a known function, I turned to the Rosenbrock function, with a single nonlinear equality constraint (
x1^2 + x2^2 = 0
), with the constraint intentionally scaled by 1e10 to give a large value. In the example below, I specify a constraint tolerance of 1e-6, andftol_rel
of 1e-4. But the solver exits with a successful status code of 3, with the constraint evaluated at the minimum being 3e-5, which is larger than my specified tolerance.When I use
LN_COBYLA
instead ofLD_SLSQP
with all else being the same, the constraint violation seen on the successful exit (code 3) is even larger, equal to 246. I see that this has been reported before also.Any advice on how to deal with these issues would be greatly appreciated. Thank you for the work that went into creating and maintaining NLopt!
test_NLopt_Rosenbrock.py:
Output: