Solving optimal control problems using a Gegenbauer

1 downloads 0 Views 528KB Size Report
for solving continuous-time optimal control (OC) problems. (CTOCPs) with nonlinear ..... (b0,...,bM )T using the available powerful optimization methods.
2012 Australian Control Conference

15-16 November 2012, Sydney, Australia

Solving Optimal Control Problems Using A Gegenbauer Transcription Method Kareem T. Elgindy, Kate A. Smith-Miles and Boris Miller Abstract— In this paper we describe a novel direct optimization method using Gegenbauer-Gauss (GG) collocation for solving continuous-time optimal control (OC) problems (CTOCPs) with nonlinear dynamics, state and control constraints. The time domain is mapped onto the interval [0, 1], and the dynamical system formulated as a system of ordinary differential equations is transformed into its integral formulation through direct integration. The state and the control variables are fully parameterized using Gegenbauer expansion series with some unknown Gegenbauer spectral coefficients. The proposed Gegenbauer transcription method (GTM) then recasts the performance index, the reduced dynamical system, and the constraints into systems of algebraic equations using optimal Gegenbauer quadratures. Finally, the GTM transcribes the infinite-dimensional OC problem into a parameter nonlinear programming (NLP) problem which can be solved in the spectral space; thus approximating the state and the control variables along the entire time horizon. The high precision and the spectral convergence of the discrete solutions are verified through two OC test problems with nonlinear dynamics and some inequality constraints. The present GTM offers many useful properties and a viable alternative over the available direct optimization methods.

I. INTRODUCTION Optimal control (OC) theory is an elegant mathematical tool for making optimal decision policies pertained to complex dynamical systems. The theory plays an increasingly important role in the design and modelling of modern systems with broad attention from industry. The main goal of OC theory is to determine the input OC signals which influence a certain process to satisfy some physical constraints while optimizing some performance criterion. Although extensive studies have been conducted on OC problems governed by nonlinear dynamical systems, determining the OC within high-precision is still challenging for many problems. Classical solution methods such as the calculus of variations, dynamic programming and Pontryagin’s maximum/minimum principle can provide the OC only in very special cases, but Kareem T. Elgindy is with the School of Mathematical Sciences, Monash University, Clayton Victoria 3800, Australia, and is also with the Mathematics Department, Faculty of Science, Assiut University, Assiut 71516, Egypt [email protected];

[email protected] Kate A. Smith-Miles is with the School of Mathematical Sciences, Monash University, Clayton Victoria 3800, Australia

[email protected] Boris Miller is with the School of Mathematical Sciences, Monash University, Clayton Victoria 3800, Australia, and is also with the Institute for Information Transmission Problems, Russian Academy of Sciences, Moscow, Russia [email protected] The work of B. Miller was supported in part by the Australian Research Council Grant DP0988685 and by the Russian Basic Research Foundation Grant 10-01-00710.

ISBN 978-1-922107-63-3

417

in general, a closed form expression of the OC is usually out of reach and not even practical to obtain [1], [2]. These difficulties drove the researchers and scholars, since last century, to search for viable alternative computational techniques to the aforementioned classical methods, taking advantage of the giant evolution in the areas of numerical analysis and approximation theory, and the advent of rapid and powerful digital computers. Among the available computational methods for solving continuous-time OC problems (CTOCPs), direct optimization methods convert the CTOCP into a finitedimensional nonlinear programming (NLP) problem through control and/or state parameterization. The reduced NLP can be solved using the available robust optimization solvers. The simplicity of the discretization procedure, the high accuracy, and the fast convergence of the solutions of the discretized OC problem have made the direct optimization methods the ideal methods of choice [3], [4], and well suited for solving OC problems, cf. [5]–[9], and the references therein. Our goal in this article is to develop an efficient direct optimization method for solving CTOCPs. Moreover, we aim to establish a high-order numerical scheme which results in a NLP problem with considerably low-dimension space to facilitate the application of the NLP solvers, and accelerate the solution procedure. The proposed method converts the CTOCP into a NLP problem through the application of a spectral collocation scheme based on Gegenbauer polynomials. To overcome the ill-conditioning of the spectral differentiation matrices (SDMs), the underlying dynamical system of the differential equations is transformed into its integral formulation through direct integration. Both the state and the control variables are parameterized and approximated by truncated Gegenbauer expansion series with unknown Gegenbauer spectral coefficients. The time domain is discretized at the Gegenbauer-Gauss (GG) points. The integral operations are approximated using the optimal Gegenbauer operational matrices of integration known as the optimal Pmatrices (see appendix). The developed technique reduces the cost function, the dynamics, and the constraints into systems of algebraic equations; thus greatly simplifying the problem. In this manner, the infinite-dimensional OC problem is transcribed into a finite-dimensional NLP problem, which can be solved in the Gegenbauer spectral space using the well-developed NLP techniques and computer codes. The remaining of the article is organized as follows: in Section II we present the CTOCP statement. In Section III we introduce the Gegenbauer transcription method (GTM) for the solution of CTOCPs. Two numerical experiments are presented in Section IV to demonstrate the efficiency and

© 2012 Engineers Australia

the spectral accuracy of the proposed method followed by a discussion and some concluding remarks in Section V. A brief background on the Gegenbauer polynomials and their associated quadratures is provided in the appendix. II. THE OC PROBLEM STATEMENT Consider, without loss of generality, the following nonlinear CTOCP (P1 ) with fixed final time, mixed state-control path and terminal inequality constraints: Z 1 minimize J(u(t)) = Φ(x(1)) + L(x(τ ), u(τ ), τ )dτ 0

subject to x(t) ˙ = f (x(t), u(t), t),

(II.1a) (II.1b)

x(0) = x0 , ψi (x(t), u(t), t) ≤ 0, i = 0, . . . , `; φ(x(1), u(1)) ≤ 0.

(II.1c) (II.1d) (II.1e)

Problem (P1 ) is known as the Bolza problem, where [0, 1] is the time interval of interest, x : [0, 1] → Rn is the state vector, x˙ : [0, 1] → Rn is the vector of first-order time derivatives of the states, u : [0, 1] → Rm is the control vector, Φ : Rn → R is the terminal cost function, L : Rn × Rm × R → R is the Lagrangian function, f : Rn × Rm × R → Rn is a vector field, where each system function fi is continuously differentiable with respect to x, and is continuous with respect to u. Both functions Φ and L are continuously differentiable with respect to x; L is continuous with respect to u. J is the cost function to be minimized. Equations (II.1b) & (II.1c) represent the dynamics of the system and its initial state condition. ψi : Rn ×Rm ×R → R is an inequality constraint on the state and the control vectors for each i. φ : Rn ×Rm → R is a terminal inequality constraint on the state and the control vectors. We shall assume that for any admissible control trajectory u(t), the dynamical system has a unique state trajectory x(t). The goal of Problem (P1 ) is to determine the optimal admissible control policy u(t) in the time horizon [0, 1] such that J is minimized. In general, a CTOCP defined over the physical time domain [t0 , tf ] can be reformulated into the Bolza Problem (P1 ) using the strict change of variable t = (τ − t0 )/(tf − t0 ), where τ ∈ [t0 , tf ]; t0 and tf are the initial and final times, respectively. III. THE GTM In this section we shall describe a novel method for the numerical solution of nonlinear CTOCPs formulated in the preceding section based on GG collocation. The numerical scheme involves the approximation of the system dynamics, where it is necessary to approximate the derivatives of the state variables at the GG points. This can be accomplished through SDMs. Nevertheless, SDMs are known to be severely ill-conditioned [10]–[12], and their implementation causes degradation of the observed precision [13]. Moreover, it has been shown that the time step restrictions can be more severe than those predicted by the standard stability theory [14], [15]. For higher-order SDMs,

418

the ill-conditioning becomes very critical to the extent that developing efficient preconditioners is extremely crucial [11], [16]. Another approach is to transform the dynamical system into its integral formulation, where the state and the control variables are approximated by truncated spectral expansion series, while the integral operations are approximated by spectral integration matrices (SIMs). This numerical scheme is generally well-behaved and associated with many advantages: (i) SIMs are known to be well-conditioned operators [11], [12], [17]–[21]. (ii) The well-conditioning of SIMs is essentially unaffected for increasing number of grid points [19], [21]. (iii) Greengard and Rokhlin [22] showed that the integral equation formulation, when applied to twopoint boundary value problems (TPBVPs) for instance, is insensitive to boundary layers, insensitive to end-point singularities, and leads to small condition numbers while achieving high computational efficiency. (iv) The use of integration for constructing the spectral approximations improves the rate of convergence of the spectral interpolants, and allows the multiple boundary conditions to be incorporated more efficiently [19]–[21], [23]. These useful features in addition to the promising results obtained by Elgindy and Smith-Miles [20], [21] motivate us to apply the Gegenbauer integration scheme for approximating the underlying dynamical system of the CTOCP. Integrating Equation (II.1b) and using the initial condition (II.1c) recasts the dynamical system into its integral formulation given by Z t x(t) = f (x(τ ), u(τ ), τ )dτ + x0 . (III.1) 0

Equation (III.1) together with Equations (II.1a), (II.1d); (II.1e) represent the integral Bolza problem (P2 ). To approximate the CTOCP, we seek Gegenbauer polynomial expansions of the state and the control variables in the form xr (t) ≈ us (t) ≈

L X k=0 M X

(α)

(III.2a)

(α)

(III.2b)

ark Ck (t), r = 1, . . . , n, bsk Ck (t), s = 1, . . . , m,

k=0 (α)

(α)

and collocate at the GG points ti ∈ SN = {ti |CN +1 (ti ) = 0, i = 0, . . . , N }. Let tN +1 = 1, eˆl ∈ Rl+1 : (ˆ el )k = 1, zi0 j ∈ SN +1,MP , a = (a1 , . . . , an )T , b = (b1 , . . . , bm )T , ar = (ar0 , . . . , arL )T , bs = (bs0 , . . . , bsM )T , (α) (α) (α) (α) T ξl ∈ R(N +1)×(l+1) : (ξl )ik = (Ck (ti )), ξˆli ∈ (α) (α) (α) l+1 (N +2)×(Mp +1)×(l+1) ˆ R : (ξ )k = (ξ )ik , ζ ∈ R : li l l (α) (α) (α) T (ζl )i0 jk = (Ck (zi0 j )), ζˆli0 j ∈ Rl+1 (α) (ζl )i0 jk , r = 1, . . . , n; s = 1, . . . , m; i =

(α) : (ζˆli0 j )k = 0, . . ., N ; i0 = 0, . . . , N + 1; j = 0, . . . , MP ; k = 0, . . . , l; MP , l ∈ Z+ . Hence the state and the control vectors at the GG solution points can be written as (α)

x(ti ) ≈ (In ⊗ ξˆLi )a, (α) u(ti ) ≈ (Im ⊗ ξˆ )b, Mi

(III.3a) (III.3b)

where Il is the identity matrix of order l; ⊗ is the Kronecker product of matrices. Using Equation (V.4), we can show that x(1) = (In ⊗ eˆTL )a; u(1) = (Im ⊗ eˆTM )b. Hence the discrete approximation of the cost function can be represented by ˜ b) = Φ((In ⊗ eˆT )a) + P (1) L, ˆ J ≈ J(a, L N +1

(III.4)

ˆ j = L((In ⊗ ζˆ(α) where Lˆ ∈ RMP +1 : (L) L,N +1,j )a, (Im ⊗ (α) ˆ ζM,N +1,j )b, zN +1,j ); j = 0, . . . , MP . The discrete dynamical system at the GG grid points is given by

which minimizes the performance index Z T J= f (x(t), y(t))dt, subject to x(t) ˙ = V cos(γ(t)), y(t) ˙ = V sin(γ(t)), |γ(t)| ≤ π, V ∈ [V1 , V2 ], T ∈ [T1 , T2 ], (x(0), y(0)) = (−3, −4), (x(T ), y(T )) = (3, 3),

(α) (1) Hi (a, b) = (In ⊗ξˆLi )a−(In ⊗Pi )Fi −x0 ≈ 0, i = 0, . . . , N, where (III.5) where Fi = (F1i , . . . , Fni )T , Fri = (fri0 , . . . , friMP )T , f (x, y) = 4/((x + 1.3)2 + (y + 1.3)2 + 1) (α) (α) ˆ ˆ frij = fr ((In ⊗ ζLij )a, (Im ⊗ ζM ij )b, zij ), r = 1, . . . , n; i = + 2/((x − 1.9)2 + (y − 1.6)2 + 1) 0, . . . , N ; j = 0, . . . , MP . The discrete approximations of + 1/((x − 0.4)2 + (y − 0.1)2 + 1) the inequality constraints (II.1d) and the terminal constraint + 1/((x − 0.6)2 + (y − 0.1)2 + 0.5), (II.1e) become (α) (α) cij (a, b) = ψj ((In ⊗ ξˆLi )a, (Im ⊗ ξˆM i )b, ti ) ≤ 0, i = 0, . . . , N ; j = 0, . . . , `; (III.6)

ct (a, b) = φ((In ⊗ eˆTL )a, (Im ⊗ eˆTM )b) ≤ 0,

(III.7)

respectively. Hence the CTOCP (P1 ) is reduced to the following parameter NLP (P3 ): ˜ b) minimize J(a, (III.8a) subject to Hi (a, b) = 0, (III.8b) cij (a, b) ≤ 0, i = 0, . . . , N ; j = 0, . . . , `; (III.8c) ct (a, b) ≤ 0. (III.8d) Problem (P3 ) can be solved using well-developed optimization software for the Gegenbauer coefficients a; b. The state and the control variables can then be evaluated at the GG nodes using Equations (III.3a) & (III.3b). In fact, since the GTM solves the CTOCP (P1 ) in the spectral space, the approximation can immediately be evaluated at any time history of both the control and the state variables once the approximate spectral coefficients are found without invoking any interpolation method. This is a clear advantage over the “classical” discretization methods such as the finite difference schemes, which require a further step of interpolation to evaluate an approximation at an intermediate point. This useful feature establishes the power of the proposed GTM for solving CTOCPs as the optimal state and control profiles are readily determined.

IV. ILLUSTRATIVE NUMERICAL EXAMPLES Example 1 (The path planning in a threat environment): Consider the problem of determining the OC γ(t) ∈ C[0, T ]

419

(IV.1a)

0

(IV.1b) (IV.1c) (IV.1d) (IV.1e) (IV.1f) (IV.1g) (IV.1h)

(IV.1i)

V1 , V2 , T1 ; T2 are some real parameters such that V1 < V2 ; T1 < T2 . Example 1 was studied by Miller et al. [24], and serves as a model case for a CTOCP governed by a nonlinear dynamical system with boundary conditions and control constraints. The OC model asks for the optimal path planning in 2D for an unmanned aerial vehicle (UAV) mobilizing in a stationary risk environment. The control γ(t) is the yaw angle constrained by Inequality (IV.1d). The running cost f represents the hazard rate along the path (the stationary threats relief). T is a free variable and represents the flight time; V is a constant linear velocity satisfying Equation (IV.1e). A = (−3, −4); B = (3, 3) are the initial and terminal conditions, respectively. The nonlinearity of the dynamical system, the boundary conditions and the control path constraint represent a very challenging task and add more complexity both analytically and computationally. Therefore the implementation of efficient and advanced numerical discretization schemes is of utmost importance. Through the change of variable s = t/T , the CTOCP can be restated as follows: Z 1 minimize J = T f (˜ x(s), y˜(s))ds, (IV.2a) 0

subject to x ˜˙ (s) = T V cos(γ(sT )) = V˜ cos(˜ γ (s)), (IV.2b) ˙y˜(s) = T V sin(γ(sT )) = V˜ sin(˜ γ (s)), (IV.2c) |˜ γ (s)| ≤ π,

(IV.2d)

V˜ ∈ [V1 T, V2 T ],

(IV.2e)

(˜ x(0), y˜(0)) = (−3, −4),

(IV.2f)

(˜ x(1), y˜(1)) = (3, 3),

(IV.2g)

where x ˜(s) = x(sT ); y˜(s) = y(sT ). Hence if we consider the auxiliary cost function Z 1 J aux = J/T = f (˜ x(s), y˜(s))ds, (IV.3) 0

and the dynamical system equations (IV.2b) and (IV.2c) together with Conditions (IV.2d)-(IV.2g), then the cost function J and the auxiliary cost function J aux are related by [24]   1 aux ˜ ˜ min J(V, T, γ) = min min(V min J (V , γ˜ )) . γ ˜ V,T,γ V V V˜ (IV.4) Equations (IV.3), (IV.2b)-(IV.2g) represent the auxiliary 2D path planning problem (P4 ). Notice here that the velocity V may be viewed as an added control parameter influencing the values of the angular velocities in reasonable limits. The best path corresponding to the minimum risk value is the path corresponding to the minimum value of the product V˜ J aux . The optimal paths of the original problem are then obtained from the relations x(t) = x ˜(t/T ), y(t) = y˜(t/T ), γ(t) = γ˜ (t/T ), with T = V˜ /V ; min J = T min J aux . Using a penalization approach, Miller et al. [24] were able to recast the CTOCP into a TPBVP, which was solved numerically using MATLAB software. The reported risk integral value was found to be J = T J aux ≈ 3.1. The implementation of the GTM presented in Section III involves three main stages: (i) Recasting the dynamical system into its integral formulation given by Z s x ˜(s) = V˜ cos(˜ γ (τ ))dτ − 3; (IV.5a) Z0 s y˜(s) = V˜ sin(˜ γ (τ ))dτ − 4. (IV.5b) 0

(ii)

The approximation of the state and the control variables by the Gegenbauer expansion series x ˜(s) ≈ y˜(s) ≈ γ˜ (s) ≈

L X k=0 L X k=0 M X

Example 1

(α)

a1,k Ck (s),

(IV.6a)

(α)

a2,k Ck (s); (α)

bk Ck (s).

(IV.6b)

(IV.6c)

The discretization of the time domain at the GG (α) points si ∈ SN . The GTM then transcribes the CTOCP (P4 ) into the following parameter finite-dimensional NLP problem (P5 ): minimize J aux ≈

(1) PN +1 fˆ,

(IV.7a)

(α) (1) subject to (I2 ⊗ ξˆLi )a = V˜ (I2 ⊗Pi )=i −(3, 4)T , (IV.7b)

(I2 ⊗ eˆTL )a = 3ˆ e1 ,

(IV.7c)

(1) V˜ (I2 ⊗ PN +1 )=N +1 = (6, 7)T , ˆ(α) ξM i b ≤ π,

(IV.7d)

(α)

(IV.7e) (α)

where =i0 = (cos(χM i0 b), sin(χM i0 b))T , χM i0 (α) (α) R(MP +1)×(M +1) : (χM i0 )jk = (ζM )i0 jk , (fˆ)j (α) (α) 0 f (ζˆ a1 , ζˆ a2 ), i = 0, . . . , N + 1; i L,N +1,j

L = M = 8 at S8 (−0.2) L = M = 9 at S9 (−0.1) L = M = 10 at S8 (−0.4) L = M = 12 at S9

∈ = =

420

14.3768 14.3768 14.5610 14.3768

Present GTM J aux V˜ J aux 0.4115 0.4042 0.3972 0.4017

(M AE)BC

5.9164 7.1054 × 10−15 5.8108 4.4409 × 10−16 5.7839 4.4409 × 10−16 5.7750 8.88178 × 10−16

TABLE I T HE RESULTS OF THE PRESENT GTM FOR V = 2, VALUES OF

(iii)

L,N +1,j

V˜ (0.2)

k=0

(α)

0, . . . , N ; j = 0, . . . , MP ; k = 0, . . . , M . The reduced NLP (P5 ) can be solved for the Gegenbauer coefficients a1 = (a1,0 , . . . , a1,L )T , a2 = (a2,0 , . . . , a2,L )T ; b = (b0 , . . . , bM )T using the available powerful optimization methods. Our numerical results for V = 2 are shown in Table I, where all calculations were performed on a personal laptop with a 2.53 GHz Intel Core i5 CPU and 4G memory running MATLAB 7.10.0.499 (R2010a) software in double precision real arithmetic. The numerical experiments were implemented using MATLAB “fmincon” interior-point algorithm optimization solver with the solutions termination tolerance “TolX” = 10−15 . The P-matrix was constructed via Algorithm 2.2 given in [20] with MP = Mmax = 20. The average CPU time in 100 runs taken by the GTM using α = 0.2; N = L = M = 8 was found to be 2.09 seconds. The (M AE)BC was found to be 7.1054 × 10−15 , and the risk integral value J ≈ 2.96. The risk integral value J then decreases for increasing values of the parameters N, L, M , and some suitable values of α. For α = −0.4, N = 9; L = M = 12, the calculated risk integral value was found to be J ≈ 2.89. We notice that the approximate cost function values J obtained by the GTM are lower than the approximate value obtained in [24] for several values of α, N, L; M with very accurate constraints satisfaction. This shows the greater accuracy and efficiency of the proposed GTM developed in our research work. The OC plot is shown in Figure 1(a), and the optimal state trajectory is shown in Figure 1(b) and Figure 2. The latter manifests that the best path for the UAV through the risk environment is to move around the threats’ centers and mountain terrain.

α, N, L; M . (M AE)BC

T

J = T J aux

7.1884 7.1884 7.2805 7.1884

2.9582 2.9054 2.8919 2.8875

AND DIFFERENT

DENOTES THE MAXIMUM

ABSOLUTE ERROR AT THE BOUNDARY CONDITION

(IV.1 H ).

Example 2: Consider Example 1 with the following hazard relief function: f (x, y) = 1/(x2 + y 2 + 0.5) + 1/(x2 + (y − 4)2 + 1) + 2/((x − 2)2 + (y + 4)2 + 1). (IV.8) This example is similar to Example 1 with a change in the mountains terrain localization and their slopes, where the new threats’ centers are (0, 0)T , (0, 4)T ; (2, −4)T . The application of the GTM leads to the reduced NLP (P5 ). Table II shows the GTM results for different values of α, N, L; M . We notice here that the best results are reported at the GG (α) discretization points set SN for α < 0. The average CPU time in 100 runs using α = −0.1; N = L = M = 5 was found to be 0.7956 seconds. The (M AE)BC was found

(a)

Fig. 2. The figure shows the projected state trajectory in a black solid line along the 3D hazard relief. A0 ; B 0 denote the points (−3, −4, f (−3, −4)); (3, 3, f (3, 3)), respectively. The results are obtained (0.2) at S8 using L = M = 8.

(b) Fig. 1. The numerical experiments of the GTM on Example 1. Figure (a) shows the profile of the control history on the calculated flight time domain [0, 7.188]. Figure (b) shows the 2D state trajectory in the hazard (0.2) relief contour. The results are obtained at S8 using L = M = 8.

to be 4.885 × 10−15 , and the risk integral value J ≈ 1.44. Hence the adapted GTM for the solution of intricate CTOCPs reduces the required calculation time significantly while achieving very precise constraints satisfaction. The convergence of the GTM increases rapidly to the risk integral value J ≈ 1.42 for increasing number of the collocation points and the Gegenbauer expansion terms. The OC plot is shown in Figure 3(a), and the optimal state trajectory is shown in Figure 3(b) and Figure 4. In this example, the best path for the UAV through the risk environment is to move across the hazard mountains. Example 2 V˜ (−0.1) L = M = 5 at S5 (−0.4) L = M = 6 at S6 (−0.3) L = M = 8 at S8 (−0.4) L = M = 10 at S10

12.5351 13.2718 12.7193 11.9826

Present GTM J aux V˜ J aux 0.2296 0.2146 0.2239 0.2375

2.8782 2.8482 2.8476 2.8455

(M AE)BC 10−15

4.8850 × 2.0872 × 10−14 4.4409 × 10−16 8.8818 × 10−16

TABLE II T HE RESULTS OF THE PRESENT GTM FOR V = 2, VALUES OF α, N, L; M .

T

J = T J aux

6.2676 6.6359 6.3596 5.9913

1.4391 1.4241 1.4238 1.4227

AND DIFFERENT

V. DISCUSSION AND CONCLUSION The implementation of the GTM reveals many fruitful outcomes over the standard variational methods and direct

421

collocation methods. The proposed GTM neither requires the explicit derivation and construction of the necessary conditions nor the calculation of the gradients ∇x L of the Lagrangian function L(x(t), u(t), t) w.r.t. the state variables, yet it is able to produce rapid convergence and achieve high precision approximations. In contrast, the indirect method applied by Miller et al. [24] requires the explicit derivation of the adjoint equations, the control equations, and all of the transversality conditions. Moreover, the user must calculate the gradients ∇x L for the solution of the necessary conditions of optimality. This useful feature of the GTM inherited from the direct optimization methods represents a significant contribution over the standard variational methods. From another standpoint, since the optimal P-matrix is constant for a particular GG solution points set, the GTM can be quickly used to solve many practical trajectory optimization problems. Moreover, decreasing the values of the parameters MP ; Mmax required for the construction of the P-matrix via Algorithm 2.2 given in [20] can reduce the calculations time taken by the GTM for solving CTOCPs with a slight reduction in accuracy. For instance, in Example 1, the GTM implemented using MP = Mmax = 14, for α = −0.2; N = L = M = 8, produces the risk integral value J ≈ 3, which is close to the value of J obtained in the first row of Table I. The recorded average CPU time in 100 runs in this case was found to be 1.4976 seconds. Another notable advantage of the GTM is that the successive integrals of the Gegenbauer basis polynomials can be calculated exactly at the GG points through the optimal P-matrix; thus the numerical error arises due to the round-off errors and the fact that a finite number of the Gegenbauer basis polynomials are used to represent the state and the control variables. The GTM handles the system dynamics using SIMs celebrated for their stability and well-conditioning rather than SDMs which suffer from severe ill-conditioning, and are prone to large round-off errors.

(a)

Fig. 4. The figure shows the projected state trajectory in a black solid line along the 3D hazard relief. A0 ; B 0 denote the points (−3, −4, f (−3, −4)); (3, 3, f (3, 3)), respectively. The results are obtained (−0.1) at S5 using L = M = 5.

(b) Fig. 3. The numerical experiments of the GTM on Example 2. Figure (a) shows the profile of the control history on the calculated flight time domain [0, 6.268]. Figure (b) shows the 2D state trajectory in the hazard (−0.1) relief contour. The results are obtained at S5 using L = M = 5.

The GTM deals with the state and the control constraints smoothly; on the contrary, the presence of such constraints often presents a difficulty in front of the popular classical theoretical tools such as Pontryagin’s minimum principle and the Hamilton-Jacobi-Bellman equation. The GTM is significantly more accurate than other conventional direct local methods for smooth OC problems, enjoying the so called “spectral accuracy.” For the class of discontinuous/nonsmooth OC problems, the existence and convergence results of the similar approaches of direct pseudospectral methods have been investigated and proved in a number of articles, cf. [9], [25], [26], for instances, for studies on OC problems with discontinuous controller using Legendre polynomials. Here it is essential to acknowledge that the convergence rate of standard direct orthogonal collocation/pseudospectral methods applied for discontinuous/nonsmooth OC problems is not imposing as clearly observed for OC problems with smooth solutions. In fact, the superior accuracy of the GTM cannot be realized in the presence of discontinuities and/or nonsmoothness in the OC problem, or in its solutions, as the convergence rate grows slower in this case for increasing number of the GG collocation points and the Gegenbauer expansion terms. Some research studies in this area manifest that the accuracies of direct global collocation methods and direct local collocation methods become comparable for nonsmooth OC problems,

422

cf. [27]. To recover the exponential convergence property of the GTM in the latter case, the GTM can be applied within the framework of a semi-global approach. Here the OC problems can be divided into multiple-phases, which can be linked together via continuity conditions (linkage constraints) on the independent variable, the state, and the control. The GTM can then be applied globally within each phase. The reader may consult Ref. [28], for instance, for a similar practical implementation of this solution method. Another possible approach to accelerate the convergence rate of the GTM, and to recover the spectral accuracy, is to treat the GTM with an appropriate smoothing filter, cf. [29], for instance, for a parallel approach using a pseudospectral Legendre method. Other methods include the knotting techniques developed in [30], [31] for solving nonsmooth OC problems, where the dynamics are governed by controlled differential inclusions. The work introduced in this article represents a major advancement in the area of direct orthogonal collocation methods using Gegenbauer polynomials. The simplicity and efficiency of the GTM allow for the implementation of a rapid and accurate trajectory optimization. The developed GTM can be easily extended to higher dimensional OC problems under the same level of complexity, whereas the application of the variational methods leads to a TPBVP, which is rather unstable and hard to solve. Similar ideas to the one described in this paper can be applied on CTOCPs governed by integral equations or integro-differential equations; therefore, the GTM encompasses a wider range of OC problems over the standard direct optimization methods. In the numerical examples presented in this paper, the results clearly show that the Gegenbauer polynomials are very effective in direct optimization techniques for solving hard OC problems. The reported results seem to favour the discretization of CTOCPs at the GG points for negative values of the Gegenbauer parameter α; however, better approximations using the GTM are possible for different

choices of the GG discretization points. Further tests and analysis are necessary to investigate the stability, the accuracy, and the convergence of the method to the solution of CTOCPs. Finally, the present GTM offers many useful properties, and provides a strong addition to the arsenal of direct optimization methods.

B. The Optimal Gegenbauer Quadrature and Definite Integrals Approximations The method of establishing an optimal Gegenbauer quadrature was recently outlined by Elgindy and Smith-Miles [20] in the following theorem: Theorem 1 (The optimal Gegenbauer quadrature): Let

APPENDIX

i SN,M = {zi,k |CM +1 (zi,k ) = 0, i = 0, . . . , N ;

(α∗ )

k = 0, . . . , M },

A. Elementary Properties and Definitions (α) Cn (x), n

+

The Gegenbauer polynomial ∈ Z of degree n and associated with the real parameter α > −1/2 is a real-valued function, which appears as an eigensolution to the singular Sturm-Liouville problem in the finite domain [−1, 1] [32]: d (1 − dx

(α)

n!Γ(α + 12 ) (α− 12 ,α− 12 ) Pn (x), n = 0, 1, 2, . . . , Γ(n + α + 12 ) (V.2) (0) establish the following useful relations: Cn (x) = Tn (x), (1/2) (1) Cn (x) = Ln (x); Cn (x) = (1/(n + 1))Un (x), where 1 1 (α− ,α− 2 ) Pn 2 (x)

is the Jacobi polynomial of degree n and associated with the parameters α − 12 , α − 12 ; Ln (x) is the nth -degree Legendre polynomial, Tn (x) and Un (x) are the nth -degrees Chebyshev polynomials of the first and second kinds, respectively. The Gegenbauer polynomials constrained by standardization (V.2) are generated using the three-term recurrence relation (α) α)xCj (x)



(α) jCj−1 (x), j

≥ 1, (V.3) (α) (α) starting from C0 (x) = 1; C1 (x) = x. At the special values ±1, the Gegenbauer polynomials satisfy the relation = 2(j +

Cn(α) (±1) = (±1)n .

(V.4)

The Gegenbauer polynomials satisfy the orthogonality relation [20] Z 1 α− 1 (α) (1 − x2 ) 2 Cm (x)Cn(α) (x)dx = λ(α) (V.5) n δmn , −1

where λ(α) n =

22α−1 n!Γ2 (α + 12 ) ; (n + α)Γ(n + 2α)

KM +1 = 2M

(V.1)

Cn(α) (x) =

(α) 2α)Cj+1 (x)

xi

Z

dx

The weight function for the Gegenbauer polynomials is the even function (1 − x2 )α−1/2 . The form of the Gegenbauer polynomials is not unique, and depends on a certain standardization. The Gegenbauer polynomials standardized by Doha [33] so that

(V.6)

δmn is the Kronecker delta function. The interested reader may further pursue more information about the class of the Gegenbauer polynomials in many useful textbooks and monographs, cf. [32], [34], for instances.

423

(V.8)

α>−1/2

−1

= 0.

are the

2 αi∗ = argmin ηi,M (α),

(α) 1 dCn (x) x2 )α+ 2

+ n(n + 2α)(1 −

(j +

be the generalized/adjoint GG points set, where optimal Gegenbauer parameters in the sense that

ηi,M (α) =

1 x2 )α− 2 Cn(α) (x)

(V.7) αi∗

(α)

(α)

CM +1 (x)dx/KM +1 ;

(V.9)

Γ(M + α + 1)Γ(2α + 1) . Γ(M + 2α + 1)Γ(α + 1)

(V.10)

Moreover, let f (x) ∈ C ∞ [−1, 1] be approximated by the Gegenbauer polynomials expansion series such that the Gegenbauer coefficients are computed by interpolating the function f (x) at the adjoint GG points zi,k ∈ SN,M . Then (1) there exist a matrix P (1) = (pij ), i = 0, . . . , N ; j = 0, . . . , M ; some numbers ξi ∈ [−1, 1] satisfying Z xi M X (α∗ ) (1) f (x)dx = pik (αi∗ )f (zi,k ) + EM i (xi , ξi ), (V.11) −1

k=0

where (1)

pik (αi∗ ) =

M X

−1 (α∗ i)

(λj

)

(α∗ i)

ωk

(α∗ i)

Cj

Z

xi

(zi,k ) −1

j=0

(α∗ i)

Cj

(x)dx, (V.12)

(α∗ ) (ωk i )−1

=

M X

2 (α∗ ) −1 (α∗ ) (λj i ) (Cj i (zi,k )) ,

(V.13)

j=0 ∗

(α∗ ) λj i (α∗ )

22αi −1 j!Γ2 (αi∗ + 12 ) = ; (j + αi∗ )Γ(j + 2αi∗ )

EM i (xi , ξi ) =

f (M +1) (ξi ) ηi,M (αi∗ ). (M + 1)!

(V.14) (V.15)

Proof: see [20]. The matrix P (1) is the 1st-order optimal Gegenbauer integration matrix, and is referred to by the optimal P-matrix. To R xi describe the approximations of the definite integrals f (x)dx of f (x) in matrix form using the P-matrix, let −1 (1) (1) (1) (1) (1) (1) (1) (1) P = (P0 P1 . . . PN )T , Pi = (pi,0 , pi,1 , . . . pi,M ); i = 0, . . . , N. Let also V be a matrix of size (M + 1) × (N + 1) defined as V = (V0 V1 . . . VN ), Vi = (f (zi,0 ), f (zi,1 ), . . .,f (zi,M ))T , i = 0, . . . , N ; f (zij ) is the function f calculated at the adjoint GG nodes zi,j R x ∈ SN,M . Then the approximations of the definite integrals −1i f (x)dx of f (x) using the P-matrix are given by Z x0 T Z x1 Z xN f (x)dx, f (x)dx, . . . , f (x)dx −1

−1

≈ P (1) ◦ V T ,

−1

(V.16)

where ◦ is the Hadamard product, with the elements of P (1) ◦ V T given by (1)

(P (1) ◦ V T )i = Pi

· Vi =

M X

(1)

pi,j f (zi,j ), i = 0, . . . , N.

j=0

(V.17) The reader may consult [20], [21] for further information on the developed Gegenbauer quadrature and its applications. R EFERENCES [1] D. P. Bertsekas, Dynamic Programming and Optimal Control, 3rd ed., ser. Athena Scientific optimization and computation series. Athena Scientific, 2005, vol. I. [2] Q. Gong, W. Kang, and I. M. Ross, “A pseudospectral method for the optimal control of constrained feedback linearizable systems,” IEEE Transactions on Automatic Control, vol. 51, no. 7, pp. 1115–1129, July 2006. [3] Q. Gong, I. M. Ross, W. Kang, and F. Fahroo, “Connections between the covector mapping theorem and convergence of pseudospectral methods for optimal control,” Comput Optim Appl, vol. 41, pp. 307– 335, 2008. [4] J. S. Hesthaven, S. Gottlieb, and D. Gottlieb, Spectral Methods for Time-Dependent Problems. Cambridge University Press, 2007. [5] J. T. Betts, Practical Methods for Optimal Control and Estimation Using Nonlinear Programming, 2nd ed., ser. Advances in Design and Control. Philadelphia: SIAM, December 2009, no. 19. [6] G. Elnagar, M. Kazemi, and M. Razzaghi, “The pseudospectral Legendre method for discretizing optimal control problems,” IEEE Transactions on Automatic Control, vol. 40, no. 10, pp. 1793–1796, 1995. [7] F. Fahroo and I. M. Ross, “Pseudospectral methods for infinitehorizon optimal control problems,” Journal of Guidance, Control, and Dynamics, vol. 31, no. 4, pp. 927–936, 2008. [8] D. Garg, W. W. Hager, and A. V. Rao, “Pseudospectral methods for solving infinite-horizon optimal control problems,” Automatica, vol. 47, no. 4, pp. 829–837, 2011. [9] W. Kang, I. M. Ross, and Q. Gong, “Pseudospectral optimal control and its convergence theorems,” in Analysis and Design of Nonlinear Control Systems, A. Astolfi and L. Marconi, Eds. Springer Berlin Heidelberg, 2008, pp. 109–124. [10] D. Funaro, “A preconditioning matrix for the Chebyshev differencing operator,” SIAM J. Numer. Anal., vol. 24, no. 5, pp. 1024–1031, 1987. [11] E. M. E. Elbarbary, “Integration preconditioning matrix for ultraspherical pseudospectral operators,” SIAM J. Sci. Comput., vol. 28, no. 3, pp. 1186–1201, 2006. [12] ——, “Pseudospectral integration matrix and boundary value problems,” International Journal of Computer Mathematics, vol. 84, no. 12, pp. 1851–1861, 2007. [13] T. Tang and M. R. Trummer, “Boundary layer resolving pseudospectral methods for singular perturbation problems,” SIAM J. Sci. Comput., vol. 17, no. 2, pp. 430–438, 1996. [14] L. N. Trefethen and M. R. Trummer, “An instability phenomenon in spectral methods,” SIAM J. Numer. Anal., vol. 24, no. 5, pp. 1008– 1023, 1987. [15] L. N. Trefethen, “Lax-stability vs. eigenvalue stability of spectral methods,” in Numerical Methods for Fluid Dynamics III, K. W. Morton and M. J. Baines, Eds. England; United Kingdom: Clarendon Press, 1988, pp. 237–253. [16] J. S. Hesthaven, “Integration preconditioning of pseudospectral operators. I. Basic linear operators,” SIAM J. Numer. Anal., vol. 35, no. 4, pp. 1571–1593, 1998. [17] L. Greengard, “Spectral integration and two-point boundary value problems,” SIAM J. Numer. Anal., vol. 28, no. 4, pp. 1071–1080, 1991. [18] A. Lundbladh, D. S. Henningson, and A. V. Johansson, “An efficient spectral integration method for the solution of the Navier Stokes equations,” Aeronautical Research Institute of Sweden, Bromma, Technical Report FFA TN 1992-28, 1992. [19] K. T. Elgindy, “Generation of higher order pseudospectral integration matrices,” Applied Mathematics and Computation, vol. 209, no. 2, pp. 153–161, March 2009. [20] K. T. Elgindy and K. A. Smith-Miles, “Optimal Gegenbauer quadrature over arbitrary integration nodes,” Submitted for publication, 2012.

424

[21] ——, “Solving boundary value problems, integral, and integrodifferential equations using Gegenbauer integration matrices,” Journal of Computational and Applied Mathematics, vol. 237, no. 1, pp. 307– 325, 2013. [22] L. Greengard and V. Rokhlin, “On the numerical solution of two-point boundary value problems,” Communications on Pure and Applied Mathematics, vol. 44, no. 4, pp. 419–452, 1991. [23] N. Mai-Duy and R. I. Tanner, “A spectral collocation method based on integrated Chebyshev polynomials for two-dimensional biharmonic boundary-value problems,” Journal of Computational and Applied Mathematics, vol. 201, no. 1, pp. 30–47, 1 April 2007. [24] B. Miller, K. Stepanyan, A. Miller, and M. Andreev, “3D Path Planning in a Threat Environment,” in 50th IEEE Conference on Decision and Control and European Control Conference (CDC-ECC), Orlando, FL, USA, December 12–15 2011, pp. 6864–6869. [25] W. Kang, Q. Gong, and I. M. Ross, “Convergence of pseudospectral methods for a class of discontinuous optimal control,” in Decision and Control, 2005 and 2005 European Control Conference. CDC-ECC ’05. 44th IEEE Conference on, December 2005, pp. 2799–2804. [26] W. Kang, Q. Gong, I. M. Ross, and F. Fahroo, “On the convergence of nonlinear optimal control using pseudospectral methods for feedback linearizable systems,” Int. J. Robust Nonlinear Control, vol. 17, no. 14, pp. 1251–1277, 2007. [27] G. T. Huntington, “Advancement and analysis of a Gauss pseudospectral transcription for optimal control problems,” Ph.D. dissertation, Department of Aeronautics and Astronautics. Massachusetts Institute of Technology, June 2007. [28] A. Rao, “Extension of a pseudospectral Legendre method to nonsequential multiple-phase optimal control problems,” in AIAA Guidance, Navigation, and Control Conference and Exhibit, Austin, TX, August 11–14 2003. [29] G. N. Elnagar and M. A. Kazemi, “Pseudospectral Legendre-based optimal computation of nonlinear constrained variational problems,” Journal of Computational and Applied Mathematics, vol. 88, no. 2, pp. 363–375, 1998. [30] I. M. Ross and F. Fahroo, “A direct method for solving nonsmooth optimal control problems,” in Proceedings of the 15th World Congress of the International Federation of Automatic Control, Barcelona, Spain, July 21–26 2002. [31] ——, “Pseudospectral knotting methods for solving nonsmooth optimal control problems,” Journal of Guidance Control and Dynamics, vol. 27, no. 3, pp. 397–405, 2004. [32] G. Szeg¨o, Orthogonal Polynomials, 4th ed. AMS Coll. Publ., 1975. [33] E. H. Doha, “An accurate solution of parabolic equations by expansion in ultraspherical polynomials,” Computers Math. Applic., vol. 19, no. 4, pp. 75–88, 1990. [34] M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions. Dover, 1965.