Time varying system support

67 views
Skip to first unread message

jakubm...@googlemail.com

unread,
Dec 31, 2018, 10:42:04 AM12/31/18
to OSQP
Hello!

Is it at all possible to use your solver for optimizing time varying systems? Concretly, I have a system that I want to iteratively linearize. Sorry if vague, this is my first experience with MPC and optimization in general.

Thanks for your time and I wish a happy 2019 to the team and community!

Paul Goulart

unread,
Dec 31, 2018, 11:38:23 AM12/31/18
to jakubm...@googlemail.com, OSQP
Yes, this is possible.   Every time you linearise it will amount to updating some of the values in the A or P matrices of your QP.   Before creating a solver object you should figure out all of the places that can be nonzero after linearisation.    Then pass OSQP A and P matrices to OSQP during the setup phase that have nonzeros in those locations so that the solver can allocate enough internal memory for itself given those patterns.

Once this has been done, you can relinearise your problem and update the values in A/P before call the solver again.    This will be much faster than creating a completely new solver object every time you linearise.

The details of this process are very similar in all of our different solver interfaces (or directly in C) and are described in the documentation pages.   For Matlab, for example, see here: https://osqp.org/docs/interfaces/matlab.html

For other languages, just follow the above link and then pick Interfaces/<your_language> on that page.

There is also some example code on the site that shows how to use this update feature (for the vector valued problem data, but the process is very similar).   You can find it here: https://osqp.org/docs/examples/lasso.html

PG

--
You received this message because you are subscribed to the Google Groups "OSQP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osqp+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osqp/b6c04188-8afd-4c9c-9da5-d493687d15b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages