Is there any way to extract the values of the slack variables after solving?
I find the stability of my problem in the QP solver (“partial_condensing_hpipm” with Python templating) is very sensitive to the slack variable weights. (Stability in the sense that it runs consistently without crashing with exit code 3: NaN in the computations). I’m testing out different configurations for my terminal constraint set, so trying to get an idea of the order of magnitude I should be tuning my zl_e/Zl_e/zu_e/Zu_e.
Thanks for the quick turnaround Jonathan! Got it working easily and its interesting to see. It looks like it grabs all the slack variables for the soft path constraints currently, but not the slack variables on the terminal soft constraints (like sl_e / su_e ). Would it be possible to implement the same getter function for this terminal set of slacks? (I have a few additional soft constraints there)
I am using acados on Matlab, and have build my problem using the examples of wind_turbine and pendulum on cart model. I am also trying to retrieve the slack variable values using similar commands as mentioned in the above solution. If I understand correctly then the above solution is for python and since I am using Matlab I tried using: sl = ocp.get('sl')
and I get the following error: ocp_get: field sl not supported, supported values are: x, u, z, pi, sens_x, sens_u, sens_pi, status, sqp_iter, time_tot, time_lin, time_reg, time_qp_sol, stat, qp_solver_cond_H, qp_solver_A
Does Matlab support getting the slack variable values? Can I know what are sens_x, sens_u, sens_pi ?
you are right, these getters were missing in the Matlab interface.
I just added them to my most recent PR:
This commit shows how to use them:
Let me know if that works for you.
I think for the structure of the forum it would be a preferable to open a new topic with descriptive title next time.