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

Skip to content

Conversation

@david0oo
Copy link
Contributor

@david0oo david0oo commented Apr 12, 2024

This PR adds Differential Dynamic Programming (DDP) as a new nlp_solver_type to acados.
Many of the implemented features are based on the paper "Fast Generation of Feasible Trajectories in Direct Optimal Control" by David Kiessling, Katrin Baumgaertner, Jonathan Frey, Wilm Decré, Jan Swevers, and Moritz Diehl: https://arxiv.org/abs/2403.10115

  • The method introduced in the paper solves feasibility problem OCPs, which are generated from standard OCPs. In particular the dynamics are kept as constraints and the constraint violation of the other constraints is used as l2-penalties in the objective function. The objective of the original OCP is discarded.
  • The method is globally convergent with a line search using only the objective function since DDP keeps all iterates dynamically feasible
  • An adaptive Levenberg-Marquardt regularization + GGN Hessian is used in to guarantee positive-definiteness of the Hessian matrix. The regularization allows for local quadratic convergence

The following features were implemented:

  • The DDP method can be used to solve unconstrained OCPs which are not necessarily feasibility problems
  • A method was added that transforms the OCP into an unconstrained OCP feasibility problem as in the paper
  • The adaptive Levenberg-Marquardt strategy was added and it can be called as a new option. The strategy is suitable for (nonlinear) least-squares problems, where local quadratic convergence can be achieved for zero-residual problems. At the moment the adaptive Levenberg-Marquardt feature is only available for DDP. For details in usage please see the examples added with this pull request
  • The new DDP implemenation is fully interfaced in Python. The Python interface checks that the OCP is unconstrained in case DDP is used.
  • In order to obtain an unconstrained OCP formulation, the convenience function AcadosOcp.translate_to_feasibility_problem() is added.
  • Four test problems were added: One problems solves a QP for which SQP and DDP should only take 1 iteration, the other test problems are testing the feasibility problem feature.
  • added input contraint_type to formulate_constraint_as_L2_penalty() which supports "initial", "path", "terminal".

Limitations:

  • So far DDP is only tested for explicit integrators. For implicit integrators additional precautions need to be taken in the line search.
  • Adding to the previous point: problems with algebraic variables should be tested.
  • In the QP tolerances setter: The accuracy should be set to the minimum of the current QP accuracy and the one specified.

Copy link
Member

@FreyJo FreyJo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now!
Great job! 💯

@sandmaennchen sandmaennchen merged commit 733bba3 into acados:master May 7, 2024
@david0oo david0oo deleted the ddp_rebased branch May 7, 2024 13:33
@sandmaennchen sandmaennchen mentioned this pull request May 15, 2024
6 tasks
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