Discretization and Interpolation
The Radau and Lobatto Nodes
Pockit provides two types of interpolation nodes: Radau and Lobatto nodes.
- Radau nodes can be discontinuous at the endpoints of subintervals (i.e. mesh points). If the function's discontinuous points are at the subinterval endpoints, the function can be accurately represented by the approximating function.
- Lobatto nodes share the same optimization variable at the common endpoints of adjacent subintervals, so the interpolation result is always a continuous function and can only accurately approximate continuous functions. Additionally, Lobatto nodes are symmetric within the subinterval.
Guidelines for selection:
- If the control is continuous, both types of interpolation nodes can be used.
- If the control is discontinuous but does not require precise calculation for instantaneous switching, allowing approximation with a steep slope over a short time, both types of interpolation nodes can be used.
- If precise approximation of a discontinuous function is required, only Radau nodes can be chosen.
Number of Subintervals and Interpolation Points
Pockit approximates the function over the time interval as interpolating polynomials inside each subinterval. The division of subintervals and the number of interpolation points in each subinterval are user-specified parameters, which can also be automatically adjusted using iterative methods provided by Pockit.
When choosing subintervals, note:
- Too many or too few subintervals may lead to failure in solving the problem.
- If the control variable is a discontinuous function, the endpoints of subintervals should be as close to the discontinuity points as possible to achieve better approximation.
- To avoid ill-conditioned numerical problems, the lengths of different subintervals should not differ by several orders of magnitude.
When choosing the number of interpolation points, note:
- The number of interpolation points in different subintervals can vary, but should not differ too much.
- If the control is a discontinuous function, a lower number of interpolation points (\(1 \sim 10\)) often yields better approximation results; if the control is smooth, the number of interpolation points in each subinterval can be appropriately increased (\(10\sim 20\)), but should not be too many (\(> 30\)).