osqp / osqp-matlab

Matlab interface for OSQP
https://osqp.org/
Apache License 2.0
42 stars 25 forks source link

Translate the osqp_demo example into Matlab #19

Closed imciner2 closed 4 years ago

imciner2 commented 4 years ago

This creates a deterministic example that uses both code generation and the matlab solver and that matches the osqp_demo.c example given with the source code.

imciner2 commented 4 years ago

I believe that the behaviour here is partly luck. If I change the call to matlab to use a poor choice of initial rho and a tight tolerance, I can force to solver to use more iterations and adapt rho. In that case the behaviour is not the same, since it appears to ignore some of my settings.

Example : change the call to the setup function to solver.setup(P, q, A, l, u, 'verbose', true, 'rho', 1e6, 'eps_rel', 1e-8, 'adaptive_rho_interval',50);

I think this is related to the use of the adaptive_rho_interval as a whole rather than this example. I was just porting over the basic example to the matlab solver so it is easier to debug and the example problem matches the example given in the source code.

The problem with the adaptive_rho_interval should probably be discussed in a new issue in the main repository.

imciner2 commented 4 years ago

Ping. I think this can be merged in, since it wasn't actually trying to solve the rho behavior, it was just putting a simple example into the interface.