Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Nonlinear Trajectory Optimization Problems

Unconstrained Problem

The unconstrained nonlinear trajectory optimization problem is most commonly solved in the discrete-time form is certainly more typical than its continuous-time counterpart. We will cover direct transcription and iterative LQR (iLQR) / differential dynamic programming (DDP) as means of solving this problem.

Direct Transcription

Direct transcription simply solves the problem as any nonlinear program, typically using sequential quadratic programming (SDP). In SDP we start by initializing the algorithm with a nominal trajectory , (important if the problem is non-convex), around which we form a QP that locally approximates the original problem: Its terms are obtained using first and second order Taylor expansions of the system’s dynamics and cost functions, evaluated at , . The solution , represents a search direction that is already scaled bases on the local curvature of the problem. Direct transcription faces challenges common to general nonlinear programming (NLP) in general.

  • The quadratic approximation is non-convex
  • Taking the full step does not improve the objective function
  • Constraints are not satisfied after updating the trajectory

As a resource for suitable strategies I generally point to Nocedal2006.

iLQR & DDP

An entirely different philosophy for solving this problem is followed in the closely linked iLQR and DDP algorithms. Both algorithms have a two pass structure. First in the backward pass quadratic approximations of the Bellman equation are solved at each timestep along the receding horizon. This not only produces a local approximation of value function but also produces a policy update as a by-product. In the forward pass the updated controlled policy is applied while simulate the system’s behavior forwards in time:

Backward Pass

where with

Unconstrained Continuous-Time Problem

Let us now tackle the continuous-time problem As optimization of continuous variables is rather impractical, we generally need to discretize the problem at some point. This is often done even before stating the trajectory optimization problem. For instance, we may discretize using Runge-Kutta methods (with a zero-order hold on the input ) as : resulting in standard discrete-time dynamics. This is typically done using explicit schemes Then, approximating the integral with a sum we get the discrete-time trajectory optimization problem that can be solved using direct transcription or iLQR/DDP.

Alternatively, we can aim for a higher degree of accuracy (and improved stability) by using implicit RK schemes In standard forward simulation this comes with the disadvantage of having to solve a set of nonlinear equations to acquire at each step. However, as we are already solving a nonlinear optimization problem, we may directly incorporate these equations into its constraints.

Direct Collocation

This exactly is utilized by direct collocation methods. Here we typically reserve the symbol for timesteps and use and as a substitute for and . This is in-line with the idea of fitting a polynomial that approximates the value of on each interval which behind the formulation of many implicit RK methods. Additionally, control inputs , take the form of polynomial functions: where are polynomial bases, however the running cost is for convenience evaluated only at the end-points of timesteps in most cases. The overall problem can then be stated as This problem is then typically solved again using SQP, similarly to direct collocation.

Constrained Problems

Similarly to how we linearized the system’s dynamics it is common to also linearize additional constraints, e.g. to fit within SQP. However, for some types of constraints, such as second-order cone constraints, there are specialized ways in which they can be effectively handled (e.g. ADMM).

Due to the special structure of the trajectory optimization problem, many specialized solvers capable of handling additional constraints exist. As nonlinear MPC is still extremely computationally demanding, these solvers are often tailored to handle specific types of constraints, also making deliberate choices when it comes to how the algorithms converge (Altro, Crocoddyl, MJPC).