Hello OSQP developers,

First, I would like to thank you for such an amazing solver.

I am trying to formulate and solve an MPC problem (different from the one posted on the solver examples page) where there are output and control rate cost together with slew rate constraint. I think it is a very common linear MPC problem where you can find in many traditional textbooks such as Prof. Maciejowski’s book. For your reference, you can find a sample formulation of this problem under Lund MPC tools, pp 9-12.

I put my problem into the format required by the OSQP solver but I could never get a viable/stable result from that even for a simple 2nd order system. It seems the solver does not fail but maybe the problem formulation is not correct or cannot be captured by OSQP. I do not expect any stability issues with a simple linear system and also with the existence of terminal cost/constraint. I would appreciate it if you take a look into the sample implementation (mpcQuestion) and let me know what I am missing.

Also, that would if you could provide more insight into the matrix updates Px, Px_idx, Ax, and Ax_idx in addition to what explained on the solver page. From my understanding if P is not sparse these updates make no sense, right?

Thanks,

HB