aburda
February 12, 2025, 11:17am
1
Hi
I want to derive some constants for an algorithm and need to take a look at the Hessian of the Lagrangian. Is there a straightforward way to get it in acados? Interface doesn’t matter.
Best,
Artyom
FreyJo
February 12, 2025, 12:46pm
2
Hi,
The function AcadosOcpSolver.qp_diagnostics()
is a great starting point for what you want to do:
del solution[k]
# save
with open(filename, 'w') as f:
json.dump(solution, f, default=make_object_json_dumpable, indent=4, sort_keys=True)
if verbose:
print("stored current iterate in ", os.path.join(os.getcwd(), filename))
def qp_diagnostics(self, hessian_type: str = 'FULL_HESSIAN'):
"""
Compute some diagnostic values for the last QP.
result = ocp_solver.qp_diagnostics(hessian_type). Possible values are
'FULL_HESSIAN' or 'PROJECTED_HESSIAN'
returns a dictionary with the following fields:
- min_eigv_stage: dict with minimum eigenvalue for each Hessian block.
- max_eigv_stage: dict with maximum eigenvalue for each Hessian block.
- condition_number_stage: dict with condition number for each Hessian block.
- condition_number_global: condition number for the full Hessian.
Best,
Jonathan
aburda
February 12, 2025, 1:24pm
3
Hi Jonathan,
That’s exactly what I was looking for, thanks!
Best,
Artyom
1 Like