Direct Collocation
Direct collocation [1] is a trajectory optimization method which belongs to the collocation methods. The optimal control problem is transformed into a mathematical programming problem by transcribing the trajectory with \(N\) knot points \(\{\vect{x}_i\}\). For the optimization a loss function \(L(\{\vect{x}_i\}, \{\vect{u}_i\})\) is minimized with the knot points and the control inputs \(\{\vect{u}_i\}\) as decision variables. The formulation of the optimization problem to compute a trajectory from an initial state \(x_{init}\) to a goal state \(x_{goal}\) while obeying control limits \((u_{1, max}, u_{2, max})\) is
The numerical solution can be obtained with Sequential Quadratic Programming (SQP). In practice, it can be useful to interpolate the trajectory between knot points as well as between controls with polynomials and then using the parameters of these piecewise polynomials as decision variables instead. This allows to use fewer knot points and still obtain consistent trajectories.
References
[1] Hargraves, Charles R., and Stephen W. Paris. “Direct trajectory optimization using nonlinear programming and collocation.” Journal of guidance, control, and dynamics 10.4 (1987): 338-342. url: https://arc.aiaa.org/doi/abs/10.2514/3.20223