Open syangav opened 4 months ago
Hi,
about the 4 different functions,
Updating the Hessian within the factorization improves performance for small matrices (less routines calls, better data locality, etc ...), compared to doing as you suggest and updating the Hessian before calling the unconstrained Riccati.
Hello,
Thanks for open-sourcing such great code!
I noticed that there are 4 different functions who all do some kinds of Riccati recursion in HPIPM. They are:
OCP_QP_FACT_SOLVE_KKT_UNCONSTR
. This is the easiest to understand, both by name and by content. It is doing Riccati recursion for unconstrained LQR problem. Depending onsquare_root_alg
, it is either using the classical version (no Cholesky on the cost-to-go matrixP
) or the square root version (Cholesky on cost-to-go matrixP
).OCP_QP_FACT_SOLVE_KKT_STEP
. This is used whenlq_fact = 0
and the initial phase oflq_fact = 1
.OCP_QP_FACT_LQ_SOLVE_KKT_STEP
. This is used whenlq_fact = 2
and will be switched to iflq_fact = 1
and some inaccuracy happens. Thanks for your explanantion here.OCP_QP_SOLVE_KKT_STEP
. This seems to be the most widely used one among the 4 in the filex_ocp_qp_ipm.c
.To be honest, option 2, 3, 4 are too long to understand, so it would be great if you can elaborate the differences between them and their respective usage scenarios. I can tell that all of them are solving the perturbed KKT system with the inequality constraint matrix
C
, current guess of inequality Lagrangian multipliers\Lambda
and current guess of slack variablesT
.The perturbed KKT system still has the OCP QP KKT structure hence can be solved efficiently by Riccati recursion. If I were the code developer, I would add the extra term to the Hessian matrix
H
(the functionsCOND_SLACKS_FACT_SOLVE
,COND_SLACKS_SOLVE
andEXPAND_SLACKS
seem to do the job) and then simply callOCP_QP_FACT_SOLVE_KKT_UNCONSTR
. May I ask why you did not choose to do so?Thanks for your time in advance!
Best regards, Yang