II. Related Work
2.2 Direct Methods
2.2.2 Pseudospectral Methods
Instead of directly discretizing a state or control history, the number of optimiza- tion parameters can be decreased by parameterizing the vector using a series:
u(𝑡) =
𝑁
∑
𝑖=1
𝑐𝑖𝜙𝑖(𝑡) (1)
The constants, 𝑐𝑖, are the parameters solved appropriate for the set of basis functions,
{𝜙𝑖(𝑡)}𝑁𝑖=1. If orthogonal polynomials are used as the basis functions, and the zeros of
orthogonal polynomials (or their derivatives) are used for the collocation points, the method is dubbed pseudospectral [25, 96]. Using polynomials allows trivial differenti- ation, which makes enforcement of the dynamic constraints more efficient than other direct methods which rely on integration to approximate the vector field [56].
Pseudospectral methods had their origin in spectral methods, a technique for solv- ing partial differential equations referenced as far back as Reddien in 1979 [94] and used extensively in the realm of fluid dynamics [16]. The ideas migrated into control theory in the field of chemical engineering with the work of Cuthrell (among oth- ers) [20]. Within recent years, the application of pseudospectral methods to optimal control has grown quickly, and the frequency of journal articles on the subject has had a sharp rise. At least in simulation, pseudospectral methods have been applied to the control of platforms spanning from cars [71] to hypersonic reentry vehicles [58]. There has been a great deal of development and refinement of PSM, resulting in three primary varieties, the Legendre-Gauss-Lobatto Pseudospectral Method (LPM), the Gauss Pseudospectral Method (GPM), and the Radau Pseudospectral Method (RPM). The fundamental difference stems from the selection of collocation points. Commonly, for problems with a finite final time (may be unknown), the affine trans-
formation:
𝑡 = 𝑡𝑓 − 𝑡0
2 𝜏 +
𝑡𝑓 + 𝑡0
2 (2)
is applied to transform the problem from time interval 𝑡 ∈ [𝑡0, 𝑡𝑓] to the interval
𝜏 ∈ [−1, 1]. The infinite horizon problem is mapped from 𝑡 ∈ [𝑡0, ∞) to the finite
horizon 𝜏 ∈ [−1, 1], but states and controls at the final point are intentionally not calculated to avoid a singularity [27, 34]. Transforming the time allows selection of interpolation points from the interval -1 to 1. The distinction is made between state interpolation points, which include the endpoints 𝜏 = −1 and 𝜏 = 1, and the colloca- tion points, where the dynamic constraints are applied [35]. GPM does not collocate at either endpoint, but only at the interior Legendre-Gauss (LG) points. This style of collocation leads to a set of discrete Karush-Kuhn Tucker (KKT) optimality con- ditions identical to the discretized form of the first-order optimality conditions of the continuous problem at the LG points, allowing the costates to be accurately esti- mated using KKT multipliers from the NLP [5]. RPM uses Legendre-Gauss Radau (LGR) points, which include one endpoint or the other (the non-symmetric points can be mirrored about zero). Though the KKT conditions differ, the method includes collocation at an endpoint, reducing the requirement to solve for that point and po- tentially increasing the accuracy of the solution. Notably, differentiation matrices from both GPM and RPM are both non-square and full rank, allowing the expression as an integration matrix, making the problem reversible. Costate estimates for both GPM and RPM converge exponentially. LPM, which uses Legendre-Gauss-Lobatto (LGL) points for collocation (including both endpoints), has a square, singular differ- entiation matrix. This directly provides the state and control at both endpoints, as well as ensuring the dynamics are met, but at the cost of a potentially non-convergent costate [35]. The weights, differentiation matrices, and techniques for generation of enough constraints differ for each of the methods.
For each of the techniques, the orthogonal nodes are not equally spaced, but clustered near the endpoints, similar to Chebyshev points. This spacing minimizes the Runge phenomenon, a potentially divergent oscillation that can occur when increasing the order of an interpolating polynomial, as in Figure 6 [65].
−1 −0.5 0 0.5 1 −0.5 0 0.5 1 1.5 2 x y
Example of Runge Phenomenon
Truth: y = 1/(1+5x2) 5 Nodes
4th Order Polynomial 11 Nodes
10th Order Polynomial
Figure 6. Runge Phenomenon as the Number of Equally Spaced Nodes is Increased
In addition to accurate interpolation, the proper selection of collocation points also aids in the evaluation of the objective function. With the states and control only being evaluated at discrete points, the objective function can be quickly cal- culated with quadrature, exact to polynomials of degree 2𝑛 + 1, and guaranteed to converge for higher order polynomials to any continuous function by the Weierstrass Approximation Theorem [65]: 𝐽 = ∫ 1 −1 𝑓 (𝑥, 𝑢) 𝑑𝑥 ≈ 𝑛 ∑ 𝑖=1 𝑤𝑖𝑓 (𝑥𝑖, 𝑢𝑖) (3)
where weights, 𝑤𝑖, are selected appropriate to the collocation scheme (e.g., Gauss
Controls or states with discontinuities are problematic, often suffering from Gibb’s phenomenon, (a large oscillation prior to a jump in the solution) [32]. If the problem is known to be non-smooth (a change in mass when a rocket drops a stage, for example), it is best dealt with by segmenting at problem areas with “knots” [96], or phases [91]. These can also be used to mark a point in the problem where the dynamics change. Since the nodes are concentrated at the start and end of each phase, the break point will generate the greatest nodal density, and the number of nodes for each phase can be increased until the solution is sufficiently accurate.
Tsuchiya sought to increase the density of nodes in the first portion of a solution in a near-real-time implementation for aircraft guidance. Recursive solutions were provided every 30 seconds. Assuming convergence of the next path, only the first 30 seconds of each provided path was flown. An introductory segment of fixed time was declared, with a higher node density to provide smoother control for the portion of the path that would actually be used [110].
2.2.2.1 Adaptive Grid Refinement.
Darby has contributed an hp-Adaptive method that adjusts griding on the fly, even for systems where the shape of the solution is not known [21]. Finite element “hp” methods were adapted, where ℎ refers to the segment width and 𝑝 denotes the order of the polynomial degree in each segment. Recalling that the dynamics of the states and controls are only enforced at the collocation points, Darby calculates the same collocation constraint (the derivative of the approximating polynomial must match the derivative supplied from the dynamics), but the constraint is evaluated between collocation points, forming a matrix of midpoint residuals. Oversimplifying, if a single residual is high, a discontinuity is suspected and a segment break is added
for the next iteration. If many residuals are high, a poor polynomial fit is assumed and 𝑝 is increased.
This method was adopted for the real-time controller in this project. Accomplish- ing collocation in this manner allows fewer nodes to be used in attaining the initial solution, without fear of missing important characteristics in the optimal path, as differences between nodes will be checked. Fewer nodes translates to a less complex NLP, solved with a greater speed. While more solution iterations are required, each iteration “bootstraps” the guess from its predecessor, greatly aiding convergence.