Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLSQP roundoff-limited with redundant equality constraints #567

Open
danlugli opened this issue Sep 17, 2024 · 4 comments
Open

SLSQP roundoff-limited with redundant equality constraints #567

danlugli opened this issue Sep 17, 2024 · 4 comments

Comments

@danlugli
Copy link

In preparation to the real problem I have, I am now trying SLSQP (NLopt 2.8.0 on windows) with a toy problem: find center and radius of a circumference given Ns samples on it. The samples are affected by some measurement error.
I minimize the sum of squared distances between the samples and their projections on the circumference, with the constraints that the projections must lie on the circumference (equality constraints).
I have therefore 3 + 2 Ns variables (2 coordinates of the center, radius, and 2 coordinates of each projection) and Ns constraints.
SLSQP works well and fast, even when I set (relatively) high measurement errors and start with a (relatively) bad initial approximation.
However my real problem has redundant constraints and it is not easy to discard some.
So I duplicated the constraints in the toy problem by adding each constraint twice.
In these conditions, SLSQP immediately gives up with a "nlopt roundoff-limited" exception.
Any suggestion on how to deal with a problem with redundant equality constraints?
Thank you in advance for any reply.

@danlugli
Copy link
Author

I don't know the guts of SLSQP but I can imagine that, by adding each constraint twice, the jacobian of constraints, or any other matrix, will double its rows while keeping the same rank. If a linear system has to be solved with that matrix, it should be solvable anyway.

@jschueller
Copy link
Collaborator

could you provide the minimal code to reproduce it ?

@danlugli
Copy link
Author

Here it is.
(The example works when REDUNDANT_CONSTRAINTS is 0, fails when it is 1)
TestNLopt2.zip

@danlugli
Copy link
Author

danlugli commented Oct 2, 2024

It's a pity. Managing redundant constraints would be useful in several cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants