ArticleslgStudy

science

Differential dynamic programming

Differential dynamic programming is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Differential dynamic programming rather than just read about it. In short: 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.

Key takeaways

  • Differential dynamic programming belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Differential dynamic programming to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Differential dynamic programming from memory before moving on to harder problems.

Reference excerpt

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).

Regularization and line-search 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 Optimal control

References

External links A Python implementation of DDP A MATLAB implementation of DDP The open-source software framework acados provides an efficient and embeddable implementation of DDP.

Worked examples

Example 1 — a first encounter with Differential dynamic programming

Start with the simplest possible case. Write down what Differential dynamic programming claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Differential dynamic programming before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Differential dynamic programming ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Differential dynamic programming

In research
Differential dynamic programming appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Differential dynamic programming in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Differential dynamic programming is common in secondary-school and first-year university syllabi. It links to neighbouring topics Dynamic programming, so understanding it makes those chapters shorter.
In everyday life
Look for Differential dynamic programming outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Differential dynamic programming” →

How to study Differential dynamic programming in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Differential dynamic programming means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Differential dynamic programming out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Differential dynamic programming in simple terms?

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.

Why does Differential dynamic programming matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Differential dynamic programming?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Differential dynamic programming.

Tags

  • Dynamic programming

Keep exploring