Differential dynamic programming

Differential dynamic programming (DDP) is an optimal control algorithm of the trajectory optimization class. The algorithm was introduced in 1966 by Mayne and subsequently analysed in Jacobson and Mayne's eponymous book. The algorithm uses locally-quadratic models of the dynamics and cost functions, and displays quadratic convergence. It is closely related to Pantoja's step-wise Newton's method.

Finite-horizon discrete-time problems

The dynamics

describe the evolution of the state ๐ฑ given the control ๐ฎ from time i to time i+1. The total cost J0 is the sum of running costs โ„“ and final cost โ„“f, incurred when starting from state ๐ฑ and applying the control sequence ๐”โ‰ก{๐ฎ0,๐ฎ1โ€ฆ,๐ฎNโˆ’1} until the horizon is reached:

J0(๐ฑ,๐”)=โˆ‘i=0Nโˆ’1โ„“(๐ฑi,๐ฎi)+โ„“f(๐ฑN),

where ๐ฑ0โ‰ก๐ฑ, and the ๐ฑi for i>0 are given by Eq. 1. The solution of the optimal control problem is the minimizing control sequence ๐”โˆ—(๐ฑ)โ‰กargmin๐”J0(๐ฑ,๐”). Trajectory optimization means finding ๐”โˆ—(๐ฑ) for a particular ๐ฑ0, rather than for all possible initial states.

Dynamic programming

Let ๐”i be the partial control sequence ๐”iโ‰ก{๐ฎi,๐ฎi+1โ€ฆ,๐ฎNโˆ’1} and define the cost-to-go Ji as the partial sum of costs from i to N:

Ji(๐ฑ,๐”i)=โˆ‘j=iNโˆ’1โ„“(๐ฑj,๐ฎj)+โ„“f(๐ฑN).

The optimal cost-to-go or value function at time i is the cost-to-go given the minimizing control sequence:

V(๐ฑ,i)โ‰กmin๐”iJi(๐ฑ,๐”i).

Setting V(๐ฑ,N)โ‰กโ„“f(๐ฑN), the dynamic programming principle reduces the minimization over an entire sequence of controls to a sequence of minimizations over a single control, proceeding backwards in time:

This is the Bellman equation.

Differential dynamic programming

DDP proceeds by iteratively performing a backward pass on the nominal trajectory to generate a new control sequence, and then a forward-pass to compute and evaluate a new nominal trajectory. We begin with the backward pass. If

โ„“(๐ฑ,๐ฎ)+V(๐Ÿ(๐ฑ,๐ฎ),i+1)

is the argument of the minโก[โ‹…] operator in Eq. 2, let Q be the variation of this quantity around the i-th (๐ฑ,๐ฎ) pair:

Q(ฮด๐ฑ,ฮด๐ฎ)โ‰กโ„“(๐ฑ+ฮด๐ฑ,๐ฎ+ฮด๐ฎ)+V(๐Ÿ(๐ฑ+ฮด๐ฑ,๐ฎ+ฮด๐ฎ),i+1)โˆ’โ„“(๐ฑ,๐ฎ)โˆ’V(๐Ÿ(๐ฑ,๐ฎ),i+1)

and expand to second order

The Q notation used here is a variant of the notation of Morimoto where subscripts denote differentiation in denominator layout. Dropping the index i for readability, primes denoting the next time-step Vโ€ฒโ‰กV(i+1), the expansion coefficients are

Q๐ฑ=โ„“๐ฑ+๐Ÿ๐ฑ๐–ณV'๐ฑQ๐ฎ=โ„“๐ฎ+๐Ÿ๐ฎ๐–ณV'๐ฑQ๐ฑ๐ฑ=โ„“๐ฑ๐ฑ+๐Ÿ๐ฑ๐–ณV'๐ฑ๐ฑ๐Ÿ๐ฑ+V๐ฑโ€ฒโ‹…๐Ÿ๐ฑ๐ฑQ๐ฎ๐ฎ=โ„“๐ฎ๐ฎ+๐Ÿ๐ฎ๐–ณV'๐ฑ๐ฑ๐Ÿ๐ฎ+V'๐ฑโ‹…๐Ÿ๐ฎ๐ฎQ๐ฎ๐ฑ=โ„“๐ฎ๐ฑ+๐Ÿ๐ฎ๐–ณV'๐ฑ๐ฑ๐Ÿ๐ฑ+V'๐ฑโ‹…๐Ÿ๐ฎ๐ฑ.

The last terms in the last three equations denote contraction of a vector with a tensor. Minimizing the quadratic approximation (3) with respect to ฮด๐ฎ we have

giving an open-loop term ๐ค=โˆ’Q๐ฎ๐ฎโˆ’1Q๐ฎ and a feedback gain term ๐Š=โˆ’Q๐ฎ๐ฎโˆ’1Q๐ฎ๐ฑ. Plugging the result back into (3), we now have a quadratic model of the value at time i:

ฮ”V(i)=โˆ’12Q๐ฎTQ๐ฎ๐ฎโˆ’1Q๐ฎV๐ฑ(i)=Q๐ฑโˆ’Q๐ฑ๐ฎQ๐ฎ๐ฎโˆ’1Q๐ฎV๐ฑ๐ฑ(i)=Q๐ฑ๐ฑโˆ’Q๐ฑ๐ฎQ๐ฎ๐ฎโˆ’1Q๐ฎ๐ฑ.

Recursively computing the local quadratic models of V(i) and the control modifications {๐ค(i),๐Š(i)}, from i=Nโˆ’1 down to i=1, constitutes the backward pass. As above, the Value is initialized with V(๐ฑ,N)โ‰กโ„“f(๐ฑN). Once the backward pass is completed, a forward pass computes a new trajectory:

๐ฑฬ‚(1)=๐ฑ(1)๐ฎฬ‚(i)=๐ฎ(i)+๐ค(i)+๐Š(i)(๐ฑฬ‚(i)โˆ’๐ฑ(i))๐ฑฬ‚(i+1)=๐Ÿ(๐ฑฬ‚(i),๐ฎฬ‚(i))

The backward passes and forward passes are iterated until convergence. If the Hessians Q๐ฑ๐ฑ,Q๐ฎ๐ฎ,Q๐ฎ๐ฑ,Q๐ฑ๐ฎ are replaced by their Gauss-Newton approximation, the method reduces to the iterative Linear Quadratic Regulator (iLQR).

Differential dynamic programming is a second-order algorithm like Newton's method. It therefore takes large steps toward the minimum and often requires regularization and/or line-search to achieve convergence. Regularization in the DDP context means ensuring that the Q๐ฎ๐ฎ matrix in Eq. 4 is positive definite. Line-search in DDP amounts to scaling the open-loop control modification ๐ค by some 0<ฮฑ<1.

Monte Carlo version

Sampled differential dynamic programming (SaDDP) is a Monte Carlo variant of differential dynamic programming. It is based on treating the quadratic cost of differential dynamic programming as the energy of a Boltzmann distribution. This way the quantities of DDP can be matched to the statistics of a multidimensional normal distribution. The statistics can be recomputed from sampled trajectories without differentiation.

Sampled differential dynamic programming has been extended to Path Integral Policy Improvement with Differential Dynamic Programming. This creates a link between differential dynamic programming and path integral control, which is a framework of stochastic optimal control.

Constrained problems

Interior Point Differential dynamic programming (IPDDP) is an interior-point method generalization of DDP that can address the optimal control problem with nonlinear state and input constraints.

See also

References

  1. โ†‘ Mayne, D. Q. (1966). "A second-order gradient method of optimizing non-linear discrete time systems". Int J Control. 3: 85โ€“95. doi:10.1080/00207176608921369.
  2. โ†‘ Mayne, David Q.; Jacobson, David H. (1970). Differential dynamic programming. New York: American Elsevier Pub. Co. ISBNย 978-0-444-00070-5.
  3. โ†‘ de O. Pantoja, J. F. A. (1988). "Differential dynamic programming and Newton's method". International Journal of Control. 47 (5): 1539โ€“1553. doi:10.1080/00207178808906114. ISSNย 0020-7179.
  4. โ†‘ Liao, L. Z.; C. A Shoemaker (1992). "Advantages of differential dynamic programming over Newton's method for discrete-time optimal control problems". Cornell University. hdl:1813/5474.
  5. โ†‘ Morimoto, J.; G. Zeglin; C.G. Atkeson (2003). "Minimax differential dynamic programming: Application to a biped walking robot". Intelligent Robots and Systems, 2003.(IROS 2003). Proceedings. 2003 IEEE/RSJ International Conference on. Vol.ย 2. pp.ย 1927โ€“1932.
  6. โ†‘ Baumgรคrtner, K. (2023). A Unified Local Convergence Analysis of Differential Dynamic Programming, Direct Single Shooting, and Direct Multiple Shooting. 2023 European Control Conference (ECC). pp.ย 1โ€“7. doi:10.23919/ECC57647.2023.10178367.
  7. โ†‘ Liao, L. Z; C. A Shoemaker (1991). "Convergence in unconstrained discrete-time differential dynamic programming". IEEE Transactions on Automatic Control. 36 (6): 692. doi:10.1109/9.86943.
  8. โ†‘ Tassa, Y. (2011). Theory and implementation of bio-mimetic motor controllers (PDF) (Thesis). Hebrew University. Archived from the original (PDF) on 2016-03-04. Retrieved 2012-02-27.
  9. โ†‘ "Sampled differential dynamic programming". 2016 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). doi:10.1109/IROS.2016.7759229. S2CIDย 1338737.
  10. โ†‘ Rajamรคki, Joose; Hรคmรคlรคinen, Perttu (June 2018). Regularizing Sampled Differential Dynamic Programming - IEEE Conference Publication. 2018 Annual American Control Conference (ACC). pp.ย 2182โ€“2189. doi:10.23919/ACC.2018.8430799. S2CIDย 243932441. Retrieved 2018-10-19.
  11. โ†‘ Rajamรคki, Joose (2018). Random Search Algorithms for Optimal Control. Aalto University. ISBNย 978-952-60-8156-4. ISSNย 1799-4942.
  12. โ†‘ Lefebvre, Tom; Crevecoeur, Guillaume (July 2019). "Path Integral Policy Improvement with Differential Dynamic Programming". 2019 IEEE/ASME International Conference on Advanced Intelligent Mechatronics (AIM). pp.ย 739โ€“745. doi:10.1109/AIM.2019.8868359. hdl:1854/LU-8623968. ISBNย 978-1-7281-2493-3. S2CIDย 204816072.
  13. โ†‘ Theodorou, Evangelos; Buchli, Jonas; Schaal, Stefan (May 2010). "Reinforcement learning of motor skills in high dimensions: A path integral approach". 2010 IEEE International Conference on Robotics and Automation. pp.ย 2397โ€“2403. doi:10.1109/ROBOT.2010.5509336. ISBNย 978-1-4244-5038-1. S2CIDย 15116370.
  14. โ†‘ Pavlov, Andrei; Shames, Iman; Manzie, Chris (2020). "Interior Point Differential Dynamic Programming". IEEE Transactions on Control Systems Technology. 29 (6): 2720. arXiv:2004.12710. Bibcode:2021ITCST..29.2720P. doi:10.1109/TCST.2021.3049416.