86
An overview of optimal control methods with applications Registered office Piazza della Repubblica, 10 - 20121 - Milan (Italy) Head office Via Morghen, 13 - 20158 - Milan (Italy) Phone: +39-02-8342-2930 Fax: +39-02-3206-6679 e-mail: [email protected] website: www.dinamicatech.com F. Topputo and P. Di Lizia Dinamica Srl Stardust - Opening Training School University of Strathclyde Glasgow, UK 18-22 November 2013

OTS-Talk-Topputo.pdf

Embed Size (px)

Citation preview

DINAMICA srl Via Rembrandt, 6920147 - Milano (Italy) Phone +39 02 40091584 Fax +39 02 4816277e-mail: [email protected] website: www.dinamicatech.comAnoverviewofoptimalcontrol methods with applicationsRegistered ofce Piazza della Repubblica, 10 - 20121 - Milan (Italy) Head ofce Via Morghen, 13 - 20158 - Milan (Italy) Phone: +39-02-8342-2930 Fax: +39-02-3206-6679 e-mail: [email protected] website: www.dinamicatech.comF. Topputo and P. Di Lizia Dinamica SrlStardust - Opening Training School University of Strathclyde Glasgow, UK 18-22 November 2013The Company! Founded by 5 partners in January 2008 ! All partners have a PhD in Aerospace Engineering ! Dinamica Srl has a strong connection with Academia ! More than 30 years of accumulated space experience ! Dinamica Srl is located in Milano4

INNOVATING TECHNOLOGYKeywordsSystem engineeringOptimization AutonomyMission analysisOptimizationControlSimulationDesignAnalysis3

INNOVATING TECHNOLOGYThe missionSpace field Industrial sector Technology transfer! Italian SME, founded in 2008 ! Themission:...tocarryondevelopingmethodsand advancedsolutionswithintheSpacefieldandto transfer their use in other industrial sectors ...4A Tangible Example

INNOVATING TECHNOLOGYPharmaceutical industryUsed to reconstructunmodeled structural dynamicsConsiderable savings (10-20%) compared to standard methodsPredictive controlSystem identificationUsed to reduce vibrations in large telescope satellitesUsed to reconstruct a pharmaceutical process dynamicsUsed to minimize the energy supply7HubbleOptimal Control Problem (1/2)!Consider the following dynamical system: where: is the state vector and#is the control vector!Determine the control functions such that the following performance index is minimized:mwhere the initial and nal state vectors, and , as well as the nal time, are not necessarily xedOptimal Control Problem (2/2)!In addition to the previous statements suppose that the following constraints are imposed Boundary conditions at nal time : , wherePath constraints on the control variables: , wheretf!Two classical solution methods: Indirect methods: based on reducing the optimal control problem to a Boundary Value Problem (BVP)Direct methods: based on reducing the optimal control problem to a nonlinear programming problem and the inequality constraints :Example: Low-Thrust Earth-Mars TransferGiven the dynamics of the controlled 2 body problem:Minimize:r = r3 r + uSubject to equality constraints:vErEv1rMvMv2r(t0) = rE(t0)r(tf) = rM(tf) v(tf) = vM(tf)v(t0) = vE(t0)u umaxIndirect Methods (1/6)!Reconsider the optimal control problem:#Given the dynamical system Minimize: Subject to: and!Constraints are added to the performance index by introducing two kinds of Lagrange multipliers: a-dimensional vector of constantsfor the nal constraints two- and a-dimensional vectors of functions and (adjoint or costate variables) for dynamics and path constraintsJpn qIndirect Methods (2/6)!Augmented performance index:The dynamics is included in the augmented performance index as a constraint!Moreover, pertaining the costate variables for the path inequality constraints , the generic component must satisfy the following relations:k!The problem is then reduced to identify a stationary point of.This is achieved by imposing the gradient to be zero. The optimization variables are: State vectorand control vector Lagrange multipliers and costate variables , and Unknown components of the initial state , Final state and timeand Indirect Methods (3/6)!Integrating by parts the term yields:where and Indirect Methods (4/6)ConstraintsDynamicsIndirect Methods (5/6)!The problem consists on nding the functions, andby solving the differential-algebraic system: Euler-Lagrange equationsdifferentialalgebraicNote: For the sake of a more compact notation, dene the HamiltonianThe previous equations read:Indirect Methods (6/6)!The previous differential-algebraic system must be coupled to the boundary conditions 2 ngiven orand to the additional constraints p + q + 1The optimal control problem is reduced to a boundary value problem on a differential-algebraic system of equations (DAE)Assignment #1! Given the simple optimal control problem (Problem #1) ! Write the necessary conditions for optimality and show that the optimal solution is3 Example1: ASimpleOptimal Control ProblemInthissection, asimpleoptimal control problemissolvedwithHermiteSimpsonmethod, andcertainissues are set to speed-up the computation time and improving accuracy. Consider the problem of ndingu(t)withxedinitialandnaltime[0, 1]tominimizethecostJ= x2(1) (68)subjecttosystemequations x1= 0.5x1 + u x2= u2+ x1u +54x21(69)andtotheboundaryconditionsx1(0) = 1x2(0) = 0(70)withthefollowingboundboxofstateandcontrolvariables10 x1(t) 10 (71)10 x2(t) 10 (72)10 u(t) 10 (73)(74)Theanalyticalsolutionofthisproblemisx1(t) =cosh(1 t)cosh(1)u(t) = (tanh(1 t) + 0.5) cosh(1 t)cosh(1)(75)3.1 SolutionbyHermiteSimpsonmethodThisproblemissolvedbyusingtheMATLABfunctionfminconwithinterior-point algorithm. Thenal optimized results are plotted in Figure 11, where the discrete values of x1, u as well as the analyticalcontinuetimehistoryofx1a,uaareplotted. InFigure11(c)itcanbeseenthattheerrorofx1ismuchlowerthanthatof u(1010forx1vs105foru). Thisisbecausethe3rd-orderHermiteinterpolationpolynomial is implementedtoapproximatethestates, whilelinear interpolationis usedtomimicthecontrol curve. InFigure11(d),weintegrate dynamicsfrom theinitialcondition withtheoptimalcontrolhistory,andthenweplottheerrorofx1. Itcanbeseenthattheerrorofx1inthewholetimedomain[0, 1]isbelow105.3.2 Improvingsolutionaccuracyandcomputational eciencyFminconuses thenitedierences methodasthedefault optiontoobtainthegradientinformation,however computational eciency can be remarkably improved by adding analytical Jacobian and Hessian.Thecomparison of3dierentcasesislistedinTable3.Table3: ImprovementwithJacobianandHessian,100points.Case Method No.ofiterations CPUtime1 nitedierences(default) 116 17.2s2 Jacobianonly 116 8.7s3 JacobianandHessian 12 0.38sAll of thethreecaseslistedaboveusethesame100discretepoints. Incase1, thedefault nite-dierences method is implemented to aord the gradient information, the simulation takes 116 steps andis17.2 slong. In case2,addingJacobian onlydoesnotreducethenumberofiterationsbutsaves almost163 Example1: ASimpleOptimal Control ProblemInthissection, asimpleoptimal control problemissolvedwithHermiteSimpsonmethod, andcertainissues are set to speed-up the computation time and improving accuracy. Consider the problem of ndingu(t)withxedinitialandnaltime[0, 1]tominimizethecostJ= x2(1) (68)subjecttosystemequations x1= 0.5x1 + u x2= u2+ x1u +54x21(69)andtotheboundaryconditionsx1(0) = 1x2(0) = 0(70)withthefollowingboundboxofstateandcontrolvariables10 x1(t) 10 (71)10 x2(t) 10 (72)10 u(t) 10 (73)(74)Theanalyticalsolutionofthisproblemisx1(t) =cosh(1 t)cosh(1)u(t) = (tanh(1 t) + 0.5) cosh(1 t)cosh(1)(75)3.1 SolutionbyHermiteSimpsonmethodThisproblemissolvedbyusingtheMATLABfunctionfminconwithinterior-point algorithm. Thenal optimized results are plotted in Figure 11, where the discrete values of x1, u as well as the analyticalcontinuetimehistoryofx1a,uaareplotted. InFigure11(c)itcanbeseenthattheerrorofx1ismuchlowerthanthatof u(1010forx1vs105foru). Thisisbecausethe3rd-orderHermiteinterpolationpolynomial is implementedtoapproximatethestates, whilelinear interpolationis usedtomimicthecontrol curve. InFigure11(d),weintegrate dynamicsfrom theinitialcondition withtheoptimalcontrolhistory,andthenweplottheerrorofx1. Itcanbeseenthattheerrorofx1inthewholetimedomain[0, 1]isbelow105.3.2 Improvingsolutionaccuracyandcomputational eciencyFminconuses thenitedierences methodasthedefault optiontoobtainthegradientinformation,however computational eciency can be remarkably improved by adding analytical Jacobian and Hessian.Thecomparison of3dierentcasesislistedinTable3.Table3: ImprovementwithJacobianandHessian,100points.Case Method No.ofiterations CPUtime1 nitedierences(default) 116 17.2s2 Jacobianonly 116 8.7s3 JacobianandHessian 12 0.38sAll of thethreecaseslistedaboveusethesame100discretepoints. Incase1, thedefault nite-dierences method is implemented to aord the gradient information, the simulation takes 116 steps andis17.2 slong. In case2,addingJacobian onlydoesnotreducethenumberofiterationsbutsaves almost163 Example1: ASimpleOptimal Control ProblemInthissection, asimpleoptimal control problemissolvedwithHermiteSimpsonmethod, andcertainissues are set to speed-up the computation time and improving accuracy. Consider the problem of ndingu(t)withxedinitialandnaltime[0, 1]tominimizethecostJ= x2(1) (68)subjecttosystemequations x1= 0.5x1 + u x2= u2+ x1u +54x21(69)andtotheboundaryconditionsx1(0) = 1x2(0) = 0(70)withthefollowingboundboxofstateandcontrolvariables10 x1(t) 10 (71)10 x2(t) 10 (72)10 u(t) 10 (73)(74)Theanalyticalsolutionofthisproblemisx1(t) =cosh(1 t)cosh(1)u(t) = (tanh(1 t) + 0.5) cosh(1 t)cosh(1)(75)3.1 SolutionbyHermiteSimpsonmethodThisproblemissolvedbyusingtheMATLABfunctionfminconwithinterior-point algorithm. Thenal optimized results are plotted in Figure 11, where the discrete values of x1, u as well as the analyticalcontinuetimehistoryofx1a,uaareplotted. InFigure11(c)itcanbeseenthattheerrorofx1ismuchlowerthanthatof u(1010forx1vs105foru). Thisisbecausethe3rd-orderHermiteinterpolationpolynomial is implementedtoapproximatethestates, whilelinear interpolationis usedtomimicthecontrol curve. InFigure11(d),weintegrate dynamicsfrom theinitialcondition withtheoptimalcontrolhistory,andthenweplottheerrorofx1. Itcanbeseenthattheerrorofx1inthewholetimedomain[0, 1]isbelow105.3.2 Improvingsolutionaccuracyandcomputational eciencyFminconuses thenitedierences methodasthedefault optiontoobtainthegradientinformation,however computational eciency can be remarkably improved by adding analytical Jacobian and Hessian.Thecomparison of3dierentcasesislistedinTable3.Table3: ImprovementwithJacobianandHessian,100points.Case Method No.ofiterations CPUtime1 nitedierences(default) 116 17.2s2 Jacobianonly 116 8.7s3 JacobianandHessian 12 0.38sAll of thethreecaseslistedaboveusethesame100discretepoints. Incase1, thedefault nite-dierences method is implemented to aord the gradient information, the simulation takes 116 steps andis17.2 slong. In case2,addingJacobian onlydoesnotreducethenumberofiterationsbutsaves almost16Dynamics Obj. fcn. b. c. init., nal time3 Example1: ASimpleOptimal Control ProblemInthissection, asimpleoptimal control problemissolvedwithHermiteSimpsonmethod, andcertainissues are set to speed-up the computation time and improving accuracy. Consider the problem of ndingu(t)withxedinitialandnaltime[0, 1]tominimizethecostJ= x2(1) (68)subjecttosystemequations x1= 0.5x1 + u x2= u2+ x1u +54x21(69)andtotheboundaryconditionsx1(0) = 1x2(0) = 0(70)withthefollowingboundboxofstateandcontrolvariables10 x1(t) 10 (71)10 x2(t) 10 (72)10 u(t) 10 (73)(74)Theanalyticalsolutionofthisproblemisx1(t) =cosh(1 t)cosh(1)u(t) = (tanh(1 t) + 0.5) cosh(1 t)cosh(1)(75)3.1 SolutionbyHermiteSimpsonmethodThisproblemissolvedbyusingtheMATLABfunctionfminconwithinterior-point algorithm. Thenal optimized results are plotted in Figure 11, where the discrete values of x1, u as well as the analyticalcontinuetimehistoryofx1a,uaareplotted. InFigure11(c)itcanbeseenthattheerrorofx1ismuchlowerthanthatof u(1010forx1vs105foru). Thisisbecausethe3rd-orderHermiteinterpolationpolynomial is implementedtoapproximatethestates, whilelinear interpolationis usedtomimicthecontrol curve. InFigure11(d),weintegrate dynamicsfrom theinitialcondition withtheoptimalcontrolhistory,andthenweplottheerrorofx1. Itcanbeseenthattheerrorofx1inthewholetimedomain[0, 1]isbelow105.3.2 Improvingsolutionaccuracyandcomputational eciencyFminconuses thenitedierences methodasthedefault optiontoobtainthegradientinformation,however computational eciency can be remarkably improved by adding analytical Jacobian and Hessian.Thecomparison of3dierentcasesislistedinTable3.Table3: ImprovementwithJacobianandHessian,100points.Case Method No.ofiterations CPUtime1 nitedierences(default) 116 17.2s2 Jacobianonly 116 8.7s3 JacobianandHessian 12 0.38sAll of thethreecaseslistedaboveusethesame100discretepoints. Incase1, thedefault nite-dierences method is implemented to aord the gradient information, the simulation takes 116 steps andis17.2 slong. In case2,addingJacobian onlydoesnotreducethenumberofiterationsbutsaves almost16Optimal solutionLow-Thrust Transfer to Halo Orbit (1/4)!Transfer the s/c from a given orbit (GTO raising) to a Halo orbit around L1 of the Earth-Moon system!Dynamics:Low-Thrust Transfer to Halo Orbit (2/4)!In canonical form, the dynamics reads:!Performance index: minimize the quadratic functional!Constraints: xed and, xed nal time!Euler-Lagrange equations:Low-Thrust Transfer to Halo Orbit (3/4)!Processing the last algebraic equation leads to:which can be inserted in the differential equationsThe DAE system is reduced to a ODE system!All constraints simply reduce to:The original problem is reduced to a simple Two Point Boundary Value Problem (TPBVP)Low-Thrust Transfer to Halo Orbit (4/4)!Solution of the TPBVP: Transcribe the dynamics Couple the transcribed dynamics with the constraints onand Solve the resulting system with a Newton method starting from a suitable initial condition Evaluate the control parameters(x, )(u0 , ... , uN)End-to-end optimization w/ nite thrust!GTO-to-halo fully optimized very difcult problem tens of spirals thrust saturationForxed , the Jacobi integral readsJ(x; y; z; _ x; _ y; _ z) =23(x; y; z) ( _ x2_ y2_ z2) (5)and, for a given energy C, it denes ave-dimensional manifold:J (C) =f(x; y; z; _ x; _ y; _ z) 2 R6jJ(x; y; z; _ x; _ y; _ z) C =0g (6)The projection of J(C) onto the conguration space (x; y; z) denesthe Hills surfaces bounding the allowed and forbidden regions ofmotion associated to C.The vector eld dened by Eqs. (2) has ve well-knownequilibrium points: the EulerLagrange points, labeled Lk,k =1; . . . ; 5. This study deals with the portion of the phase spacesurrounding the two collinear points L1 and L2. In a linear analysis,these two points behave like the product saddle center center.Thus, in their neighborhood, there exist families of periodic orbitstogether with two-dimensional stable and unstable manifoldsemanating from them [4,24,25]. The generic periodic orbit about Li,i =1; 2, is referred to as i, whereas its stable and unstable manifoldsare labeled Ws

iand Wu

i, respectively.Equations (2) are used in this paper alternatively to describe themotion in the SE or EM system. The mass parameters used for thesemodelsareSE=3:0359 106andEM =1:21506683 102,respectively [47].The planar circular restricted three-body problem (PCRTBP) is aversion of the RTBP in which the motion of P3 is constrained on theplanez =0. The dynamics of the PCRTBP are represented by therst two equations in Eqs. (2) [with z =0 in Eqs. (3) and (4)]. In thisproblem, the Jacobi integral is a four-dimensional manifold, and itsprojection on the conguration space (x; y) denes the Hills curves.The linear behavior of L1, L2 is saddle center; therefore, the planarLyapunov orbits possess stable and unstable two-dimensionalmanifolds that act as separatrices for the states of motion [28].III. Low-Thrust Propulsion and Attainable SetsTomodel thecontrolledmotionof P3under thegravitationalattractions ofP1,P2, and the low-thrust propulsion, the followingdifferential equations are considered: x 2_ y =@3@xTxm ; y 2_ x =@3@yTym z =@3@zTzm ; _ m=TIspg0(7)where T =

T2x T2y T2zqis the present thrust magnitude.Continuous variations of the spacecraft mass mare takenintoaccount through the last of Eqs. (7). This causes a singularity arisingwhen m ! 0 beside the well-known singularities given by impactsof P3with P1or P2(r1;2 ! 0). The guidance law T(t)=(Tx(t); Ty(t); Tz(t)), t 2 [t0; tf|, in Eqs. (7) is not given; rather, it isfound through an optimal control step where objective function andboundary conditions are specied (see Sec. IV). However, in order toconstruct a rst-guess solution, the prole of Tover time isprescribed at this stage. Using tangential thrust, attainable sets can bedened in the same fashion as reachable sets dened in [33].LetT()(x0; t0; t) be theow of system (7) at timet under theguidance lawT(),2 [t0; t|, and starting from(x0; t0) withx0 =(x0; y0; z0;_ x0;_ y0; _ z0; m0). Thegenericpoint of atangentiallow-thrust trajectory isx (t) =

T(x0; t0; t) (8)where

T =

Tv=v, v =( _ x; _ y; _ z), v =

_ x2_ y2_ z2p, and

Tis agiven, constant thrust magnitude. Withgiven

T, tangential thrustmaximizes the variation of Jacobi energy, which is the only propertythat has to be considered when designing trajectories in a three-bodyframework. (The thrust tangential to the inertial velocity maximizes avariation of the orbits semimajor axis; in [16], a comparison betweentangential thrust in either a rotating or inertial frame shows negligibledifferences in thenal optimal solution.)Let S() be a surface of section perpendicular to the (x; y) planeand forming an angle with the x axis. The low-thrust orbit, for achosen angle , is

T(x0; ; ) =f

T(x0; t0; )j tg (9)where the dependence on the initial state x0 is kept. In Eq. (9),is theduration of the low-thrust law, whereas t is the time at which the orbitintersects S(). The orbit

T is entirely thrust when=t; a thrust arcfollowed by a coast arc can be achieved by setting< t.The attainable set is a collection of low-thrust orbits (all computedwith the same guidance law T()) on S():A

T(; ) =[x02X

T(x0; ; ) (10)According to the denition in Eq. (10), the attainable set is made upby orbits that reach S() at different times, although all orbits havethe same thrust history, and therefore the same mass. (This denitionimproves that given in [18,35].)The attainable set in Eq. (10) is associated to a generic domain ofadmissibleinitial conditionsX; it will beshownhowXcanbedened for the two case studies. Attainable sets can be used to incor-poratelow-thrustpropulsioninathree-bodyframe withthesamemethodologydevelopedfor the invariant manifolds. More spe-cically, invariant manifolds are replaced by attainable sets, whichare manipulated tond transfer points on a surface of section.IV. From Attainable Sets to Optimal TrajectoriesA. Controlled Spatial Bicircular Restricted Four-Body ProblemFirst-guess solutions achieved by using attainable sets areoptimized in a four-body framework under the perspective of optimalcontrol. The model used to take into account the low-thrustpropulsion and the gravitational attractions of the sun, the Earth, andthe moon is x 2_ y =@4@xTxm ; y 2_ x =@4@yTym z =@4@zTzm ;_ =!S; _ m=TIspg0(11)This is the controlled version of the spatial bicircular restricted four-body problem (SBRFBP) [12,48] and, in principle, it incorporatestheperturbationof thesunintotheEMmodel. Thefour-bodypotential 4 reads

4(x; y; z) =3(x; y; z; EM) msrsms

2 (x cosy sin )(12)The physical constants introducedtodescribe the sunperturb-ation have to be in agreement with those of the EM model. Thus, thedistance between the sun and the EM barycenter is =3:88811143 102, the mass of the sun is ms =3:28900541 105,anditsangularvelocitywithrespect totheEMrotatingframeis!S =9:25195985 101. The sun is located at ( cos ;sin ; 0); therefore, the sunspacecraft distance isr2s =(x cos )2(y sin )2z2(13)It is worth noting that this model is not coherent because all threeprimaries are assumed to move in circular orbits. Nevertheless, theSBRFBP catches basic insights of the real four-body dynamics as theeccentricities of the Earths and moons orbits are 0.0167 and 0.0549,respectively, and the moons orbit is inclined on the ecliptic by just5 deg.The controlledplanar bicircular restrictedfour-bodyproblem(PBRFBP) is achieved by setting z =0 in Eqs. (1113). This modelis used in the remainder of the paper to design EM LELT transfers.1646 MINGOTTI, TOPPUTO, AND BERNELLI-ZAZZERAB. Optimal Control Problem DenitionThe optimal control aims at ndingthe guidance lawT, 2 t0; tf, that minimizesJ Ztft0TIspg0d (14)It is easy to verify through the last of Eqs. (11) that J is the propellantmass; that is, J m0mf, where m0 and mf are the initial and nalspacecraft masses. The thrust magnitude must not exceed amaximumthresholdgivenbytechnological constraints. This isimposed along the whole transfer throughTtTmax(15)where Tmaxis the maximumavailable thrust. In addition, thefollowingpathconstraintsareimposedtoavoidimpactswiththeEarth and moon along the transfer:

x 2 y2 z2p> RE; x 12 y2 z2p> RM(16)whereREandRMare the normalized mean radii of the Earth andmoon, respectively. The initial boundary condition is x0 2 y20q rE;

_ x20 _ y20q vErEx0 _ x0y0 y0 _ y0 x0 0; z0 _ z0 0 (17)whichenforcesthespacecraft at theperiapsisofaplanarEarth-parking orbit uniquely specied by periapsis altitude andeccentricity, hEp and eE, respectively (rE RE hEp is the periapsisradius; vE

11 eE=rEpis the periapsis velocity).C. Solution by Direct Transcription and Multiple ShootingThe optimal control problemis transcribed into a nonlinearprogrammingproblembymeansofadirect approach[49]. Thismethod generally shows robustness and versatility, and it does notrequire explicit derivation of the necessary conditions of optimality;it is also less sensitive to variations of therst-guess solutions [50].More specically, a multiple shooting scheme is implemented [51].Withthisstrategy, Eqs. (11)areforwardintegratedwithinN1intervals in which t0; tf is split. This is done assuming N points andconstructing the mesh t0 t1 < . . . < tN tf. The solution isdiscretized over these Ngrid nodes; that is, xj xtj. The matchingof position, velocity, sun phase, and mass is imposed at the endpointsof the intervals in the form of defects as

j xjxj1 0; j 1; . . . ; N1 (18)withxj Txj; tj; tj1,2 tj; tj1. To compute T, asecond-level time discretization is implemented by splitting each ofthe N1 intervals into M1 subsegments. The control isdiscretized over the Msubnodes; that is, Tj;k, j 1; . . . ; N,k 1; . . . ; M. Athird-order spline interpolationis achievedbyselecting M 4. Initial and nal times t1 and tN are included into thenonlinear programming variables, allowing the formulation ofvariable-time transfers. The transcribed nonlinear programmingproblemnds the states and the controls at mesh points (xj and Tj;k)that satisfy integration defects, and boundary and path constraints[Eqs. (1517)], and that minimize the performance index [Eq. (14)].(Thenal boundary condition is specied in Secs. Vand VI for thetwo case studies.) It is worth stressing that, not only the initial low-thrust portion, but rather the whole transfer trajectory, is discretizedand optimized, allowing the lowthrust to also act in regionspreliminarily made up by coast arcs. The optimal solution found isassessed a posteriori by forward integrating the optimal initialcondition using an eighth-order RungeKuttaFehlberg scheme(tolerance set to 1012) by cubic interpolation of the discrete optimalcontrol solution.V. Case Study 1: Planar Low-Energy Low-ThrustTransfers to the MoonA. Impulsive Low-Energy Transfers to the MoonIn literature, planar low-energy transfers to the moon are designedby decoupling the four-body probleminto two PCRTBPs: the SEandEMmodels. Twodifferent portionsof thetransfer trajectoryaredesignedapart ineach of these two models by exploitingtheknowledge of the phase space about the collinear Lagrange points.The two legs are then patched together in order to dene the wholetrajectory. This procedure is referredtoas the coupledRTBPsapproximation. It is briey recalled. (See [811,15,16,27,33,34,46]for more details.)In the planar SE model, the Jacobi energy CSE is chosen such thatCSEC2, whereC2is the energy ofL2. (The Earth-escape leg isconstructed considering the dynamics about L2; using L1 instead isstraightforward.) The planar periodic orbit 2 and its stable manifoldWs

2SE for given CSE are computed. The solution space is studiedwiththeaid ofthe Poincarsection.Asthesecutsrepresenttwo-dimensional maps for the owof the PCRTBP, it is possible to assesswhether an orbit lies on the stable manifold or not. Orbits lying onWs

2SE asymptoticallyapproach2inforwardtimeandorbitsinside Ws

2SE are transit orbits (that pass from the Earth region tothe exterior region), whereas orbits outside Ws

2SE are nontransitorbits [24,25,28]. Candidate trajectories toconstruct the Earth-escape portion are those nontransit orbits close to both Ws

2SE andWu

2SE. The set ESE is the set of Earth-escape orbits that intersectthe departure orbit (Fig. 1b).Analogously, the Jacobi energy CEM, CEMC2, is chosen in theplanar EMmodel. For anexterior mooncapture tooccur, thedynamics about L2 is considered. The periodic orbit 2 associated toCEM and its stable manifold Ws

2EM are computed. Using again theseparatrix property, typical of the PCRTBP, the set leading to mooncaptureKEMisdenedasthesetoforbitsinsideWs

2EM. Itispossible to represent this set on the same surface of section used forthe SE model (Fig. 1b). Low-energy transfers to the moon are thendened as those orbits originated by ESE \ KEM. These two sets arecharacterizedbydifferent valuesoftheJacobi constant, CSEandCEM, respectively; therefore, an intermediate impulsive maneuver isneeded to remove the discontinuity invelocity. In addition, two otherimpulsive maneuvers are needed at both ends of the trajectory: therst one is neededtoleave the parkingorbit andtoplace thespacecraft into a translunar trajectory, and the second is instead usedto place the spacecraft into a stable,nal orbit about the moon.The intersection ESE \ KEM denes the transfer point. The wholetrajectory design is reduced to the denition of this point, indicatingtheconcisenessofthemethod.ThemechanismissummarizedinFig. 1. The use of impulsive maneuvers is evident and intrinsic in thismethodology. Figure 2 reports a sample solution as derived with theRTBPs approximation. The performances of two sample solutionsare reported in Table 1 for the purpose of comparison (optimizingthese transfers is out of the scope of the present work).The rocketequation (1) is evaluated with Isp 300s. Although it isdemonstratedthat thesesolutionsoutperformthepatched-conicstrajectoriesintermsofpropellantmass[2,3],theircostscouldbefurther reduced with LELT transfers.B. Attainable Sets for Transfers to the MoonLELT transfers to the moon are dened as follows. The spacecraftis assumed to initially be on a planar Earth-parking orbit, as denedbyEq. (17). Animpulsivemaneuver, carriedout bythelaunchvehicle,placesthespacecraftona translunartrajectory;fromthispoint on, the spacecraft can only rely on its low-thrust propulsion toreachthe nal orbit aroundthemoon. This orbit has moderateeccentricity eMand periapsis altitude hMpprescribed by the missionrequirements. The transfer terminates when the spacecraft is at theThenextNASAsGravityRecoveryandInteriorLaboratory(GRAIL)mission will use a 3.5 month low-energy transfer similar to that represented inFig. 2; see http://moon.mit.edu/design.html [retrieved 29 August 2011].MINGOTTI, TOPPUTO, AND BERNELLI-ZAZZERA 1647Optimal solutionControlSwitching fcnAssignment #2! Given Problem #1 ! Solve the TPBVP associated ! Matlab built-in bvp4c, bvp5c ! Sixth-order method bvp_h6 available at http://www.astrodynamics.eu/Astrodynamics.eu/Software.html3 Example1: ASimpleOptimal Control ProblemInthissection, asimpleoptimal control problemissolvedwithHermiteSimpsonmethod, andcertainissues are set to speed-up the computation time and improving accuracy. Consider the problem of ndingu(t)withxedinitialandnaltime[0, 1]tominimizethecostJ= x2(1) (68)subjecttosystemequations x1= 0.5x1 + u x2= u2+ x1u +54x21(69)andtotheboundaryconditionsx1(0) = 1x2(0) = 0(70)withthefollowingboundboxofstateandcontrolvariables10 x1(t) 10 (71)10 x2(t) 10 (72)10 u(t) 10 (73)(74)Theanalyticalsolutionofthisproblemisx1(t) =cosh(1 t)cosh(1)u(t) = (tanh(1 t) + 0.5) cosh(1 t)cosh(1)(75)3.1 SolutionbyHermiteSimpsonmethodThisproblemissolvedbyusingtheMATLABfunctionfminconwithinterior-point algorithm. Thenal optimized results are plotted in Figure 11, where the discrete values of x1, u as well as the analyticalcontinuetimehistoryofx1a,uaareplotted. InFigure11(c)itcanbeseenthattheerrorofx1ismuchlowerthanthatof u(1010forx1vs105foru). Thisisbecausethe3rd-orderHermiteinterpolationpolynomial is implementedtoapproximatethestates, whilelinear interpolationis usedtomimicthecontrol curve. InFigure11(d),weintegrate dynamicsfrom theinitialcondition withtheoptimalcontrolhistory,andthenweplottheerrorofx1. Itcanbeseenthattheerrorofx1inthewholetimedomain[0, 1]isbelow105.3.2 Improvingsolutionaccuracyandcomputational eciencyFminconuses thenitedierences methodasthedefault optiontoobtainthegradientinformation,however computational eciency can be remarkably improved by adding analytical Jacobian and Hessian.Thecomparison of3dierentcasesislistedinTable3.Table3: ImprovementwithJacobianandHessian,100points.Case Method No.ofiterations CPUtime1 nitedierences(default) 116 17.2s2 Jacobianonly 116 8.7s3 JacobianandHessian 12 0.38sAll of thethreecaseslistedaboveusethesame100discretepoints. Incase1, thedefault nite-dierences method is implemented to aord the gradient information, the simulation takes 116 steps andis17.2 slong. In case2,addingJacobian onlydoesnotreducethenumberofiterationsbutsaves almost163 Example1: ASimpleOptimal Control ProblemInthissection, asimpleoptimal control problemissolvedwithHermiteSimpsonmethod, andcertainissues are set to speed-up the computation time and improving accuracy. Consider the problem of ndingu(t)withxedinitialandnaltime[0, 1]tominimizethecostJ= x2(1) (68)subjecttosystemequations x1= 0.5x1 + u x2= u2+ x1u +54x21(69)andtotheboundaryconditionsx1(0) = 1x2(0) = 0(70)withthefollowingboundboxofstateandcontrolvariables10 x1(t) 10 (71)10 x2(t) 10 (72)10 u(t) 10 (73)(74)Theanalyticalsolutionofthisproblemisx1(t) =cosh(1 t)cosh(1)u(t) = (tanh(1 t) + 0.5) cosh(1 t)cosh(1)(75)3.1 SolutionbyHermiteSimpsonmethodThisproblemissolvedbyusingtheMATLABfunctionfminconwithinterior-point algorithm. Thenal optimized results are plotted in Figure 11, where the discrete values of x1, u as well as the analyticalcontinuetimehistoryofx1a,uaareplotted. InFigure11(c)itcanbeseenthattheerrorofx1ismuchlowerthanthatof u(1010forx1vs105foru). Thisisbecausethe3rd-orderHermiteinterpolationpolynomial is implementedtoapproximatethestates, whilelinear interpolationis usedtomimicthecontrol curve. InFigure11(d),weintegrate dynamicsfrom theinitialcondition withtheoptimalcontrolhistory,andthenweplottheerrorofx1. Itcanbeseenthattheerrorofx1inthewholetimedomain[0, 1]isbelow105.3.2 Improvingsolutionaccuracyandcomputational eciencyFminconuses thenitedierences methodasthedefault optiontoobtainthegradientinformation,however computational eciency can be remarkably improved by adding analytical Jacobian and Hessian.Thecomparison of3dierentcasesislistedinTable3.Table3: ImprovementwithJacobianandHessian,100points.Case Method No.ofiterations CPUtime1 nitedierences(default) 116 17.2s2 Jacobianonly 116 8.7s3 JacobianandHessian 12 0.38sAll of thethreecaseslistedaboveusethesame100discretepoints. Incase1, thedefault nite-dierences method is implemented to aord the gradient information, the simulation takes 116 steps andis17.2 slong. In case2,addingJacobian onlydoesnotreducethenumberofiterationsbutsaves almost163 Example1: ASimpleOptimal Control ProblemInthissection, asimpleoptimal control problemissolvedwithHermiteSimpsonmethod, andcertainissues are set to speed-up the computation time and improving accuracy. Consider the problem of ndingu(t)withxedinitialandnaltime[0, 1]tominimizethecostJ= x2(1) (68)subjecttosystemequations x1= 0.5x1 + u x2= u2+ x1u +54x21(69)andtotheboundaryconditionsx1(0) = 1x2(0) = 0(70)withthefollowingboundboxofstateandcontrolvariables10 x1(t) 10 (71)10 x2(t) 10 (72)10 u(t) 10 (73)(74)Theanalyticalsolutionofthisproblemisx1(t) =cosh(1 t)cosh(1)u(t) = (tanh(1 t) + 0.5) cosh(1 t)cosh(1)(75)3.1 SolutionbyHermiteSimpsonmethodThisproblemissolvedbyusingtheMATLABfunctionfminconwithinterior-point algorithm. Thenal optimized results are plotted in Figure 11, where the discrete values of x1, u as well as the analyticalcontinuetimehistoryofx1a,uaareplotted. InFigure11(c)itcanbeseenthattheerrorofx1ismuchlowerthanthatof u(1010forx1vs105foru). Thisisbecausethe3rd-orderHermiteinterpolationpolynomial is implementedtoapproximatethestates, whilelinear interpolationis usedtomimicthecontrol curve. InFigure11(d),weintegrate dynamicsfrom theinitialcondition withtheoptimalcontrolhistory,andthenweplottheerrorofx1. Itcanbeseenthattheerrorofx1inthewholetimedomain[0, 1]isbelow105.3.2 Improvingsolutionaccuracyandcomputational eciencyFminconuses thenitedierences methodasthedefault optiontoobtainthegradientinformation,however computational eciency can be remarkably improved by adding analytical Jacobian and Hessian.Thecomparison of3dierentcasesislistedinTable3.Table3: ImprovementwithJacobianandHessian,100points.Case Method No.ofiterations CPUtime1 nitedierences(default) 116 17.2s2 Jacobianonly 116 8.7s3 JacobianandHessian 12 0.38sAll of thethreecaseslistedaboveusethesame100discretepoints. Incase1, thedefault nite-dierences method is implemented to aord the gradient information, the simulation takes 116 steps andis17.2 slong. In case2,addingJacobian onlydoesnotreducethenumberofiterationsbutsaves almost16Dynamics Obj. fcn. b. c. init., nal time0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10.70.80.9(a) discrete solution and analytical time history of x1 x1ax10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1!2!10(b) discrete solution and analytical time history of u uau0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1!15!10!50(c) error of x1 and u located at discrete pointslog10(abs(error)) x1 erroru error0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1!15!10!50(d) re!integrate dynamics with discrete control solutiontimelog10(abs(error)) x1 errorFigure11: SimulationresultsofExample1,100points.half of theCPU time(17.2 s vs 8.7 s). In case 3, providing analytical Jacobin and Hessian highly reducesboththenumberofiterationsandthecomputationaltime,whichdropsdramaticallydownto0.38s.The structure of Jacobian is shown in Figure 3.2(a), where the rows are constraints while the columnsareNLPdecisionvariables. ThemaindiagonalelementsareJacobianofcollocationconstraintsandthelasttwolinesareJacobianof boundaryconstraints. Figure3.2(b)illustratesthestructureof Hessian,whereboththerowandcolumnrepresentNLPdecisionvariables. ItcanbeseenthatHermite-SimpsonmethodhasahighlysparseJacobian andHessianstructure.0 50 100 150 200 250 300020406080100120140160180200300 decision variables200 constraints(a)Jacobianstructure,100points.0 50 100 150 200 250 300050100150200250300300 decision variables300 decision variables(b)Hessianstructure,100points.BecauseonlyfewelementsinFigure3.2andFigure3.2arevaluable,sparsematrixtechniquecanbecarriedouttosavenitememory(Asparsematrixisamatrixlledprimarilywithzeros, theoppositeisrefertoasdensematrix). Whenhugenumberof nodesareusedtogetasmoothstateandcontroltimehistory, outofmemoryproblemcanbeavoidedbyusingsparsity. Anotheradvantageisthatthecomputationtimewillbereduced,becauseMATLABwillonlymanipulatenonzeroelements.17Indirect Methods: Remarks!Main Difculties: Deriving Euler-Lagrange equations and transversality conditions for the problem at hand Nonlinearity of the dynamics Solution of the DAE system itself Solution of the boundary value problem on the DAE system Lack of a plain physical meaning of Lagrange multipliers# difculty at identifying good rst guesses for Lagrange# multipliers (primer vector theory)Optimal Control Problem!Given a dynamical system: !Determinewhich minimize the performance index:!and satisfy the constraints:!Two classical solution methods: Indirect methods: based on reducing the optimal control problem to a Boundary Value Problem (BVP)Direct methods: based on reducing the optimal control problem to a nonlinear programming problem u(t)Nonlinear Programming Problem!Generally constrained optimization problem#Given a function Minimize: Subject toequality constraints: andinequality constraints: wherecan exceed f(x)f(x) = f(x1, x2, ..., xv)JKck(x) = 0, k = 1, ..., Kgj(x) 0, j = 1, ..., J(K v)J vUnconstrained Optimization (1/6)!Minimize: f(x)!The necessary condition for the identication of the optimum is:x f= 0The optimization problem in the variablesis reduced to the solution of a system ofnonlinear equations Note: given the Hessian of , , a sufcient condition is:vv x!The solution can be found using the Newton methodf Hfx Hfx > 0, xNewton Method (1/3)!Consider the problem:F(x) = 0!The Newton method is an iterative method based on a linearization of around the current iterate 1. Select an initial guess 2. Consider the rst order approximation of 3. Find the correction: 4. Update current iterate and repeat from 2 until convergence#F xFF(x) F( x) +F

( x) (x x) = 0x = (x x) = [F( x)]1 F( x)!Since it is based on a rst order approximation of the method is local xFDifferent rst guesses might lead to different solutionsFx0,2x1,2$ xNewton Method (2/3)!Graphical interpretation:xF x0$ xx1x2$ xx0,1$ xx1,1 x0,3$ xNewton Method (3/3)!Classical methods to stabilize the iteration Line Search: Instead of updating the current iterate using Reduce the step size using a parameter : whereis chosen such that Trust region: The direction of the computed is slightly modied xnew = x +x xnew = x +x||F( xnew)|| ||F( x)||xUnconstrained Optimization (2/5)Newton algorithm: !Select an initial guess !While stopping criterion is not satised Find the corrections to the current solution by solving the linear system where is the Hessian of :Update the current solution:xxHfx = x fHf= 2x fHffx +x x!Solve:x f= 0Unconstrained Optimization (3/5)Important note: !Consider the following optimization problem Minimize the quadratic form: Necessary optimality conditions: which can be written as:12xTHfx +x fTxHfx +x f= 0Hfx = x fFinding the corrections, i.e. the search direction, in the original optimization problem is equivalent to minimizing the previous quadratic formxUnconstrained Optimization (4/5)!Given the function to be minimized,, each iteration of the Newton method is equivalent to: Approximatearound the current solution with a quadratic form Find the offset, , to the zero-gradient point of the quadratic form Use as a correction in the original optimization problem f(x)fxxxxobjx0$ xx1x2$ x...Unconstrained Optimization (5/5)f(x1, x2) =12(x21 + x22)example1.mexample2.mexample3.mf(x1, x2) = 5 x1 + e(x1+5)+ x22Assignment #3! Numerically re-compute the three unconstrained optimizations in the previous slide; i.e., ! Advice ! Use Matlab built-in fminunc ! Code a SQP solverf(x1, x2) =12(x21 + x22)f(x1, x2) = 5 x1 + e(x1+5)+ x22Earth-Mars 2-impulse Transfer (1/3)!Optimization variables: departure date and time of ightt0ttof!Compute the positions of the starting and arrival planets through the ephemerides evaluation:(rE, vE) = eph(t0, Earth)(rM, vM) = eph(t0 + ttof, Mars),!Solve the Lamberts problem to evaluate the escape velocity and the arrival one v1v2!Objective function:V= V1+V2Earth-Mars 2-impulse Transfer (2/3)!Minimize: f(x) = V (x) = V (t0, ttof)!Necessary conditions for optimality: x f= 0V t0= 0V ttof= 0!In a generic iteration, given the current estimate#, evaluate the corrections :Hfx = x fx = {t0, ttof}x = {t0, ttof}where is:2V2t02Vt0ttof2Vttoft02V2ttofHfEarth-Mars 2-impulse Transfer (3/3)!Search space:ttof [100, 600] dayt0 [0, 1460] MJD2000=4 yearsobjective functionexampleEM.mEquality Constrained Optimization (1/5)!Minimize: Subject to:f(x)!The classical approach to the solution of the previous problem is based on the method of Lagrange multipliers#!Introduce the Lagrange function:Method of Lagrange multipliers:whereis a function of thevariablesand the Lagrange multipliers#L v x Kck(x) = 0, k = 1, ..., KL(x, ) = f(x) T c(x)(K v)Equality Constrained Optimization (2/5)!The necessary conditions for the identication of the optimum are:whereis the Jacobian of The constrained optimization problem in the variables has been reduced to the solution of a system of equations in the variables L(x, ) = c(x) = 0C(x) c(x)xvv +Kv +K (x, )x L(x, ) = x f(x) CT(x) = 0!Solution by Newton method#Equality Constrained Optimization (3/5)Algorithm: !Select an initial guess !While stopping criterion is not satised Find the corrections to the current solution by solving the linear system whereUpdate the current solution:(x, )(x, )(x, ) (x +x, +)Karush-Kuhn-Tucker (KKT)

HLCTC 0 x =x fcHL = 2xx f K

k=1k2xx ckEquality Constrained Optimization (4/5)Important note: !Consider the following optimization problem: Minimize the quadratic form: Subject to the linear constraints:12xTHLx + (x f)TxCx = c!Use the approach of Lagrange multipliers Lagrange function:12xTHLx + (x f)Tx T (Cx + c)Equality Constrained Optimization (5/5)Necessary optimality conditions:Cx +c = 0which can be written as:HLx +x f CT = 0

HLCTC 0 x =x fcKarush-Kuhn-Tucker (KKT)Finding the corrections , i.e. the search direction, in the original optimization problem using the KKT system is equivalent to minimizing the previous quadratic form(x, )Inequality Constrained Optimization!Minimize: Subject to:f(x)gj(x) 0, j = 1, ..., JA possible approach !Interior Point Method:The inequality constraints are added to the objective function as a penalty term f(x) = f(x) +J

j=1j egj(x)Solution is forced to move into the set of feasible solutions by means of the barrier functionegjAssignment #4! Solve the NLP problem(*) ! Using Matlab built-in fmincon ! Use SQP algorithm, quasi-Newton update, and line search ! Set solution tol, function tol, constraint tol to 1e-7 ! Specify initial guess to x0 = (1, 1, 1) ! Make sure g2 is treated as linear constraint by fmincon ! Solve w/o providing gradient of obj fcn and constraints; then re-do by providing analytic gradients ! Repeat optimization from a different x0; do we find the same optimal solution found previously? Why?IC-32 Optimal Control Winter2006BenotChachuatMEC2401,Ph: 33844,[email protected]#3(WithCorrections)1. Consider thefollowing NLPproblem:minxIR3f(x) := x21 + x1x2 + 2x226x12x212x3(1)s.t. g1(x) := 2x21 + x22 15g2(x) := x12x2x3 3x1, x2, x3 0. (2)(a) Find an optimal solutionxto this problem using the functionfmincon in MATLAB s OptimizationToolbox: MakesurethatthemediumscaleSQPalgorithm,withQuasi-Newtonupdateandline-search,istheselectedsolverinfmincon; Setthe solution point tolerance, function tolerance and constraint tolerance infmincon to 107; Specifytheinitialguessas x0=

1 1 1

T; Makesurethattheinequalityconstraintg2istreatedasalinearconstraintbyfmincon; Solve the NLP by using a nite-dierence approximation of the gradients of the objective functionand constraints rst. Then, resolve the problem by providing explicit expressions for the gradientsoftheobjectivefunctionandconstraints(askfmincon tocheckforthegradientsbeforerunningtheoptimizationinthislattercase); Makesurethatthesolverterminatedsuccessfullyineachcase.Solution.Apossibleimplementation(withanalyticexpressions forthegradients) isasfollows:exm1.m1 clear all2 options = optimset(Display, iter, GradObj, on, ...3 GradConstr, on, DerivativeCheck, on, ...4 LargeScale, off, HessUpdate, bfgs, ...5 Diagnostics, on, TolX, 1e-7, ...6 TolFun, 1e-7, TolCon, 1e-7,7 MaxFunEval, 100, MaxIter, 100 )8 x0 = [ 1; 1; 1 ];9 xL = [ 0; 0; 0 ];10 A = [ -1 2 1 ];11 b = [ 3 ];1213 %Solve NLP Problem14 [xopt, fopt, iout ] = fmincon( @exm1_fun, x0, A, b, [], [], xL, [], ...15 @exm1_ctr, options );1(*) B. Chachuat, Nonlinear and Dynamic Optimization, EPFLDirect Methods!The core of the reduction of the optimal control problem to a nonlinear programming problem is: The parameterization of all continuous variables The transcription of the differential equations describing the dynamics, into a nite set of equality constraints##Classical transcription methods: -Collocation-Multiple Shooting The original optimal control problem is solved within the accuracy of the parameterization and the transcription method used!Direct methods are based on reducing the optimal control problem to a nonlinear programming problem Parameterization!The parameterization is based on the discretization of the continuous variables on a mesh, typically settled up on the time domain Discretize the time domain as: Discretize the states and the controls over the previous mesh by dening and Consequently, a new vector of variables can be dened:t0 = t1< t2< ... < tN= tfxk = x(tk) uk = u(tk)u(t)x(t){x1, x2, ..., xN}{u1, u2, ..., uN}X = {tf, x1, u1, ..., xN, uN}But, then: Transcription: Collocation (1/2)!Collocation methods are based on the transcription of the differential equations into a nite set of defects constraints using a numerical integration scheme!Simplest case: Eulers scheme Solution is approximated using a linear expansiontxt it i+1x ix i,ex i+1which can be written in terms of defects constraints:xi+1 = xi + x(ti) (ti+1ti)= xi + x(ti) hxi+1 = xi + h f(xi, ui, ti)hi = xi+1xih f(xi, ui, ti) = 0!The optimal control problem has been parameterized: andTranscription: Collocation (2/2)!Other numerical integration schemes can be applied Runge-Kutta schemes:x(t) u(t) X = {tf, x1, u1, ..., xN, uN}Minimize:J(X)Dynamics:Minimize:Subject to: h(X) = 0ciao ciao ciao hi = xi+1xihik

j=1jfij = 0Nonlinear Programming ProblemTranscription: Multiple Shooting (1/2)!Time domain in discretized:t0 = t1< t2< ... < tN= tf!Within each time interval, splines are used to model the control prole each time interval containssubintervals, whereis the number of points dening the splinesu(t) M 1M!On a generic node, the vector of variables will be:Xi = {xi, u1i , ..., uM1i}u1i1u2i1u...i1uM1i1uM1iu...iu2iu1iRK integrationRK integration uititi+1 ti1xi1xixi+1xcixiTranscription: Multiple Shooting (2/2)!Within a generic time interval, the splines are used to map the discrete valuesinto continuous functions {u1i , ..., uM1i}u(t)Numerical integration can be used to compute xci+1!The dynamics is transcribed into a set of defects constraints:hi = xci xi = 0!The vector of variables for the nonlinear programming problem is:X = {tf, X1, ..., XN}u1i1u2i1u...i1uM1i1uM1iu...iu2iu1iRK integrationRK integration uititi+1 ti1xi1xixi+1xcixiAssignment #5! Solve Problem #1 with direct transcription and collocation3 Example1: ASimpleOptimal Control ProblemInthissection, asimpleoptimal control problemissolvedwithHermiteSimpsonmethod, andcertainissues are set to speed-up the computation time and improving accuracy. Consider the problem of ndingu(t)withxedinitialandnaltime[0, 1]tominimizethecostJ= x2(1) (68)subjecttosystemequations x1= 0.5x1 + u x2= u2+ x1u +54x21(69)andtotheboundaryconditionsx1(0) = 1x2(0) = 0(70)withthefollowingboundboxofstateandcontrolvariables10 x1(t) 10 (71)10 x2(t) 10 (72)10 u(t) 10 (73)(74)Theanalyticalsolutionofthisproblemisx1(t) =cosh(1 t)cosh(1)u(t) = (tanh(1 t) + 0.5) cosh(1 t)cosh(1)(75)3.1 SolutionbyHermiteSimpsonmethodThisproblemissolvedbyusingtheMATLABfunctionfminconwithinterior-point algorithm. Thenal optimized results are plotted in Figure 11, where the discrete values of x1, u as well as the analyticalcontinuetimehistoryofx1a,uaareplotted. InFigure11(c)itcanbeseenthattheerrorofx1ismuchlowerthanthatof u(1010forx1vs105foru). Thisisbecausethe3rd-orderHermiteinterpolationpolynomial is implementedtoapproximatethestates, whilelinear interpolationis usedtomimicthecontrol curve. InFigure11(d),weintegrate dynamicsfrom theinitialcondition withtheoptimalcontrolhistory,andthenweplottheerrorofx1. Itcanbeseenthattheerrorofx1inthewholetimedomain[0, 1]isbelow105.3.2 Improvingsolutionaccuracyandcomputational eciencyFminconuses thenitedierences methodasthedefault optiontoobtainthegradientinformation,however computational eciency can be remarkably improved by adding analytical Jacobian and Hessian.Thecomparison of3dierentcasesislistedinTable3.Table3: ImprovementwithJacobianandHessian,100points.Case Method No.ofiterations CPUtime1 nitedierences(default) 116 17.2s2 Jacobianonly 116 8.7s3 JacobianandHessian 12 0.38sAll of thethreecaseslistedaboveusethesame100discretepoints. Incase1, thedefault nite-dierences method is implemented to aord the gradient information, the simulation takes 116 steps andis17.2 slong. In case2,addingJacobian onlydoesnotreducethenumberofiterationsbutsaves almost163 Example1: ASimpleOptimal Control ProblemInthissection, asimpleoptimal control problemissolvedwithHermiteSimpsonmethod, andcertainissues are set to speed-up the computation time and improving accuracy. Consider the problem of ndingu(t)withxedinitialandnaltime[0, 1]tominimizethecostJ= x2(1) (68)subjecttosystemequations x1= 0.5x1 + u x2= u2+ x1u +54x21(69)andtotheboundaryconditionsx1(0) = 1x2(0) = 0(70)withthefollowingboundboxofstateandcontrolvariables10 x1(t) 10 (71)10 x2(t) 10 (72)10 u(t) 10 (73)(74)Theanalyticalsolutionofthisproblemisx1(t) =cosh(1 t)cosh(1)u(t) = (tanh(1 t) + 0.5) cosh(1 t)cosh(1)(75)3.1 SolutionbyHermiteSimpsonmethodThisproblemissolvedbyusingtheMATLABfunctionfminconwithinterior-point algorithm. Thenal optimized results are plotted in Figure 11, where the discrete values of x1, u as well as the analyticalcontinuetimehistoryofx1a,uaareplotted. InFigure11(c)itcanbeseenthattheerrorofx1ismuchlowerthanthatof u(1010forx1vs105foru). Thisisbecausethe3rd-orderHermiteinterpolationpolynomial is implementedtoapproximatethestates, whilelinear interpolationis usedtomimicthecontrol curve. InFigure11(d),weintegrate dynamicsfrom theinitialcondition withtheoptimalcontrolhistory,andthenweplottheerrorofx1. Itcanbeseenthattheerrorofx1inthewholetimedomain[0, 1]isbelow105.3.2 Improvingsolutionaccuracyandcomputational eciencyFminconuses thenitedierences methodasthedefault optiontoobtainthegradientinformation,however computational eciency can be remarkably improved by adding analytical Jacobian and Hessian.Thecomparison of3dierentcasesislistedinTable3.Table3: ImprovementwithJacobianandHessian,100points.Case Method No.ofiterations CPUtime1 nitedierences(default) 116 17.2s2 Jacobianonly 116 8.7s3 JacobianandHessian 12 0.38sAll of thethreecaseslistedaboveusethesame100discretepoints. Incase1, thedefault nite-dierences method is implemented to aord the gradient information, the simulation takes 116 steps andis17.2 slong. In case2,addingJacobian onlydoesnotreducethenumberofiterationsbutsaves almost163 Example1: ASimpleOptimal Control ProblemInthissection, asimpleoptimal control problemissolvedwithHermiteSimpsonmethod, andcertainissues are set to speed-up the computation time and improving accuracy. Consider the problem of ndingu(t)withxedinitialandnaltime[0, 1]tominimizethecostJ= x2(1) (68)subjecttosystemequations x1= 0.5x1 + u x2= u2+ x1u +54x21(69)andtotheboundaryconditionsx1(0) = 1x2(0) = 0(70)withthefollowingboundboxofstateandcontrolvariables10 x1(t) 10 (71)10 x2(t) 10 (72)10 u(t) 10 (73)(74)Theanalyticalsolutionofthisproblemisx1(t) =cosh(1 t)cosh(1)u(t) = (tanh(1 t) + 0.5) cosh(1 t)cosh(1)(75)3.1 SolutionbyHermiteSimpsonmethodThisproblemissolvedbyusingtheMATLABfunctionfminconwithinterior-point algorithm. Thenal optimized results are plotted in Figure 11, where the discrete values of x1, u as well as the analyticalcontinuetimehistoryofx1a,uaareplotted. InFigure11(c)itcanbeseenthattheerrorofx1ismuchlowerthanthatof u(1010forx1vs105foru). Thisisbecausethe3rd-orderHermiteinterpolationpolynomial is implementedtoapproximatethestates, whilelinear interpolationis usedtomimicthecontrol curve. InFigure11(d),weintegrate dynamicsfrom theinitialcondition withtheoptimalcontrolhistory,andthenweplottheerrorofx1. Itcanbeseenthattheerrorofx1inthewholetimedomain[0, 1]isbelow105.3.2 Improvingsolutionaccuracyandcomputational eciencyFminconuses thenitedierences methodasthedefault optiontoobtainthegradientinformation,however computational eciency can be remarkably improved by adding analytical Jacobian and Hessian.Thecomparison of3dierentcasesislistedinTable3.Table3: ImprovementwithJacobianandHessian,100points.Case Method No.ofiterations CPUtime1 nitedierences(default) 116 17.2s2 Jacobianonly 116 8.7s3 JacobianandHessian 12 0.38sAll of thethreecaseslistedaboveusethesame100discretepoints. Incase1, thedefault nite-dierences method is implemented to aord the gradient information, the simulation takes 116 steps andis17.2 slong. In case2,addingJacobian onlydoesnotreducethenumberofiterationsbutsaves almost16Dynamics Obj. fcn. b. c. init., nal time0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10.70.80.9(a) discrete solution and analytical time history of x1 x1ax10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1!2!10(b) discrete solution and analytical time history of u uau0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1!15!10!50(c) error of x1 and u located at discrete pointslog10(abs(error)) x1 erroru error0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1!15!10!50(d) re!integrate dynamics with discrete control solutiontimelog10(abs(error)) x1 errorFigure11: SimulationresultsofExample1,100points.half of theCPU time(17.2 s vs 8.7 s). In case 3, providing analytical Jacobin and Hessian highly reducesboththenumberofiterationsandthecomputationaltime,whichdropsdramaticallydownto0.38s.The structure of Jacobian is shown in Figure 3.2(a), where the rows are constraints while the columnsareNLPdecisionvariables. ThemaindiagonalelementsareJacobianofcollocationconstraintsandthelasttwolinesareJacobianof boundaryconstraints. Figure3.2(b)illustratesthestructureof Hessian,whereboththerowandcolumnrepresentNLPdecisionvariables. ItcanbeseenthatHermite-SimpsonmethodhasahighlysparseJacobian andHessianstructure.0 50 100 150 200 250 300020406080100120140160180200300 decision variables200 constraints(a)Jacobianstructure,100points.0 50 100 150 200 250 300050100150200250300300 decision variables300 decision variables(b)Hessianstructure,100points.BecauseonlyfewelementsinFigure3.2andFigure3.2arevaluable,sparsematrixtechniquecanbecarriedouttosavenitememory(Asparsematrixisamatrixlledprimarilywithzeros, theoppositeisrefertoasdensematrix). Whenhugenumberof nodesareusedtogetasmoothstateandcontroltimehistory, outofmemoryproblemcanbeavoidedbyusingsparsity. Anotheradvantageisthatthecomputationtimewillbereduced,becauseMATLABwillonlymanipulatenonzeroelements.17! UseEul ermethodfordi rect transcription ! Provide analytic gradients and zero initial guess ! Comparenumericalvsanalytical solution ! Maketrade-offbetweenCPUtime and solution accuracyLow-Thrust Earth-Mars Transfer (1/2)!Optimal control problem: Given the dynamics of the controlled 2 body problem:Minimize:r = r3 r + uSubject to:vErEv1rMvMv2r(t0) = rE(t0)r(tf) = rM(tf) v(tf) = vM(tf)v(t0) = vE(t0)!Transcription technique: Simple shootingNote: Simple shooting is multiple shooting when N= 1Low-Thrust Earth-Mars Transfer (2/2)!Cubic splines for built on four points u(t) M = 4!Earths ephemerides are used to set i.c. for the integration of the shooting methodconstraints on automatically satised!Optimization variables:,, ( ) t0tfu1, ..., u4x0!First guess: ballistic Lamberts arcrst guess solutiondim(X) = 14 ,Formation reconf.Subject to:Controlled Traj. in Relative DynamicsGiven the equations of the relative dynamics: x 2n y 3n2x = 0 y + 2n x = 0 z + n2z = 0Minimize:r(t0) = r0v(t0) = v0v(tf) = vfr(tf) = rfNote:,Formation depl.r(t0), v(t0) = 0 r(tf), v(tf) = 0r(t0), v(t0) = 0 r(tf), v(tf) = 0r(t0), v(t0) = 0,Docking r(tf), v(tf) = 0Formation Flying Deployment!Transcription technique: Simple shooting!Cubic splines for built on six points u(t)M = 6!First guess: u(t) = 0!Reference orbit: a = 26570 kmMars Aero-Gravity Assist (1/4)Gravity assist Aero-Gravity AssistMars Aero-Gravity Assist (2/4)!Dynamics:R = Vsin =Vcos cos Rcos =Vcos sin RV =DmGsin V =Lcos mGcos +V2cos RV =Lsinmcos V2tancos cos R!Control parameters: Bank angle ! = CL /CL((L/D)max) Atmospheric entry conditions Planar maneuverMars Aero-Gravity Assist (3/4)!Optimal control problemFind the optimal control law, !(t), the free atmospheric entry conditions and the nal timeto Maximize: -Final heliocentric velocity##V+sSubject to: -atmospheric entry conditions must be consistent with entry conditions in planetary sphere of inuence (

assigned ) -Convective heating at stagnation point qw0=1.35e 8

rn

1/2V3.04

1 hwH

V< q maxw0tfMars Aero-Gravity Assist (4/4)!Transcription technique: Multiple Shooting , Cubic splines First guess using simple#shooting and evolutionary#algorithms0 100 200 300 400 500 600543210Time [s]

Soln 3Soln 2Soln 1 u1i1u2i1u...i1uM1i1uM1iu...iu2iu1iRK integrationRK integration uititi+1 ti1xi1xixi+1xcixiN= 11 M = 4dim(X) 1000 100 200 300 400 50020406080100120Time [s]h [km]Soln 3 Soln 2Soln 1Subject to: -

-

- Maximize:,GTOC II (1/3)!Optimal control problem: Given the dynamics of the controlled 2 body problem:r = r3 r + uVisit four given asteroidsmf= m0 e1Ispg0Rtft0|u|dr(tdep,P) = rP(tdep,P) v(tdep,P) = vP(tdep,P)v(tarr,P ) = vP (tarr,P ) r(tarr,P ) = rP (tarr,P )J = mf/(tf t0)u umaxtdep,Pi tarr,Pi1 90 daysGTOC II (2/3)!Transcription technique: Collocation!Optimization variables: -Four departure epochs (Earth and three asteroids) -Four transfer times -Control parameters deriving from transcription -State parameters deriving from transcriptiondim(X) 1000GTOC II (3/3)!Identied solution:Collocation methods can better describe discontinuitiesMultiple Shooting vs Collocation!Both Multiple Shooting and Collocation can be considered robustmethods, even if highly nonlinear dynamics must be dealt with!Advantage of Collocation w.r.t. Multiple Shooting: Better management of discontinuities of the control functions!Disadvantage of Collocation w.r.t. Multiple Shooting: Higher number of variablesDirect Methods vs Indirect Methods!Main Advantages of Direct Methods: No need of deriving the equations related to the necessary conditions for optimality More versatility and easier implementation in black-box tools!Main Disadvantage of Direct Methods: Need of numerical techniques to effectively estimate Hessians and Jacobians!Approximate methods Avoid both indirect and direct Suboptimal solutionsu(t), t [ti,tf ], x = f(x, u, t),J = (x(tf), tf) +

tftiL(x, u, t) dtx(ti) = xi(x(tf), u(tf), tf) = 0x = (x1, x2, . . . , xn)u = (u1, u2, . . . , um)Denition of the original problemminimizingwith dynamicsand boundary conditionsNote:controlsaturation,pathconstraints,variable final time, etc., not considered for simplicityFind x =H = HxHu= 0H(x, , u, t) = L(x, u, t) +Tf(x, u, t)(tf) =

x +

x

T

t=tfx(ti) = xix(t), (t), u(t), Solution of the original problemthat satisfy the necessary conditionsunder(x(tf), u(tf), tf) = 0Hamiltonian of the problemIterative methods used to solve (1) !Convergence depends on initial guess !Guessingis not trivial (no physical meaning) !Difficult to treat (algebraic-differential system) !Deep knowledge of the problem required(1)iWhy approximate methods Avoid solving problem (1) Transform problem (1) into a simpler problem Ease the computation of solutions Deliver sub-optimal solutions Examples !Direct transcription [Hargraves&Paris 1987, Enright&Conway, Betts 1998] !Generating function [Park&Scheeres, 2006] !SDRE [Pearson 1962, Wernli&Cook 1975, Mracek&Cloutier 1998] !ASRE [Cimen&Banks 2004] !... x = A(t)x + B(t)u,J =12xT(tf)S(tf)x(tf) + 12

tfti

xTQ(t)x +uTR(t)u

dt, x = A(t)x +B(t)u, = Q(t)x AT(t),0 = R(t)u +BT(t), u = R1(t)BT(t)x(ti) = xi(Time Varying) LQRDynamics:Objective function:Necessary conditions of optimality

x

=

A(t) B(t)R1(t)BT(t)Q(t) AT(t) x

Linear system of 2n differential equations(2)Initial condition:!Ifwas known, it would be possible to compute through (3), andwith !computed by using (3) and the final condition (3 types)xi, ixx, x, x, (ti, t) =

xx(ti, t) x(ti, t)x(ti, t) (ti, t)

xxxx

=

A(t) B(t)R1(t)BT(t)Q(t) AT(t) xxxx

xx(ti, ti) = Inn, x(ti, ti) = 0nn, x(ti, ti) = 0nn, (ti, ti) = InniSolution of TVLQR by the STMExact solution of system (2):(initial state, costate)are the componentsof the state transition matrix (STM)STM subject towithx(t) = xx(ti, t)xi +x(ti, t)i,(t) = x(ti, t)xi +(ti, t)i,(3)x(t), (t)u(t) u = R1(t)BT(t)iLQR solver available at http://www.astrodynamics.eu/Astrodynamics.eu/Software.htmlSolveLQR.mSolving a HCP requires inverting thematrixWrite the first of (3) at,x(tf) = xf x = A(t)x + B(t)u,J =12

tfti

xTQ(t)x +uTR(t)u

dt,t = tfxf= xx(ti, tf)xi +x(ti, tf)i,x(ti) = xii(xi, xf, ti, tf) = 1x(ti, tf) [xf xx(ti, tf)xi]in n xHard constrained problem (HCP)!Final state givenStatement of HCPand solve for ; i.e., J =12xT(tf)S(tf)x(tf) + 12

tfti

xTQ(t)x +uTR(t)u

dtx(ti) = xi, (tf) = S(tf)x(tf),x(tf) = xx(ti, tf)xi +x(ti, tf)i,S(tf)x(tf) = x(ti, tf)xi +(ti, tf)ii(xi, ti, tf) = [(ti, tf) S(tf)x(ti, tf)]1[S(tf)xx(ti, tf) x(ti, tf)] xi[(ti, tf) S(tf)x(ti, tf)]Soft constrained problem (SCP)Solving a SCP requires inverting thematrixWrite (3) at, x = A(t)x + B(t)u,t = tf!Final state not givenStatement of SCPand solve for ; i.e., in nSolving a SCP requires inverting the matrices andWrite (3) at, write, and solve for using(HCP) and for using (SCP); i.e.,j(tf) = S(tf)xj(tf), xi(tf) = xi,f,Statement of MCP (given,free) xixjJ =12xTj (tf)S(tf)xj(tf) + 12

tfti

xTQ(t)x +uTR(t)u

dti = (i,i, i,j)Ti,ixi,fi,j j(tf) = S(tf)xj(tf)x,i[,j(ti, tf) S(tf)x,j(ti, tf)]1Mixed constrained problem (MCP)!Some components of final state given (and some not)x(ti) = xi, x = A(t)x + B(t)u,t = tfi,i(xi,i, xf,i, ti, tf)=1x,i(ti, tf) [xf,ixx,i(ti, tf)xi,i] ,i,j(xi,j, ti, tf)=[,j(ti, tf) S(tf)x,j(ti, tf)]1[S(tf)xx,j(ti, tf) x,j(ti, tf)] xi,jsuch that for given argumentsthey depend on time only; i.e., x = A(x, t)x + B(x, u, t)u,J =12xT(tf)S(x(tf), tf)x(tf) + 12

tfti

xTQ(x, t)x +uTR(x, t)u

dtA(x, t), B(x, u, t), Q(x, t), R(x, t)x(t), u(t)A(x(t), t), B(x(t), u(t), t), Q(x(t), t), R(x(t), t) A(t), B(t), Q(t), R(t)Idea of the method Re-write the nonlinear problem as x = f(x, u, t),J = (x(tf), tf) +

tftiL(x, u, t) dtoriginal dynamics factorized dynamicsoriginal objective functionfactorized objective functionIdea: to use state-dependent matricesIteration i - Findsatisfying Problem iIteration 0 - Findsolving Problem 0x(0)(t), u(0)(t) x(0)= A(xi, t)x(0)+ B(xi, 0, t)u(0), x(i)= A(x(i1)(t), t)x(i)+ B(x(i1)(t), u(i1)(t), t)u(i),x(i)(t), u(i)(t)

x = xi, u = 0

x = x(i1), u = u(i1)

J =12x(0)T(tf)S(xi, tf)x(0)(tf) + 12

tfti

x(0)TQ(xi, t)x(0)+u(0)TR(xi, t)u(0)

dtJ=12x(i)T(tf)S(x(i1)(tf), tf)x(i)(tf)+12

tfti

x(i)TQ(x(i1)(t), t)x(i)+u(i)TR(x(i1)(t), t)u(i)

dtThe algorithm: iterations||x(i)x(i1)|| = maxt[ti, tf]{|x(i)j(t) x(i1)j(t)|, j = 1, . . . , n} The algorithm: convergenceProblem i = TVLQR!Each problem corresponds to a time-varying linear quadratic regulator (TVLQR) !The method requires solving a series of TVLQR!Iterations terminate when, for given ,thedifferencebetweeneachcomponentof thestate,evaluatedforalltimes,changesby less thanbetween two successive iterationsNumerical examples ! Low-thrust dynamics in central vector field ! Low-thrust rendez-vous ! Low-thrust orbital transfer ! Low-thrust stationkeeping of GEO satellites x1= x3, x2= x4, x3= 2x4(1 + x1)(1/r31) + u1, x4= 2x3x2(1/r31) + u2,x = (x1, x2, x3, x4) u = (u1, u2)r =

(x1 + 1)2+ x22xi = (0.2, 0.2, 0.1, 0.1)____ x1 x2 x3 x4____ =__0 0 1 00 0 0 1f(x1, x2)(1 + 1/x1) 0 0 20 f(x1, x2) 2 0__. .A(x)____x1x2x3x4____+__0 00 01 00 1__. .B_u1u2_f(x1, x2) = 1/[(x1 + 1)2+ x22]3/2+ 1! Rotating frame radial displacement transversal displacement ! Normalized units ! length unit = orbit radius ! time unit = x1x21/Rendez-vous: statement and factorizationDynamicswithFactorization (dynamics)withState Control Initial condition[Park&Scheeres, 2006]J =12

tftiuTudtxf= (0, 0, 0, 0), ti = 0, tf= 1J =12xT(tf)Sx(tf) + 12

tftiuTudtS = diag(25, 15, 10, 10), ti = 0, tf= 1Q = 044, R = I22 = 109x(tf) freeRendez-vous: HCP and SCP denitionHCP SCP! Termination toleranceFactorization (objective function)J =12xT(tf)S(tf)x(tf) + 12

tfti

xTQ(t)x +uTR(t)u

dtwith(S not defined in HCP)(valid for all examples show)! !"!# !"$ !"$# !"% !"%#!"!#!!"!#!"$!"$#!"%!"%#!"&'$'%!"# !"$ ! !"$ !"#!"#!"%!"$!"&!!"&!"$!"%'%'#! " # " ! $!%&!"%&"#%#%&'"'!1 2 3 4 50.9580.960.9620.9640.9660.968iterJ1 2 3 4 51086420itererrorRendez-vous: results (HCP)with r =_(x1 + 1)2+ x22.The initial condition isxi= (0.2, 0.2, 0.1, 0.1). Two different rendez-vous problems are solved to test the algorithmin both hard and soft constrainedconditions.Hard Constrained Rendez-Vous The HCP consists in minimizingJ=12_tftiuTudt (39)with the nal, given conditionxf= (0, 0, 0, 0)and ti= 0, tf= 1.Soft Constrained Rendez-Vous The SCP considers the following objective functionJ=12xT(tf)Sx(tf) +12_tftiuTudt (40)with S= diag(25, 15, 10, 10), ti= 0, and tf= 1.The dynamics (38) is factorized into the form of (8) as____ x1 x2 x3 x4____=__0 0 1 00 0 0 1f(x1, x2)(1 + 1/x1) 0 0 20 f(x1, x2) 2 0__. .A(x)____x1x2x3x4____+__0 00 01 00 1__. .B_u1u2_(41)with f(x1, x2) = 1/[(x1 +1)2+x22]3/2+ 1.Thus, the problem is put into the pseudo-LQR form(8)(9) by dening A(x) and Bas in (41), and by setting in Q = 044and R = I22.The two problems above have been successfullysolved with the ASRE method described above.Table1reportsthedetailsoftheHCPandSCP, whosesolutionsareshowninFigures1and2,respectively. InTable1, Jistheobjectivefunctionassociatedtotheoptimal solution, Iteristhenumberofiterationscarriedouttoconvergetotheoptimalsolution, andtheCPU Time(com-putational time)referstoanIntel Core2Duo2GHzwith4GBRAMrunningMacOSX10.6.The terminationtolerance in (14) is set to 109. (The machine specicationsand the terminationtolerance are valid for the other two problems presented next, too).Theoptimalsolutionsfoundreplicatethosealreadyknowinliterature,9, 10soindicatingtheef-fectiveness of the developed method.Table 1. Rendez-vous solutions detailsProblem J Iter CPU Time (s)HCP 0.9586 5 0.447SCP 0.5660 6 0.4927CPUTimereferredtoanIntel Core2Duo2GHzwith4GB RAM running Mac OS X 10.6x1x2x3x4u1u2iterJiterlog10xixfxixfSolveNL.m0.05 0.1 0.15 0.2 0.250.050.10.150.20.25x1x2!"# !"$ !"% ! !"% !"$!"$&!"$!"%&!"%!"!&!!"!&!"%'#'(!"# ! $"# $ $"# !%!"#!$"#$$"#&!&%1 2 3 4 5 60.5660.56650.5670.56750.5680.56850.5690.5695iterJ1 2 3 4 5 6121086420itererrorRendez-vous: results (SCP)with r =_(x1 + 1)2+ x22.The initial condition isxi= (0.2, 0.2, 0.1, 0.1). Two different rendez-vous problems are solved to test the algorithmin both hard and soft constrainedconditions.Hard Constrained Rendez-Vous The HCP consists in minimizingJ=12_tftiuTudt (39)with the nal, given conditionxf= (0, 0, 0, 0)and ti= 0, tf= 1.Soft Constrained Rendez-Vous The SCP considers the following objective functionJ=12xT(tf)Sx(tf) +12_tftiuTudt (40)with S= diag(25, 15, 10, 10), ti= 0, and tf= 1.The dynamics (38) is factorized into the form of (8) as____ x1 x2 x3 x4____=__0 0 1 00 0 0 1f(x1, x2)(1 + 1/x1) 0 0 20 f(x1, x2) 2 0__. .A(x)____x1x2x3x4____+__0 00 01 00 1__. .B_u1u2_(41)with f(x1, x2) = 1/[(x1 +1)2+x22]3/2+ 1.Thus, the problem is put into the pseudo-LQR form(8)(9) by dening A(x) and Bas in (41), and by setting in Q = 044and R = I22.The two problems above have been successfullysolved with the ASRE method described above.Table1reportsthedetailsoftheHCPandSCP, whosesolutionsareshowninFigures1and2,respectively. InTable1, Jistheobjectivefunctionassociatedtotheoptimal solution, Iteristhenumberofiterationscarriedouttoconvergetotheoptimalsolution, andtheCPU Time(com-putational time)referstoanIntel Core2Duo2GHzwith4GBRAMrunningMacOSX10.6.The terminationtolerance in (14) is set to 109. (The machine specicationsand the terminationtolerance are valid for the other two problems presented next, too).Theoptimalsolutionsfoundreplicatethosealreadyknowinliterature,9, 10soindicatingtheef-fectiveness of the developed method.Table 1. Rendez-vous solutions detailsProblem J Iter CPU Time (s)HCP 0.9586 5 0.447SCP 0.5660 6 0.4927CPUTimereferredtoanIntel Core2Duo2GHzwith4GB RAM running Mac OS X 10.6x1x2x3x4u1u2iterJiterlog10xi xix(tf)x(tf)SolveNL.m x1= x3, x2= x4, x3= x1x241/x21 + u1, x4= 2x3x4/x1 + u2/x1.J =12

tftiuTudtti = 0tf= xi = (1, 0, 0, 1)xf= (1.52, , 0,

1/1.52)xf= (1.52, 1.5, 0,

1/1.52)Orbital transfer: statementDynamicsx = (x1, x2, x3, x4) u = (u1, u2)State ControlInitial condition! Rotating frame (polar coordinates) radial distance angular phase ! Normalized units ! length unit = initial orbit radius ! time unit = (initial orbit)x1x21/Objective functionFinal conditionsProblem AProblem B12302106024090270120300150330180 012302106024090270120300150330180 0Orbital transfer: resultsFactorizationResultsA(x) =0 0 1 00 0 0 11/x310 0x1x40 0 2x4/x10, B(x) =0 00 01 00 1/x1, Q = 044, R = I22.The dynamics (42) and the objective function (43) are put in the form (8)(9) by deningA(x) =0 0 1 00 0 0 11/x310 0x1x40 0 2x4/x10, B(x) =0 00 01 00 1/x1, Q = 044, R = I22. (44)ThetwoHPChavebeensolvedwiththeASREmethod. ThesolutionsdetailsarereportedinTable 2 whose columns have the same meaning as in Table 1.It can be seen that more iterations andanincreasedcomputational burdenisrequiredtosolvethisproblem, especiallyforthecasewithx2,f= 1.5. The two solutions reported in Table 2 are shown in Figures 3 and 4.Table 2. EarthMars transfers detailsProblem J Iter CPU Time (s)x2,f= 0.5298 22 6.262x2,f= 1.5 4.8665 123 47.86512302106024090270120300150330180 0(a) Transfer trajectory.0 1 2 3 4-1-0.500.51TimeContol u1u2u(b) Control prole.Figure 3. Optimal EarthMars transfer (x2,f= ).12302106024090270120300150330180 0(a) Transfer trajectory.0 1 2 3 4-3-2-10123TimeContol u1u2u(b) Control prole.Figure 4. Optimal EarthMars transfer (x2,f= 1.5).9AB0 1 2 3 410.500.51TimeContol u1u2ucontroltime0 1 2 3 43210123TimeContol u1u2ucontroltimeProblem AProblem Bx = (x1, x2, x3, x4, x5, x6) x1= x4, x2= x5, x3= x6, x4= 1x21+ x1x26 + x1(x5 + 1) cos2x3 + a1(x1, x2, x3) + u1, x5= 2x6(x5 + 1) tanx32x4x1(x5 + 1) +a2(x1, x2, x3)x1 cos x3+u2x1 cos x3, x6= 2x4x1x6(x5 + 1)2sinx3 cos x3 +a3(x1, x2, x3)x1+u3x1,xi = (1, 0.05 180/, 0.05 180/, 0, 0, 0)xf,1 = 1 xf,jfree j = 2, . . . , 6 tf= u = (u1, u2, u3)x1x2x3Stationkeeping: statementti = 0DynamicsStateControlInitial conditionFinal conditionObjective function1/Q = diag(0, 1, 1, 1, 1, 1),R = diag(1, 1, 1),S = 100 diag(1, 1, 1, 1, 1)a1,a2,a3! Rotating frame (spherical coordinates) radial distance longitude deviation latitude ! Normalized units ! length unit = GEO radius ! time unit = (initial orbit) ! Reference longitude = 60 E ! Perturbations!free parameters ! Can vary in [0, 1]a41= 1x31+1x26 + (2x25 + 23x5 + 1) cos2x3, a56= [2 + 2(1 1)x5] tanx3,a45= [(1 2)x1x5 + 2(1 3)] cos2x3, a61= 12x1 sin2x3,a46= (1 1)x1x6, a64= 2(1 1)1x1x6,a54= 2x1 2(1 2)1x1x5, a65= [12x51] sin2x3,a55= 21x5 tanx322x4x1, a66= 21x4x11, 2, 3, 1, 2, 1Stationkeeping: factorizationA(x) =033I33a410 0 0 a45a460 0 0 a54a55a56a610 0 a64a65a66, B(x) =0331 0 001r2cos200 01r2Factorizationwith[Topputo&Bernelli-Zazzera 2011]Stationkeeping: results10 5 0 5x 1041.510.500.511.5x 104x2x30 5 10 15 20 25012x 103u10 5 10 15 20 25101x 103u20 5 10 15 20 25505x 104Timeu3x3x2u1u2u3time3rd CEAS Air&Space Conference. 21st AIDAA Congress, 2011, Venezia20 Manoeuver TFD TC TSK Free drift RESULTS Trajectory during 1 control cycle: TFD of 2.5 daysTC of 0.5 day free drift manoeuver start control end control ! Control cycle ! Free drift (2.5 days) ! Maneuver (0.5 day)1 month simulation! 1 yearstationkeeping simulated in [Topputo&Bernelli-Zazzera 2011]Final Remarks!All the previous numerical techniques for optimization are eventually based on the use of the Newton method:Direct methods Solution of the nonlinear system of equations related to the necessary conditions for optimalityIndirect methods Solution of the boundary value problem on the DAE systemThey suffer of the same disadvantages: Local convergence, i.e., they tend to converge to solutions close to the supplied rst guesses Need of good rst guesses for the solution! Note: global optimization is another matter!Approx methods Solution of TVLQR, no need of rst guess solution, but suboptimalSelected references!Indirect Methods: L. S. Pontryagin, V. G. Boltyanskii, R. V. Gamkrelidze, and E. F. Mishchenko, The Mathematical Theory of Optimal Processes, John Wiley & Sons, New York, NY, USA, 1962 Bryson, A.E., Ho, Y.C., Applied Optimal Control, Hemisphere Publishing Co., Washigton, 1975!Direct Methods: Enright,P.J.,andConway,B.A.,DiscreteApproximationtoOptimalTrajectoriesUsingDirect Transcription and Nonlinear Programming, J. of Guid., Contr., and Dyn., 15, 9941001, 1992 Betts, J.T., Survey of Numerical Methods for Trajectory Optimization, J. of Guid., Contr., and Dyn., 21, 193207, 1998 Betts, J. T., Practical Methods for Optimal Control Using Nonlinear Programming, Society for Industrial and Applied Mathematics, Philadelphia, PA, 2001 Conway, B.A., Space Trajectory Optimization, Cambridge University Press, 2010!ASRE Method: Cimen, T. and Banks, S.P., Global optimal feedback control for general nonlinear systems with nonquadratic performance criteria, Systems and Control Letters, vol. 53, no. 5, pp. 327346, 2004.