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

Possible bug when using equality constraints #85

Open
svigerske opened this issue Feb 23, 2020 · 5 comments
Open

Possible bug when using equality constraints #85

svigerske opened this issue Feb 23, 2020 · 5 comments

Comments

@svigerske
Copy link
Member

Issue created by migration from Trac.

Original creator: gabrielenava

Original creation time: 2018-08-02 17:15:32

Assignee: ferreau

Version: 3.2.0

Hi all, I think I may have found a bug inside the qpOASES algorithm when performing a constrained optimization with equality constraints in MATLAB. In particular, I considered the following optimization problem:

min |u|^2

s.t. Au = 0

where u is a [29 * 1] vector and A is a [6 * 29] matrix with rank 6. In theory, this problem is well posed and the solution is u = 0. However, for some valid constraint matrices A qpOASES cannot find a solution, and returns the following error:


ERROR:  Division by zero
->ERROR:  Abnormal termination due to TQ factorisation
  ->ERROR:  Determination of step direction failed
    ->ERROR:  Abnormal termination due to TQ factorisation
      ->ERROR:  Initialisation failed! QP could not be solved!

Attached to this script there is a matlab code with an example. The constraint matrix is stored in a .mat file (attached to the issue, too). Also, relaxing the problem with inequality constraints of the form:

min |u|^2

  s.t. -eps < Au < eps,
        eps > 0

did not solve the issue. As an additional information, I noted that in case the problem is really unfeasible the error from qpOASES is different.

May you help me in understanding this issue? Thanks in advance.

@svigerske
Copy link
Member Author

Attachment testQPOASES.zip by gabrielenava created at 2018-08-02 17:16:13

@traversaro
Copy link
Contributor

FYI @gabrielenava @GiulioRomualdi @MiladShafiee

@adamheins
Copy link

This issue is quite old by now, but in case someone else runs into this with a deadline too close to try switching to another solver (like me!), I ran into the same error with a very similar problem setup (but using the C++ interface) and have seemingly been able to resolve it. My problem included a constraint of the form Ax = b, where A is 6x9, and the problem is known to be feasible.

To fix it, I set the solver options to "reliable". In C++, this is:

qpOASES::Options options;
options.setToReliable();

// qp is my QProblem object
qp.setOptions(options);

(see page 30 of the user manual).

@traversaro
Copy link
Contributor

Thanks a lot @adamheins !

@steradiant
Copy link

I have the same issue. setting
options.setToReliable();
didn't really solve the problem for me. I can solve a Problem with 148 constraints but as soon as the number of constraints is increasing, say to 180, I again get the error.

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

No branches or pull requests

4 participants