Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@FreyJo
Copy link
Member

@FreyJo FreyJo commented Mar 19, 2024

This PR implements two functionalities:

  1. the computation of the solution sensitivity with respect to parameters.
  • Usage in Python: Set ocp.solver_options.with_solution_sens_wrt_params = True, call ocp_solver.eval_solution_sensitivity(, with_respect_to='params_global').
  • Demonstrated in examples/acados_python/pendulum_on_cart/solution_sensitivities/policy_gradient_example.py
  • Implementation:
  • a) Compute derivative of right hand side of QP wrt parameters ocp_nlp_params_jac_compute
  • b) Perform vector Riccati sweep via ocp_nlp_common_eval_param_sens.
  1. the computation of the derivative of the optimal cost with respect to parameters.
  • Usage in Python: Set ocp.solver_options.with_solution_sens_wrt_params = True, call ocp_solver.get_optimal_value_gradient(with_respect_to = "params_global")
  • Demonstrated in examples/acados_python/pendulum_on_cart/solution_sensitivities/value_gradient_example.py
  • Implementation: compute Lagrange gradient of cost function wrt parameters, new external functions added.

Limitations:

  • Parametric sensitivities where constraints depend on parameters not supported
  • Parametric sensitivities only supported with discrete dynamics and external cost module

sandmaennchen and others added 30 commits March 5, 2024 16:59
@FreyJo FreyJo changed the title [WIP] Solution sensitivities with respect to parameters Solution sensitivities with respect to parameters Mar 26, 2024
@sandmaennchen sandmaennchen merged commit 66bd329 into acados:master Apr 3, 2024
sandmaennchen pushed a commit that referenced this pull request Apr 10, 2024
FreyJo added a commit that referenced this pull request Apr 23, 2024
Additional cleanup after #1055

---------

Co-authored-by: Jonathan Frey <[email protected]>
@sandmaennchen sandmaennchen deleted the param_sens branch October 29, 2024 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants