JOURNAL OF GUIDANCE, CONTROL, AND DYNAMICSVol. 25, No. 1, January– February 2002                     Direct Trajectory Opt...
FAHROO AND ROSS                                                                        161Aside from their popularity in e...
162                                                                                FAHROO AND ROSSwhere, for j D 0; 1; : :...
FAHROO AND ROSS                                                                      163For N odd, the weights are given b...
164                                                                 FAHROO AND ROSS                                       ...
FAHROO AND ROSS                                                                                   165                     ...
166                                                                   FAHROO AND ROSS   5 von Stryk, O., “Numerical Soluti...
Upcoming SlideShare
Loading in …5
×

Direct trajectory optimization by a chebyshev pseudospectral method

829
-1

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
829
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Direct trajectory optimization by a chebyshev pseudospectral method

  1. 1. JOURNAL OF GUIDANCE, CONTROL, AND DYNAMICSVol. 25, No. 1, January– February 2002 Direct Trajectory Optimization by a Chebyshev Pseudospectral Method Fariba Fahroo¤ and I. Michael Ross† Naval Postgraduate School, Monterey, California 93943 We present a Chebyshev pseudospectral method for directly solving a generic Bolza optimal control problem with state and control constraints. This method employs Nth-degree Lagrange polynomial approximationsfor the state and control variables with the values of these variables at the Chebyshev– Gauss– Lobatto (CGL) points as the expansion coef cients. This process yields a nonlinear programming problem (NLP) with the state and control values at the CGL points as unknown NLP parameters. Numerical examples demonstrate that this method yields more accurate results than those obtained from the traditional collocation methods. I. Introduction cients. When the properties of the Chebyshev polynomials are used,I N recent years, direct solution methods have been used exten- the state equations,performanceindex, and the boundary conditions sively in a variety of trajectory optimization problems.1;2 Their are converted to algebraic or transcendental equations in terms ofadvantage over indirect methods, which rely on solving the nec- these unknown coef cients. In this manner, conversion of the orig-essary conditions derived from the Pontryagin et al. minimum inal optimal control problem to an NLP is achieved.principle,3 is that direct method algorithms have better convergence Recently, Elnagar et al.8 and Fahroo and Ross9;12;13 have usedproperties.In addition,because the necessaryconditionsdo not have the idea of expansion of the state and control variables in termsto be derived, the direct methods can be quickly used to solve a num- of Lagrange polynomials at suitably chosen points, the Legendre–ber of practical trajectory optimization problems. Gauss– Lobatto (LGL) nodes. This idea is the basis for pseudospec- Direct methods are based on discretizing the control time his- tral methods, which are used extensivelyfor solving uid dynamicstory and/or state variable time history at the nodes of discretization, problems.14;15 In approximatingoptimal control problems, with thistransforming the optimal control problem to a nonlinear program- choice of node points and properties of the Lagrange polynomials,ming problem (NLP), and then solving the resulting NLP. In direct the state equations and the possible state and control constraints arecollocation schemes, which discretize both the control and state readily transformed to algebraic equations in terms of values of thevariables, the unknowns are the values of the controls and the states state and control variables at the nodes. Differential constraints areat these nodes. The cost function and the state equations can be ex- imposed only at the LGL points by way of a differentiation opera-pressed in terms of these values. An interpolation scheme is used tor (matrix). In this sense, the pseudospectral methods are differentto obtain the time histories of both the control and the state vari- from other collocation schemes,1;2;4 where higher-order numericalables. In the traditional collocation schemes, piecewise-continuous integration techniques are used to approximate the differential con-polynomials such as linear or cubic splines are used as the inter- straints not only at the nodes but at points in between (midpoints,polating polynomials over each time segment.4;5 Satisfaction of the for example, as in Hermite– Simpson).state differential equations is achieved by using some form of inte- In this paper, we present a Chebyshev pseudospectral methodgration scheme over each subinterval, which results in formulation and consider differential constraints given in terms of controlledof defects. One of the popular schemes is the Hermite– Simpson differentialinclusions,differential algebraic equations (DAEs), andrule, which amounts to Simpson’s quadrature rule over the subin- ordinarydifferentialequations(ODEs). Our method applies withouttervals (see Ref. 4). Recently, Gauss– Lobatto quadrature rules such change to all of these types of constraints and, thus, encompasses aas trapezoidal, Simpson’s, or higher-order rules with Jacobi poly- wider range of problems than the usual collocation methods. Notenomials as the interpolant have also been used for collocation (see that, while revising this paper, the parallel work of Elnagar andRefs. 6 and 7). Razzaghi16 came to our attention. We pay homage to their work In literature,the choice of polynomialspace for expansionof state and cite some key differences. The authors of Ref. 16 also proposeand control variables is not limited to piecewise-continuouspolyno- a Chebyshev pseuodospectral method for solving a variety of op-mials and in fact globally orthogonalpolynomials such as Legendre timal control problems. One major difference between their workand Chebyshev polynomials or Lagrange interpolatingpolynomials and ours is the way the integral cost function is approximated.Theyhave been used for approximating the control and state variables in employ a cell-averaging technique, whereas we use the Clenshaw–nonlinear optimal control problems.8¡11 In general, there are two Curtis quadrature scheme (see Refs. 17 and 18) for discretizing theways to construct a polynomial approximation to the solution y.t /: cost function. The focus of their paper is mostly on handling theOne is to use an interpolatingpolynomialbetween the values y.t j / at discontinuousfunctions, which indeed establishes and validates thesome points t j : The other is to use a series expansion in terms of or- power and range of applicability of pseudospectral methods to op-thogonal polynomials. In Refs. 10 and 11, the latter idea is pursued, timal control problems with discontinuous controls. In our effort toand both the states and the controlvariablesare expandedin terms of show the power of pseudospectral methods, we apply it to a moreChebyshev polynomials with unknown generalized Fourier coef - general class of problems including DAEs and differential inclu- sions. Thus, in this sense, our paper is complementary to that of Received 24 July 2000; revision received 17 May 2001; accepted for Ref. 16. It should be noted that an earlier version of this presentpublication 22 May 2001. This material is declared a work of the U.S. paper appeared in Ref. 19.Government and is not subject to copyright protection in the United States. One notable advantage of using Chebyshev pseudospectralCopies of this paper may be made for personal or internal use, on condition method over other direct collocation methods is the high degree ofthat the copier pay the $10.00 per-copy fee to the Copyright ClearanceCenter, Inc., 222 Rosewood Drive, Danvers, MA 01923; include the code accuracythat pseudospectralapproximationsoffer.17 One reason for0731-5090/02 $10.00 in correspondence with the CCC. this is the choice of node points as the Chebyshev– Gauss– Lobatto ¤ Associate Professor, Department of Mathematics, Code MA/Ff; (CGL) points that result in interpolatingpolynomialsthat are closestffahroo@nps.navy.mil. Senior Member AIAA. to the optimal polynomial in the max-norm approximation of any † Associate Professor, Department of Aeronautics and Astronautics, Code function. Also the derivatives of these interpolating polynomialsAA/Ro; imross@nps.navy.mil. Associate Fellow AIAA. can be calculated exactly at these nodes by a differentiation matrix. 160
  2. 2. FAHROO AND ROSS 161Aside from their popularity in engineering applications,Chebyshev µ ¶ 2polynomials have the added computational advantage in that their fl · f x.t /; x.t /; u.t /; ¿ .t/ · fu P (10)corresponding CGL points can be evaluated in closed form. Thus, ¿ f ¡ ¿0the Chebyshev pseudospectralmethod offers the possibility of rapid (11) Ãl · Ã[x.¡1/; x.1/; ¿ f ¡ ¿0 ] · Ãutrajectory optimization because it does not require the use of ad-vanced numerical linear algebra techniques that are necessary for gl · g[u.t /; x.t/; ¿ .t/] · gu (12)the calculation of LGL points and weights.20 In the three numeri-cal examples presented in this paper, the results clearly show that To re ect transformation of the time domain, one must use differ-Chebyshev polynomials are very effective in direct optimization ent symbols. However, for the purpose of brevity we retain thesetechniques and offer superior results to those of the existing collo- symbols. Thus, in this context, one must view x.t /; for example, ascation methods. x[¿ .t/] D xf[.¿ f ¡ ¿0 /t C .¿ f C ¿0 /]=2g II. Problem Formulation Consider the following optimal control problem. Determine the III. Chebyshev Pseudospectral Methodcontrol function u.¢/ and the correspondingstate trajectory x.¢/ that The Chebyshev pseudospectral method is one special case of aminimize the Bolza cost function: more general class of spectral methods.15 The basic formulation Z ¿f of these methods involves two essential steps: One is to choose aJ [x.¢/; u.¢/; ¿ f ] D M[x.¿ f /; ¿ f ] C L[x.¿ /; u.¿ /; ¿ ] d¿ (1) nite-dimensional space (usually a polynomial space) from which ¿0 an approximationto the solution of the differentialequationis made. The other step is to choose a projection operator, which imposes thewhere ¿ 2 R, x 2 R n , u 2 R m , M : R n £ R ! R, and L : R n £ R m £ differential equation in the nite-dimensional space. One impor-R ! R. We assume the dynamic constraints to be given by the tant feature of spectral methods, which distinguishes them fromfollowing system of controlled differential inclusions: nite element or nite difference methods, is that the underlying fl · f [P .¿ /; x.¿ /; u.¿ /; ¿ ] · fu ; x ¿ 2 [¿0 ; ¿ f ] (2) polynomial space is spanned by orthogonal polynomials that are in nitely differentiableglobal functions. Among examples of thesewhere f : R n £ R n £ R m £ R ! R n : This formulation generalizes orthogonalpolynomials are Legendre and Chebyshev polynomials,and uni es much of the previous apparently distinct formula- which are orthogonal on the interval [¡1; 1]; with respect to an ap-tions.7;21 For example, if we set the lower and upper bounds equal propriate weight function [w.t / D 1 for Legendre polynomials, and pto zero, we get a controlled DAE, w.t/ D 1= .1 ¡ t 2 / for Chebyshev polynomials of the rst kind]. In pseudospectral methods, the functions are expanded in terms of f [P .¿ /; x.¿ /; u.¿ /; ¿ ] D 0; x ¿ 2 [¿0 ; ¿ f ] (3) interpolating polynomials so that the expansion coef cients are the values of the functionat the node points. Because an arbitrarychoiceIf, in addition, we assume that the Jacobian @f =@ x is nonsingular, P of node points can give very poor results in interpolation, differentthen Eq. (3) may be reduced to a controlled ODE, Gauss quadrature points are chosen to give the best accuracy in x.¿ / D f [x.¿ /; u.¿ /; ¿ ]; P ¿ 2 [¿0 ; ¿ f ] (4) interpolation of a function. The derivatives of these interpolating polynomials at these node points are given exactly by a differenti-Furthermore, for u 2 U , the following hodograph transformation ation matrix. These two important aspects (choice of interpolatingmay be used to transform the controlled ODE to an ordinary differ- polynomials as the trial functions and Gauss quadrature points) ofential inclusion: pseudospectral methods separate them from the other collocation methods. In the Chebyshev pseudospectral method, the interpola-Px.¿ / 2 f y.¿ / j y.¿ / D f[x.¿ /; u.¿ /; ¿ ]; u 2 U g; ¿ 2 [¿0 ; ¿ f ] tion points are given in closed form, (5) tk D cos.¼ k = N /; k D 0; : : : ; N (13)We elaborateon these formulations further in the numerical section.In addition, we assume the boundary conditions to be given by the These points lie in the interval [¡1; 1] and are the extrema of therelations N th-order Chebyshev polynomial TN .t /. The j th-order Chebyshev (6) polynomial is expressed by Ãl · Ã[x.¿0 /; x.¿ f /; .¿ f ¡ ¿0 /] · à uwhere à : Rn£ Rn £R! Rp and Ãl and à u 2 Rp are constantvec- T j .t / D cos. j cos¡1 t /; j D 0; : : : ; N (14)tors representing the lower and upper bounds of these inequalities.Possible state and control constraints are formulated as mixed con- which yieldsstraints, T j .tk / D cos.¼ k j = N / gl · g[x.¿ /; u.¿ /; ¿ ] · gu ; g : Rn £ R m £ R ! Rr (7) Thus, T0 .t / D 1; T1 .t / D t; T2 .t / D 2t 2 ¡ 1; T3 .t / D 4t 3 ¡ 3t , andwhere gl and gu 2 R r denote the lower and upper bounds of g. so on. These node points have the distribution property that theyClearly, an equality constraint may be obtained by simply setting cluster around the endpoints of the interval. This clustering resultsthe lower and upper bounds to be equal.Thus, this formulationis not in avoidance of the Runge phenomenon, which is the divergence atonly more general, but is also more elegant than the one that sepa- the endpointsof interpolationon equispacedinterpolationpoints. Inrately identi es equality and inequality constraintson the states and fact, it has been shown that interpolationat the CGL nodes gives thecontrol variables. closest result to the optimal polynomial approximation to a given In the numerical approximation of the optimal control problem, function. This slight error from optimality is given by the Lebesguebecause the node points (CGL) lie in the computational interval constant, which is the smallest for the CGL nodes distribution (see[¡1; 1]; the problem is transformed to this interval by the linear Ref. 17).transformation for t 2 [t0 ; t N ] D [¡1; 1]: For approximatingthe continuousequations,we seek polynomial approximations of the form ¿ D [.¿ f ¡ ¿0 /t C .¿ f C ¿0 /]=2 (8) X Nresulting in the following reformulationof Eqs. (1), (2), (6), and (7): x N .t/ D x j Á j .t / (15) jD0J [x.¢/; u.¢/; ¿ f ] D M[x.1/; ¿ f ] ´Z 1 X N ¿ f ¡ ¿0 u N .t/ D u j Á j .t / (16) C L[x.t /; u.t /; ¿ .t/] dt (9) 2 ¡1 jD0
  3. 3. 162 FAHROO AND ROSSwhere, for j D 0; 1; : : : ; N , For the off-diagonal elements, from Eq. (20) we can easily see that ´ .¡1/ j C1 t2P .1 ¡ / TN .t/ ck .¡1/ j C k ck .¡1/ j C k Á j .t/ D Dk j D D N 2c j t ¡ tj c j tk ¡ t j cj .¡t N ¡ k / ¡ .¡t N ¡ j /are the Lagrange interpolating polynomials of order N (see the Ap- ´ ck .¡1/ j C k Qpendix for a derivation), with D D ¡ Dk j (22) » cj ¡.tk ¡ tQj / Q 2; j D 0; N cj D Therefore, we have 1; 1· j · N ¡1 Q Dk j D ¡Dk j (23)From its interpolating property, the Lagrange polynomials satisfythe condition Additionally,the original matrix D has another symmetry property, » 1; if j Dk which can be easily shown by the preceding relationships22 : Á j .tk / D ± jk D 0; if j 6D k Dk j D ¡D N ¡ k;N ¡ j (24)Hence, it follows that Using Eqs. (23) and (24) and denoting the values of the approximate x N .tk / D xk ; u N .tk / D uk (17) states at the sorted CGL points by In other words, the node points are the interpolating points. To x N ¡ k D x N .t N ¡ k / D x N .tQk / D xk Q Qexpress the derivative x N .t/ in terms of x N .t/ at the node points tk ; Pwe differentiate Eq. (15), which results in a matrix multiplicationof we havethe following form14;15 : X N X N X N X N x N .tk / D P Dk j x N .t j / D Q Q PN D N ¡ k;N ¡ j x N .tQN ¡ j / D x .tQN ¡ k / Q P N dk D x .tk / D P x j Á j .tk / D Dk j x j (18) jD0 jD0 j D0 j D0 (25) or more succinctly, we havewhere Dk j are entries of the .N C 1/ £ .N C 1/ differentiation ma-trix D P PN dk D x N .tk / D x .tQN ¡ k / Q (26) 8 £ ¯ ¤ jCk >.ck =c j / .¡1/ > ¯ ¡ .tk ¡ t j / ; j 6D k This result shows that the sorting of the CGL points does not affect > < ¢ 2 ¡tk 2 1 ¡ tk ; 1· j Dk · N ¡1 the underlying de nitions and formulation of the pseudospectralD :D [Dk j ] :D method. One can now proceed with the formulation of the NLP >.2N 2 C 1/=6; > j DkD0 > : with the sorted CGL points. In the formulation to come, we drop ¡.2N 2 C 1/=6; jDkDN the tilde notation with the understanding that the sorted points are used as the node points in the differentiation matrix and elsewhere. (19)Multiplication by this matrix, transforms a vector of the state vari- B. NLP Formulationables at the CGL points to the vector of approximate derivatives at The state equationsand the initialand terminalstate conditionsarethese points. discretized by rst substituting Eqs. (15), (16), and (18) in Eq. (10) and collocating at the CGL nodes tk , The state equations are trans-A. Modi cation of the Chebyshev Differentiation Matrix formed into the following algebraic inequalities: The de nitions of the CGL points and the given differentiationmatrix are the standardones in the literatureon spectralmethods.15;17 fl · f [2=.¿ f ¡ ¿0 / dk ; xk ; uk ; ¿k ] · fu ; k D 0; : : : ; NHowever, in our implementation of this method for discretizing op-timal control problems, it is more convenient to modify these def- where dk is as de ned in Eq. (26). The initial and terminal stateinitions. The CGL points as de ned by Eq. (13) are from 1 to ¡1, conditions are given bythat is, the initial point is 1 and the nal point is ¡1. For trajec-tory optimization problems, it is more convenient to take the ini- Ãl · Ã[x0 ; x N ; .¿ f ¡ ¿0 /] · Ã utial point at ¡1 and the nal point at 1. This sorting modi es thede nition of the differentiation matrix in the following sense: Us- The control inequality constraints are approximated bying the de nition of Eq. (19), we will show that the new matrix with gl · g.xk ; uk ; ¿k / · gu Qthe sorted points, D is of the opposite sign of the matrix with theunsorted points, D. To see this, note that in the de nition of ma- Next, the cost function in Eq. (9) is discretized: We use thetrix D, the points t0 D 1; t1 ; : : : ; t N ¡ 1 ; t N D ¡1 are used, and for Clenshaw– Curtis quadrature scheme (see Ref. 17, chapter 12) to Qmatrix D, the sorted points tQ0 D ¡1; : : : ; tQN D 1; are used, that is, discretize the integral part of the cost function to a nite sum. Thet N ¡ k D tQk ; k D 0; : : : ; N . For the CGL points, we have the following idea is based on nding optimal weights wk for a given set of CGLsymmetry relationship: points tk such that the approximation tk D ¡t N ¡ k D ¡tQk (20) Z 1 X N p.t / dt D p.tk /wk ; p.t / 2 P Nwhich yields ¡1 kD0 tk ¡ t j D ¡.t N ¡ k ¡ t N ¡ j / D ¡.tQk ¡ tQj / for P N ; the space of polynomials of degree ·N , is exact. For NFor the elements D00 and D NN ; it can be easily shown that even, the weights are17;18 Q D00 D D NN D ¡D00 ; Q D NN D D00 D ¡D NN 1 w0 D w N D (27) N2 ¡ 1 2 For the other diagonal elements, Dkk D ¡tk 2.1 ¡ tk /, = from N =2 00Eq. (20) we have 4X 1 2¼ j s N ws D w N ¡ s D cos ; s D 1; : : : ; tN ¡ k Q t N 1 ¡4j 2 N 2 j D0 Dkk D ¡ ¢ D ¡ k 2 ¢ D ¡ Dkk Q (21) 2 2 1 ¡ tN ¡ k 2 1 ¡ tQk (28)
  4. 4. FAHROO AND ROSS 163For N odd, the weights are given by17 Table 1 Comparison of cost functions for various methods à and formulations for N = 11 1w0 D w N D 2 (29) Method Ji j Ji ¡ Jana j Np N 00 Analytic solution 1.253314 4 X .N ¡ 1/=2 Collocation (Simpson) 1.253005 0.000309 34 1 2¼ j sws D w N ¡ s D cos Collocation ( fth-degree GL) 1.253183 0.000131 84 N 1 ¡ 4 j2 N Pseudospectral (CGL) 1.253309 0.000005 34 jD0 Pseudospectral (DAE) 1.253366 0.000052 23 N ¡1 (30) s D 1; : : : ; 2In the preceding summations, the double prime means that the rst Let X , Y , and 2 representthe solution vectorto this problemat theand the last elements have to be halved. CGL nodes. Then the NLP for this problem is simply to minimize Therefore, the cost function in terms of the coef cients ¿ f subject to the equality constraints p X D .x0 ; x1 ; : : : ; x N /; U D .u0 ; u1 ; : : : ; u N / .2=¿ f /D ¤ X ¡ 2gY cos 2 D 0 (39) pcan be discretized as .2=¿ f /D ¤ Y ¡ 2gY sin 2 D 0 (40) ¿ f ¡ ¿0 X N and J .X; U; ¿ f / ¼ M.x N ; ¿ f / C L.xk ; uk ; ¿k /wk (31) 2 k D0 X .0/ D Y .0/ D 0; X .N / ¡ 0:5 D 0 Thus, the optimal control problemin Eqs. (9– 12) is approximated All operations in the preceding equations are array operations, thatby the following nonlinear optimization problem: Find coef cients is, term-by-term,whereas the asteriskis used to denote matrix multi- plication. With this notation, the striking resemblance of the NLP to X D .x0 ; x1 ; : : : ; x N /; U D .u0 ; u1 ; : : : ; u N / the originalproblemis immediately apparent.The analyticsolutions to this problem are the equations of a cycloid,and possibly the nal time ¿ f to minimize x.¿ / D .g¿ f =¼ /f¿ ¡ .¿ f =¼ / sin[¼.1 ¡ ¿ =¿ f /]g (41) ¿ f ¡ ¿0 X N ¡ ¯ ¢ J N .X; U; ¿ f / D M.x N ; ¿ f / C L.xk ; uk ; ¿k /wk y.¿ / D 2g¿ 2 ¼ 2 cos2 [.¼ =2/.1 ¡ ¿ =¿ f /] (42) 2 kD0 f (32) The optimal control (angle) is given by the following expression:subject to (43) µ .¿ / D .¼ =2/.1 ¡ ¿ =¿ f / fl · f[2=.¿ f ¡ ¿0 /dk ; xk ; uk ; ¿k ] · fu ; k D 0; : : : ; N (33) From x.¿ f / D 0:5; Eq. (41), and g D 1, the minimum time calculated p gl · g.xk ; uk ; ¿k / · gu ; k D 0; : : : ; N (34) to six decimal places is ¿ f D .0:5¼ / D 1:253314: The Chebyshev pseudospectral method was used for discretiza- Ãl · Ã[x0 ; x N ; .¿ f ¡ ¿0 /] · à u (35) tion of the problemand NPSOL 24 was utilized as the NLP solver.The implementation was performed in MATLAB ® via the use of MEXFrom the preceding equations, one can see the simplicity of the les. In Table 1, we compare the minimum cost function obtainedmethod, which retains much of the structure of the continuous from our method to the ones from the Simpson collocation methodproblem. and a fth-degree Gauss– Lobatto method reported in Ref. 7. All O O reported results are for N D 11 nodes, where N D N C 1: The vari- IV. Numerical Examples able N p in the last column of Table 1 stands for the total number of NLP variables, which includes the free nal time as well. Note In this section, we present three numerical examples that are in- that for the fth-degree Gauss– Lobatto (GL) collocation methodtended to illustrate separate points. In the rst example, we choose (done the traditional way), the number of NLP variables are signif-the benchmark brachistochrone problem discussed in Ref. 7 and icantly higher than the pseudospectralmethod for the same numberdemonstrate the accuracy of our technique. In the second example, of nodes. In any case, it is evident that even for a low number degreewe reformulate the brachistochrone problem as a DAE and show of discretization (and number of NLP variables), the Chebyshevhow our method remains unchanged.In the third and nal problem, pseudospectral method gives results superior to either of the otherwe solve the moon-landing problem23 formulated as a differential collocation methods.inclusion by a hodograph transformation. In Figs. 1 and 2, we show the time historiesof the state and control O variables against the analytic solutions for N D 11. The solid linesA. Example 1: Brachistochrone as an ODE representthe analytic solutionsand ¤ is for the solutionsfrom the nu- In this well-known problem, the control problem is formulated merical method. The graphs clearly demonstrate the accuracy of theas nding the shape of a wire so that a bead sliding on the wire results from the Chebyshev pseudospectralmethod. Note that fromwill reach a given horizontal displacement in minimum time. No Ref. 7 the collocation solutions are generally accurate to O.10¡4 /;frictional forces are considered, and the gravity force is uniform. which is about the same order of accuracy for the Chebyshev pseu-The problem is then to minimize ¿ f subject to the equations dospectral method for this number of nodes. However, the order of p accuracy in the control for the other collocation methods is about xD P 2gy cos µ (36) O.10¡2 / [with a maximum pointwise error at the rst node of about p O.10¡1 /], whereas for our method the maximum pointwise error is yD P 2gy sin µ (37) of order O.10¡3 /.with boundary conditions B. Example 2: Brachistochrone as a DAE Here we eliminate the control variable µ and rewrite Eqs. (36) x.0/ D y.0/ D 0; x.¿ f / D 0:5 (38) and (37) in terms of a single fully implicit DAE [see Eq. (3)]:The control, angle µ ; is the slope of the wire as a function of time. x 2 C y 2 D 2gy P P (44)
  5. 5. 164 FAHROO AND ROSS subject to the equations of motion dh Dv (47) d¿ dv T D ¡g C (48) d¿ m dm T D¡ (49) d¿ Isp g where the state variablesh; v, and m are altitude,speed,and mass, re- spectively.The control is providedby the thrust T , which is bounded by 0 · T · Tmax The other parameters in the problem are g; the gravity of moon (or any planet without an atmosphere), and Isp , the speci c impulse of the propellent.Given any set of initial conditions h 0 ; v0 , and m 0 ; the normalized parameters for the problem were arbitrarily chosen as Tmax =m 0 g D 1:1; Isp g =v0 D 1; h.0/= h 0 D 0:5 v.0/=v0 D ¡0:05; m.0/= m 0 D 1 Fig. 1 Time history of x and y for the brachistochrone problem. Therefore, we have the following normalized initial conditions: h.0/ D 0:5; v.0/ D ¡0:05; m.0/ D 1:0 (50) For soft landing, we must have h.¿ f / D 0; v.¿ f / D 0 (51) In addition, for a physically meaningful trajectory, we must have m.¿ f / > 0 (52) The discrete differential inclusion version of these equations for the variables H D [h.t0 /; h.t1 /; : : : ; h.t N /]T , V D [v.t0 /; v.t1 /; : : : ; v.t N /]T , and M D [m.t0 /; m.t1 /; : : : ; m.t N /]T can be formulated as .2=¿ f /D ¤ H ¡ V D 0 (53) M[.2=¿ f /D ¤ V C g] C Isp g[.2=¿ f /D ¤ M] D 0 (54) 0 · ¡Isp g[.2=¿ f /D ¤ M ] · Tmax (55) Fig. 2 Time history of control µ for the brachistochrone problem.Thus, there is a reduction in the number of NLP variables by N ,Othe number of CGL points. The DAE constraint is discretized at theCGL points resulting in ¡ ¯ 2¢ ¡ ¯ ¢ 4 ¿ f .D ¤ X /2 C 4 ¿ 2 .D ¤ Y /2 ¡ 2gY D 0 f (45)From Table 1, we see that, although the degree of accuracy forthe cost function is not as high as the original formulation, it isstill better than the results from the other collocation methods. Theaccuracy of the solutions is still of the order of O.10¡4 /. Therefore,the pseudospectral method can handle formulation of the problemas an DAE without sacri cing accuracy.C. Example 3: Moon-Landing Problem as a Differential Inclusion The control problem is formulated as maximizing the nal massand, hence, minimizing J D ¡m.¿ f / (46) Fig. 3 Phase portrait of h vs v for the moon-landing problem.
  6. 6. FAHROO AND ROSS 165 De ning Y N w.t / D .t ¡ tm / mD0 we easily obtain w 0 .tk / D .tk ¡ t0 /.tk ¡ t1 /; : : : ; .tk ¡ tk ¡ 1 /.tk ¡ tk C 1 /; : : : ; .tk ¡ t N / Y N D .tk ¡ tm / m D0 m 6D k Therefore, we have w.t / 1 Ák .t / D .t ¡ tk / w 0 .tk / From the de nition of the CGL points that are the extrema of TN 0 or the zeros of TN .t/, and t0 D 1; t N D ¡1; we can write 0 TN .t/ D .t ¡ t1 /.t ¡ t2 /; : : : ; .t ¡ t N ¡ 1 / Y N w.t/ D .t ¡ tm / D .t ¡ t0 /.t ¡ t1 /; : : : ; .t ¡ t N ¡ 1 /.t ¡ t N /Fig. 4 Time history of m and control T for the moon-landing problem. m D0 D .t 2 ¡ 1/TN .t / 0 Figure 3 shows the phase portrait projected into the v – h space For w 0 .tk /, we use that the Chebyshev polynomials are the eigen-for 32 CGL points. This problem has at most one switch in the functions ofcontrol variable (Ref. 22), and the results are shown in Fig. 4. The £ ¤control was calculated from Eq. (49). It is clear that the method has .1 ¡ t 2 /TN ¡ t TN C N 2 TN .t/ D 0 00 0adequately captured the optimal bang– bang structure of the controlwith one switch. From this expression and the equation for w.t /, we have £ ¤0 V. Conclusions w 0 .t/ D ¡.1 ¡ t 2 /TN 0 D N 2 TN .t/ C t TN 0 (A2) The simplicity, ef ciency, and versatility of the Chebyshev pseu-dospectral method allows one to perform rapid and accurate tra- Evaluating the preceding expressionat t D tk , k 6D 0, N , and using 0jectory optimization. A low degree of discretization appears to be that TN .tk / D 0, for k D 1; : : : ; N ¡ 1, and TN .tk / D cos.¼ k N = N / Dsuf cient to generate good results. Because the CGL points and .¡1/k , k D 1; : : : ; N ¡ 1, we haveweights can be quickly evaluated, it suggests that the technique hasa high potential for use in optimal guidance algorithms that require w 0 .tk / D .¡1/k N 2 ; k D 1; : : : ; N ¡ 1a corrective maneuver from the perturbed trajectory. In any case,reference optimal paths can be easily generated, and the numerical For k D 0; N , we use the following identities:examples indicate that the converged solutions are indeed optimal.Further tests and analysis are necessary to investigate the stability TN .t0 D 1/ D 1; TN .1/ D N 2 0and accuracy of the method. TN .t N D ¡1/ D .¡1/ N ; TN .¡1/ D .¡1/ N N 2 0 Appendix: Derivation of Lagrange Polynomials which give us from Eq. (A2) for CGL Nodes We derive the following expressionfor the Lagrange polynomials w 0 .1/ D 2N 2 ; w0 .¡1/ D 2.¡1/ N N 2of order N interpolating a function at the CGL nodes: Finally, we have P .¡1/k C 1 .1 ¡ t 2 / TN .t/ Ák .t/ D w.t/ 1 .t 2 ¡ 1/TN .t / .¡1/k 0 N k 2c .t ¡ tk / Ák .t / D D t ¡ tk w k 0 .t / .t ¡ tk / N 2 ckwhere 0 » .1 ¡ t 2 /TN .t / .¡1/k C 1 k D 0; N D 2; .t ¡ tk / N 2 ck ck D (A1) 1; 1· k · N ¡1 where ck is as de ned in Eq. (A1).TN .t/ is the Chebyshev polynomialof degree N , and tk are the CGL Referencespoints over the interval [¡1, 1]: 1 Betts, J. T., “Survey of Numerical Methods for Trajectory Optimization,” Journal of Guidance, Control, and Dynamics, Vol. 21, No. 2, 1998, pp. 193– tk D cos.¼ k = N /; k D 0; : : : ; N 207. 2 Hull, D. G., “Conversion of Optimal Control Problems into Parame-Differentiation is denoted by a prime. ter Optimization Problems,” Journal of Guidance, Control, and Dynamics, The general expression for a Lagrange interpolating polynomial Vol. 20, No. 1, 1997, pp. 57 – 60. 3 Pontryagin,L. S., Boltyanskii, V. G., Gamkrelidze, R. V., and Mischenko,at N distinct nodes tk is E. F., The Mathematical Theory of Optimal Processes, Interscience, New Y .t ¡ tm / N York, 1962, pp. 1 – 114. 4 Hargraves, C. R., and Paris, S. W., “Direct Trajectory Optimization Using Ák .t/ D ; k D 0; : : : ; N m D 0 .tk ¡ tm / Nonlinear Programming and Collocation,” Journal of Guidance, Control, m 6D k and Dynamics, Vol. 10, No. 4, 1987, pp. 338– 342.
  7. 7. 166 FAHROO AND ROSS 5 von Stryk, O., “Numerical Solution of Optimal Control Problems by Methods in Fluid Dynamics, Springer-Verlag, New York, 1988. 15 Gottlieb, D., Hussaini, M. Y., and Orszag, S. A., “Theory and Ap-Direct Collocation,” Optimal Control, edited by R. Bulirsch, A. Miele, andJ. Stoer, Birkh¨ user Verlag, Basel, Switzerland, 1993, pp. 129– 143. a plications of Spectral Methods,” Spectral Methods for PDE’s, edited by 6 Herman, A. H., and Conway, B. A., “Direct Optimization Using Col- R. G. Voigt, D. Gottlieb, and M. Y. Hussaini, Society for Industrial andlocation Based on High-Order Gauss– Lobatto Quadrature Rules,” Jour- Applied Mathematics, Philadelphia, 1984, pp. 1 – 54. 16nal of Guidance, Control, and Dynamics, Vol. 19, No. 3, 1996, pp. 592– Elnagar, G., and Kazemi, M. A., “Pseudospectral Chebyshev Optimal599. Control of Constrained Nonlinear Dynamical Systems,” ComputationalOp- 7 Conway, B. A., and Larson, K. M., “Collocation Versus Differential timization and Applications, Vol. 11, 1998, pp. 195– 217.Inclusion in Direct Optimization,” Journal of Guidance, Control, and Dy- 17 Trefethen, L. N., Spectral Methods in MATLAB, Society for Industrialnamics, Vol. 21, No. 5, 1998, pp. 780– 785. and Applied Mathematics, Philadelphia, 2000. 8 Elnagar, J., Kazemi, M. A., and Razzaghi, M., “The Pseudospectral Leg- 18 Davis, P. J., and Rabinowitz, P., Methods of Numerical Integration,endre Method for Discretizing Optimal Control Problems,” IEEE Transac- Academic, New York, 1977, p. 68.tions on Automatic Control, Vol. 40, No. 10, 1995, pp. 1793– 1796. 19 Fahroo, F., and Ross, I. M., “Direct Trajectory Optimization by Cheby- 9 Fahroo, F., and Ross, I. M., “Costate Estimation by a Legendre Pseu- shev Pseudospectral Method,” Proceedings of the American Control Con-dospectral Method,” Journal of Guidance, Control, and Dynamics, Vol. 24, ference, Inst. of Electrical and Electronics Engineers, New York, 2000, pp.No. 2, 2001, pp. 270– 277. 3860– 3864. 10 20 Vlassenbroeck, J., and Van Doreen, R., “A Chebyshev Technique for Golub, G. H., “Some Modi ed Matrix Eigenvalue Problems,” SIAMSolving Nonlinear Optimal Control Problems,” IEEE Transaction on Auto- Review, Vol. 15, No. 2, 1973, pp. 318– 334.matic Control, Vol. 33, No. 4, 1988, pp. 333– 340. 21 Brenan, K. E., “Differential-Algebraic Equations Issues in the Direct 11 Vlassenbroeck, J., “A Chebyshev Polynomial Method for Optimal Con- Transcription of Path Constrained Optimal Control Problems,” Annals oftrol with State Constraints,” Automatica, Vol. 24, No. 4, 1988, pp. 499– 506. Numerical Mathematics, Vol. 1, 1994, pp. 247– 263. 12 Fahroo,F., and Ross, I. M., “Second Look at ApproximatingDifferential 22 Solomonoff, A., “A Fast Algorithm for Spectral Differentiation,” Jour-Inclusions,” Journal of Guidance, Control, and Dynamics, Vol. 24, No. 1, nal of Computational Physics, Vol. 98, 1992, pp. 174– 177.2001, pp. 131– 133. 23 Knowles, G., An Introduction to Applied Optimal Control, Academic, 13 Fahroo, F., and Ross, I. M., “A Spectral Patching Method for Direct New York, 1981, pp. 50 – 55.Trajectory Optimization,” American Astronautical Society, Paper AAS 00- 24 Gill, P. E., Murray, W., Saunders, M. A., and Wright, M. A., “User’s260, 20 – 21 March 2000; also Journal of Astronautical Sciences, Vol. 48, Guide to NPSOL 5.0: A Fortran Package for Nonlinear Programming,” Stan-No. 2/3, 2000, pp. 269– 286. ford Optimization Lab., Technical Rept. SOL 86-1, Stanford Univ., Stanford, 14 Canuto, C., Hussaini, M. Y., Quarteroni, A., and Zang, T. A., Spectral CA, July 1998.

×