1. Introduction
In the middle of 20th century, optimal control began to form and develop as a new discipline. During these decades of development, optimal control has been gradually applied in some engineering fields such as aerospace [
1,
2,
3], transportation [
4], chemical industry [
5] and so on. Among them, aerospace is one of the most widely used fields of optimal control. In fact, many problems in aerospace engineering can be regarded as optimal control problems (OCPs) with unspecified final time, which have attracted much attention. The particularity of this kind of problem is that the control and final time are highly coupled, and they need to be solved with high accuracy. For instance, satellite orbit transfer, launch vehicle boost phase guidance and missile terminal guidance can be regarded as OCPs with free final time. Therefore, it is necessary and meaningful to develop an efficient method to address them.
In recent years, many scholars have studied the pseudospectral methods for solving nonlinear OCPs [
6,
7,
8,
9,
10,
11,
12]. For pseudospectral method, the state and control variables need to be approximated by interpolation polynomials and derivative terms are represented by numerical differentiation. Thus, the dynamic equations can be formulated to a set of algebraic equations on discrete nodes. Therefore, a continuous OCP can be transformed into a nonlinear programming (NLP) problem. Pseudospectral methods are usually separated into Chebyshev, Legendre, Gauss and Radau pseudospectral methods according to discrete nodes [
13,
14,
15,
16,
17]. In essence, the pseudospectral method is a direct method. However, highly accurate costate can be approximated. Meanwhile, the first-order necessary conditions (KKT conditions) of NLP that are obtained by the pseudospectral method are equivalent to that of OCPs. Therefore, its optimality has theoretical justification. Unfortunately, the pseudospectral methods require third-party NLP solvers, which occupies a large amount of memory and computational resources. In addition, if the initial value is bad, the convergence rate of the algorithm will be slow. Therefore, pseudospectral methods are usually used for off-line optimization [
18,
19,
20].
To implement onboard, some scholars aim to improve the computational efficiency of optimal control algorithms and make their code as simple as possible. In [
21], an optimization algorithm named model predictive static programming (MPSP) is proposed. This method solves OCPs with terminal constraints and fixed final time. This method has been used in several practical problems [
22,
23]. Then, Maity et al. extended MPSP to solve the free final time problems [
24,
25]. In addition, QS-MPSP developed on the basis of MPSP is an improved method [
26,
27,
28]. In [
29], a model predictive control method LGPMPC based on the pseudospectral method is proposed. This method is also used to deal with the OCPs with fixed terminal time. This method combines the idea of quasi-linearization and pseudospectral method, so that the solution procedure no longer depends on the third-party NLP solvers. Additionally, compared with MPSP, LGPMPC has higher computational efficiency. Therefore, this method is suitable for online optimization. So far, LGPMPC has made further development. For instance, an entry guidance method based on LGPMPC is proposed in [
30]. In [
31], LGPMPC is extended to solve the piecewise continuous OCPs. However, LGPMPC does not consider the variation in terminal time, so it cannot solve the OCPs with unspecified terminal time.
At present, some methods such as the quasi-linearization method and gradient method have the potential to solve the unspecified terminal time OCPs online. The gradient method can be divided into first-order gradient method (FOGM), second-order gradient method (SOGM) and conjugate gradient method (CGM) [
32]. It should be noted that both quasi-linearization method and gradient method are iterative algorithms, which approach the optimal solution gradually by iterating the initial value. Some studies have been previously made. In [
33], an algorithm based on the improved quasi-linearization technique is proposed to solve the OCPs with unspecified final time. Yang proposed a two-stage gradient method to solve two-stage OCPs with uncertain switching time [
34]. A multisystem gradient method was proposed in [
35] to solve the integrated OCPs of multiple systems with free terminal time, which is on the foundation of FOGM. In [
36], a CGM with pseudospectral collocation scheme is proposed, which is successfully applied to the landing guidance of rockets. Although these methods are successful, we found that if other orthogonal polynomials are involved, the computational efficiency can be further improved and the analytical correction formulas can be further simplified.
In this work, a linear Chebyshev pseudospectral method (LCPM) is proposed for solving OCPs with unspecified terminal time. The main contributions can be summarized as follows. First, by linearizing the dynamic system, the first-order necessary conditions for the discrete form of unspecified terminal time OCPs can be obtained. Second, the correction formulas of control and final time satisfying first-order necessary conditions are derived. The solution to the original problem is transformed into successively solving a set of linear differential equations containing costate variables. Next, the obtained differential equations are discretized on the Chebyshev–Gauss–Lobatto (CGL) points. As a result, a series of analytical correction formulas are successfully derived in approximating polynomial space. The significant differences between this work and previous work are as follows: 1. The variation in terminal time is considered, and the correction formula of terminal time is derived. 2. CGL points are used to discretize the differential equation, and its expansion is very close to the best polynomial approximation under infinite norm. In addition, CGL points can be solved in closed form without using numerical techniques. Finally, the guidance problem of air-to-ground missile is used to test the proposed method. The simulation results show that LCPM has high computational efficiency and fast convergence rate. In comparison with the results of GPOPS-II, the optimality of LCPM is comprehensively confirmed. In addition, Monte Carlo simulation results show that LCPM can still converge in the presence of random uncertainty, which verifies the robustness and stability of the algorithm. Conclusively, this method has potential to be applied onboard.
The paper is organized as follows.
Section 2 shows the first-order necessary conditions of OCPs with unspecified terminal time. In
Section 3, the derivations of updating control and final time are presented. The simulation results and discussion are given in
Section 4. Finally, the conclusion is given in
Section 5.
2. Problem Formulation
In this section, the general form and first-order necessary conditions of nonlinear OCPs with unspecified terminal time are given.
Consider a general nonlinear dynamic system whose differential equations can be written as
where
is the state vector,
is the control vector and
is the time variable. The hard terminal constraints are
Here,
is the terminal constraint functions and
is the unspecified final time. The performance index is
where
is the initial time. Equations (1)–(3) describe an OCP with unspecified terminal time. The goal is to find an optimal control and terminal time to minimize the performance index.
Using Taylor expansion and neglecting higher-order terms, the nonlinear differential equations are linearized as
where
.
To solve OCPs iteratively, the state and control variables are expressed as
Here,
and
represent nominal state and control variables.
and
are the deviations from the state and control. Then, Equation (4) can be rewritten as
Select
, the augmented performance index of the system can be expressed as
Hamiltonian function can be defined as
where
is the costate variable.
The modified state and control variables are expected to satisfy the first-order necessary conditions. According to the first-order necessary conditions, it is easy to find that
According to (4), (6) and (9), we have
The transversality condition is
where
is a Lagrange multiplier vector corresponding to terminal constraints. There are two cases of the terminal value of the costate variables. For unconstrained terminal state variable components
, the corresponding costate variables are
For constrained terminal state variable components
, the corresponding costate variables are
It can be seen that is known when is unconstrained, and is unknown when is constrained.
Since the terminal time is not fixed, the following additional condition needs to be considered.
Equations (6), (9), (10), (12) and (15) constitute the first-order necessary conditions for the OCPs with unspecified terminal time.
3. Linear Chebyshev Pseudospectral Method
To solve original OCPs with unspecified terminal time, it is necessary to find the optimal control and terminal time that satisfy the first-order necessary conditions. The thought of LCPM is to iteratively make corrections on control and final time through first-order necessary conditions in linear perturbation equations so as to approach the optimal solution gradually.
In this section, the control and terminal time update strategies are derived first. Then, the derivation of LCPM is provided. Finally, the implementation steps of this method are given.
3.1. Control and Terminal Time Update Strategies
According to the derivation in
Section 2, the correction of the control can be determined by (9). Therefore, it is only necessary to derive the terminal time correction here.
According to (7), the performance index can be written as
Considering the differential variations in final time
, the differential of (16) is
Integrating (17) by parts, we can get
Because
is given, we have
. The variation
in
has the significance of keeping time fixed, hence the differentiation and variation in
have the following relations
Therefore,
can be obtained. Substituting it into (18)
If only the differential change
is considered, the change in the performance index due to
is
From (21), we can choose
where
is a positive constant. Substituting (22) into (21), we have
It can be seen that unless is zero, (23) is negative. Therefore, the caused by will decrease until , which also satisfies the first-order necessary condition (15). It can be found that will reduce the performance index until the optimal solution is reached.
Now the modified forms of control and terminal time have been obtained, as shown in (9) and (22), respectively. However, to figure out and , the costate variable needs to be solved first.
Equations (10) and (11) can be written as
The OCP has been transformed into a two-point boundary value problem. By solving (24), the costate variables can be solved; thus, the corrections of control and terminal time can be obtained.
3.2. Derivation of LCPM
According to the derivation in the previous section, it is known that the key to solving this problem is to solve Equation (24). However, (24) is a set of differential equations, which cannot be solved in an analytical manner. To address this problem and develop a more efficient algorithm, we hope to transfer them into a set of algebraic equations. Thus, Lagrange interpolation polynomials and differential approximation matrices are used to approximately replace variables and differential terms in (24), respectively. The analytical formula can be obtained. The derivation of the algorithm is given below.
In this method, the interpolation nodes used are CGL points, which are in the interval of
. Therefore, it is necessary to transform the time domain of the system
to
.
Differential Equation (24) is transformed to
The state, control and costate variables can be approximated as
The interpolation nodes used here are CGL points, which are the extreme points of N-order Chebyshev polynomials
. CGL points are defined as
According to the properties of Lagrange interpolation polynomials, we have
The derivatives of state and costate variables can be represented by the differential approximation matrices as
where
is
matrix,
,
.
can be obtained by taking the derivative of Lagrange polynomials at CGL points.
Since
is given, we have
. The state and costate variables can be expressed as
By substituting (33) into (28), a set of linear algebraic equations can be obtained.
where
. (36) can be expressed in matrix form
where
The number of equations is . Suppose that the number of state variables constrained by the terminal is h, then the is known. In addition, terminal costate variables corresponding to the unconstrained states can be solved by (13). Obviously, the number of unknowns is . Therefore, the system has a unique solution.
The costate variables can be solved by (37), and the update of control and terminal time can be obtained from (9) and (22).
3.3. Implementation Steps of LCPM
LCPM solves the OCPs with free final time by iteratively updating the control and terminal time. First, the current control and final time are used to integrate the system dynamic equations, then the information of trajectory and terminal error are obtained. Finally, the control and final time are corrected using this information until it is close to the optimal solution. The flow of the algorithm is as follows.
Step 1: Select initial control and final time .
Step 2: Use the current control and final time to integrate the dynamic equations and record the information of trajectory and terminal error .
Step 3: Use the information of trajectory and terminal error to solve Equation (37), substitute the obtained costate variables into (42) and (43). Then, the updated control and terminal time can be obtained. To avoid the algorithm divergence caused by a large change in the terminal time , we add a measure to restrict in the algorithm. If , we choose , while the sign stays the same. Here, is a positive constant. In this paper, we select .
Step 4: Take the updated control and final time as the current control and final time, return to step 2, and judge whether the values of the terminal error and Equation (15) meet the requirements. If so, the algorithm ends; if not, it continues.
The flow chart of the algorithm is shown in
Figure 1.
and
are the convergence criteria of the algorithm, and the specific values are given in Equation (47).
Through the above steps, the OCPs with unspecified terminal time can be solved. It should be noted that the initial control, initial terminal time, parameters , and convergence criteria for terminal error need to be provided before the algorithm starts.