Thanks for developing acados, it is an amazing package!
I’m testing whether shifting the initial (aka guess) X, U trajectories has an effect on the closed-loop performance of my controller, as in Algorithm 3 of this paper https://www.tandfonline.com/doi/pdf/10.1080/00207179.2016.1222553 . The solver I’m using is SQP-RTI with HPIPM and GN Hessian.
My understanding is that acados does NOT shift solutions by default when running SQP-RTI, therefore I shift manually using the solver getter/setter before the preparation phase.
This leads to my question:
Should the Lagrange multipliers [pi, lam] be shifted as well? My intuition is this would have no effect on the closed-loop performance, as the QP formulation is independent of the multipliers. However I would suspect less qp iterations if the shifted LM trajectory is closer to optimal. I tried shifting the multipliers and confirmed there was no effect, even with options qp_solver_warm_start = 1 or 2 and warm_start_first_qp = 1. In other words, warm-starting the QP with different multipliers seems to have no effect on the solution.
Indeed acados does not shift the current initial guess between subsequent RTI calls.
There are multiple reasons for this. A few things are not clear, some that first come to mind for me:
treating multipliers (as you mentioned)
treating varying dimension for multipliers
what to do with the terminal state?
how to treat nonuniform time grids?
…
Additionally, the unshifted previous solution is typically a really good initial guess as well. So it might not be worth it to deal with all those pitfalls above.
Regarding the QP warm start, this depends on the QP solver used.
Plus, I am not sure right now what exactly is implemented for most of them.
Which QP solver are you using?
I am not sure how much the shifted and unshifted solution differ in your example.
If they don’t differ too much the number of QP iterations might stay the same.
I guess, you could test if the multiplier initialization are used by putting some big random values.
Thanks for the reply! In the time since I wrote the original post I came to the same conclusion, that shifting has essentially no effect on the controller performance and adds complexity. For posterity, regarding the points you mention:
Treating multipliers: I found that shifting multipliers had no effect. Also what to do about terminal multipliers?
Varying dimension of multipliers: For my problem dimensions are constant except for initial (k=0). Generally, unclear what to do.
Terminal state of shifted trajectory can be found by simulation before preparation phase. k=N-1 control can be found by duplication or other means.
Nonuniform time grids: My formulation uses uniform time grids. Unclear to me what to do with nonuniform grids.
I am using HPIPM as the QP solver, which generally does not perform many iterations during my experience. Therefore it is plausible that the shifted and unshifted guesses are too similar to realize a difference in number of iterations. I didn’t have time to test random multiplier initialization.