实例介绍
国外最优化控制软件GPOPS的英文说明书。
The GPOPS License applies to the software's source and object code and comes with any rights that I have in it(other than trademarks ). You agree to the G POPS License simply by downloading, copying distributing, or making a dcrivativc work of the softwarc. You get the royalty-frcc right to Use the software for any purpose Make derivative works of it(this is called a"Derived Work?) Copy anld distribute it and ally Derived Work If you distribute the software or a Derived Work, you must give back to the community by Prominently noting the date of any changes you make Leaving other peoples copyright notices, warranty disclaimers, and license terms in plac Providing the source code, build scripts, installation scripts, anld interface definitiOns in a forln that is easy to get and best, to modify Licensing it to everyone under the terms of this license agreement without adding further restrictions to the rights provided Conspicuously announcing that it is available under this license Restrictions for use and distribution of pops GPOPS is a conpletely free software both for use anld for redistributiOn. Furthermore, while it Inay be used within commercial organizations, it is not for sale or resale. The only exception to the sa.les restriction above is that GPOPS may be included as a part of a free open-source software(for example, a distribution of the Linux operating system). When distributing GPOPS with a free operating system, no fee beyond the price of the operating system itself may be added(that is, you cannot profit from the redistribution of GPOPS GPOPS is not for commercial use with the exception that it may be used by commercial organizations for internal research and development. Any use of GPOPS by commercial organizations that involve the presentation of results for profit-making purposes is strictly prohibited. In addition, there are some things that you must shoulder You get no warranties of any kind If the software damages you in any way, you may only recover direct damages up to the amount you paid for it(that is, you get zero if you did not pay anything for the software) YOu Illay lot recover anly other dalllages, including those called "conSequential danages. "(The state or country where you live may not a. ow you to limit your liability in this way, so this may not apply to you) The G POPS License continues perpetua. ly, except that your license rights end automatically if You do lot abide by the"give back to the CoIllIlunity"terls (your licensees get to keep their rights if they abide Anyone prevents you from distributing the software under the terms of this license agreement You sell the software in any manner with the one exception listed above In addition, to the license given above, the authors of GPOPS request that the following documents be cited in any publication where GPOPs was used to obtain the results (1)Rao, A.V., Benson, D.A., Darby, C. L, Patterson, M. A, Francolin, C, Sanders, I, and Huntington, G T," Algorithm 902: GPOPS, A MATLAB Software for Solving Multiple-Phase Optimal Control Prob lems Using the gauss Pseudospectral Met hod, ACM Transactions on Math ematical Software, Vol 37 No. 2, April-June, 2010, Article 22, 39 pages (2) Benson, D. A, Huntington, G. T, Thorvaldsen, T P, and Rao, A V, "Direct Tra jectory Optimization and Costate Estimation via an Orthogonal Collocation Method, Journal of guidance, Control, and Dynamics, Vol 29, No. 6, Novcmbcr-Dcccmbcr 2006. pp. 1435-1440 (3) Garg, D, Patterson, M. A, Darby, C. L, Francolin, C, Huntington, G. T, Hager, W. W, and Rao, A.V., Direct Trajectory Optimization and Costate Estimation of Finite-Horizon and Infinite-Horizon Optimal control problems using a radau pseudospectral Method, Computational Optimization and Applications, Vol 49, No 2, June 2011, pp. 335-358 (4)Garg, D, Patterson. M. A, Hager, W. w, Rao, A.V., Benson, D.A., and Huntington. G. T, "A Unified Framework for the Numerical Solution of Optimal Control Problems Using Pseudospectral Methods Automatica, Vol. 46, No. 11 November 2010, pp. 1843-1851 (5) Garg, D, Hager, W.W., and Rao, A. V, "Pseudospectral Methods for Solving Infinite-Horizon Optimal Control Problems, Automatica, Vol. 47, No. 4, April 2011, pp. 829-837 The GPOPS software is provided"as is"without warranty of any kind, expressed or implies, including but rot limited to the warranties o/ Merchantability, ilness / u parlicular purpose, and TlOT-inl/'ringenent. ITu no event shall the authors or copyright holders be liable for any claim, damages, or other liability whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or dealings in the software CONTENTS Contents 1 Int roduction to General Pseudospectral Optimization Software(GPOPS 1.1 Radau Pseudospectral Method Employed by GPOPS 1.2 Organization of GPOPS 666 1. 3 Notation Used Throughout Remainder of This manua 1. 4 Constructing an Optimal control problem in GPOPS 1.5 Preliminary Information 2 Constructing an Optimal Control Problem Using GPOPS 2.1 Syntax for Input Structure setup 8 2.2 Syntax for Structure setup funcs 9 2.3 Syntax for limits Structure 9 2.4 Syntax for linkages Array of Structures 13 2.5 Syntax of Each Function Specified in Structure setup funcs 14 2.6 Syntax of Cost Functional Specified in setup funcs cost 14 2.7 Syntax for Differential-Algebraic EquatiOns Function Specified in setup funcs. dae 15 2.8 Syntax of event Constraint Function Specified in setup funcs event 16 2.9 Syntax of Linkage Constraint Function Specified in setup funcslink 18 2. 10 Specifying an Initial Guess of The Solution 18 2.11 Scaling of Optimal Control problem 19 3 Specification of Parameters for Mesh Refinement 20 4 Different Options for Specification of Derivatives 20 4. 1 Complex- Step differentiation 21 4.2 Analytic Differentiation 21 5 Output from an Execution of GPOPS 27 6 Uscful Information for Debugging a GPOPS Problem 28 7 GPOPS Examples 28 7. 1 Hyper-Sensitive Problem 7.2 Bryson-Denham Problem 7.3 Multiplc-Stagc Launch Vchiclc Ascent Problcm 34 7.4 MinilluIn Tiine-to-Cliinb of a Supersonic Aircraft 45 8 Concluding Remarks 52 1 Introduction to General Pseudospectral optimization Software (GPOPS) Generul Pseudospectral Oplinizalion Software (GPOPS )is a software prograIn written in MATLABI(R for solving multiple-phase optimal control problems of the following form. Given a set of P phases(where p=1,., P), minimize the cost functional ∑1=∑[(p(),oxp(),q)+C(,m(),tq则)减 subject to the dynamic constraint 文(P)= the boundary conditions ≤o(x(o,t,x(r);q)≤ nax. the inequality path constraints nin <C ),u)(),t;qD)< maX and the phase continuity(linkage) constraints PIS( P1(t ),t to pi, p L where x(p)(t)E Rp, u(p(t)E RmE, q(p)E Rip, and tE R are, respectively, the state, control, static parameters, and time in phase pE,., P, L is the number of phases to be linked, PiE[1 1,,L) are the "left” phase numbers, and p∈[1,,P],(s-1.…,L) are the“ right” phase numbers While much of the time a user may want to solve a problem consisting of multiple phases, it is important. to note that the phases need not be sequential. To the contrary, any two phases may be linked provided that the independent variable does not change direction (i.e., the independent variable moves in the same direction during each phase that is linked. A schematic of how phases can potentially be linked is given in F 1.1 Radau Pseudospectral Method Employed by GPOPS The method employed by G POPS is the Radau Pseudospectral Method(RPM). The RPM is an ort hogona collocation method where the collocation points are the Legendre-Gauss-Radau points. The theory of the RPM can be found in 2,3,4,5, 6 Some of the interesting features of the RPM are as follows: (1)it is a Gaussian quadrature implicit integration scheme;(2) it has been demonstrated to converge exponentiall fast for problems whose solutions are smooth: 3) an elegant connection exists between the continuous-time optimal control problem and the discrete approximation; (4)it lends itself to the hp adaptive approach used in POPS 1.2 Organization of GPOPs GPOPS is organized as follows. In order to specify the optimal control problem that is to be solved the user must write MATLAB functions that define the following functions in each phase of the problem (1) the cost functional (2) the right-hand side of the differential equations and the path constraints(i.e, the differential-algebraic equations MATLAB is a registered trademark of The Mathworks, Inc, One Apple Hill, Natick, MA 1.2 Organization of GPOPS Phases 1 and 2 Connected Phases 2 and 3 Connected Phases 3 and 4 Connected Phases 2 and 5 Connected Phase 1 Phase 2 Phase 3 Phase 4 Phases time Figure 1: Schematic of linkages for multiple-phase optimal control problem. The example shown in the picture consists of five phases where the ends of phases 1, 2, and 3 are linked to the starts of phases 2, 3 and 4, respectively, while the enld of phase 3 is linked to the start of phase 5 (3) the boundary conditions (i.e, event conditions) (4) the linkage constraints (i.e, how the phases are connected) In addition, the user must also specify the lower and upper limits on every component of the following quantities (1) initial and terminal time of the phase (2)the state at the following points in time at the beginning of the phase during the phase at the end of the phase (3 the control (4)the static parameters (5) the path constraints (6 the boundary conditions (7)the phase duration (i.e, total length of phase in time) (8) the linkage constraints (i. e, phase-connect conditions It is noted that each of the functions must be defined for each phase of the problem. The remainder of this document is devoted to describing in detail the MATLAB( B syntax for describing the optial control problem and each of the constituent functions 1.3 Notation used throughout remainder of this manual 1.3 Notation Used Throughout Remainder of This Manual The following notation is adopted for usc throughout the rcmaindcr of this manual. First, all uscr-spccificd names will be denoted by slanted characters (not italic, but slanted). Second, any item denoted by boldface characters are pre-defined and cannot be changed by the user. Finally, users with color capability will see the slanted characters in red and will see the boldface characters in blue 1.4 Constructing an Optimal Control Problem in GPOPS We now proceed to describe the constructs required to specify an optimal control problem in GPOPS We notc that the kcy MAtLAB programming clements uscd in constructing an optimal control problcm in GPOPS are structure and arrays of structures 1.5 Preliminary Information Before proceeding to the details of setting up a problem in GPOPS, the following few preliminary details are useful. First, it is important to understand that the GPOPS interface is laid out in phases. Using a phase-based approach, it is possible to describe each segment of the problem independently of the other scgmcnts. The scgmcnts arc then linked togcthcr using linkagc conditions (or phasc-conncct conditions Second, it is important to note that GPOPS uses the vectorization capabilities of MATLAB. In this vein all matrices and vectors in GPOPS are oriented column-wuise for maximum efficiency. As you read through manual, please keep in mind the column-wise orientation of all matrices used in GPOPS 2 Constructing an Optimal Control Problem Using GPOPs In this Section we provide the details of constructing a problem using GPOPS. First, the call to GPOPS is deceptively simple and is given as follows output, gpops History]=gpops(setup) The input setup is a user-defined structure that contains all of the information about the optimal control problem to be solved. Finally, the variables output and gpopsHistory are a structure and an array of structures that contain, respectively, the information on the final run of the mesh refinement(output) and a complete history of the solutions on every mesh on which the problem was solved(gpops History). 3 1 Syntax for Input Structure setup The user-defined structure setup contains required fields and optional fields. The required fields in the structure setup are as follows: name: a string containing the name of the problem funcs: a structure whose elements contain the names of the user-defined function in the problem(see Section 2.2 below) limits: an array of structures that contains the information about the lower and upper limits on the variables and constraints in each phase of the problem( see Section 2. 3 below guess: all array of structures that contains contains a guess of the solutiOn in each phase of the probleIll see Section 2.10 below The optional fields(and their default values)are as follows linkages: an array of structures that contains the information about the lower and upper limits of the linkage constraints(see Section 2. 4 below) 2see the detailed description of setup in Section 2.1 See the detailed description of the output in Section 5 2.2 Syntax for Structure setup funcs mesh: Specifies the parameters to be used by the hp adaptive method refinement algorithm that is implemented in GPOPS (see Section 3 below) autoscale: a string that indicates whether or not the user would like the optimal control problem to be scaled automatically before it is solved.(default="off")(see Section 2.11 below derivatives: a string indicating differentiation method to be used. Possible values for this string are“ finite-difference”,“ complex”,“ automatic”," automatic-INTLAE”,“ analytic”( default=“ finite diffcrcnco")(scc Scction 4 bclow) checkDerivatives: a fag to check user defined analytic derivatives(default=0)(see Section 4 below maxlterations: a positive integer indicating the maximum number of iterations that can be taken by the nlp solver printoff: a Hag that will supress all printing from GPOPS to the screen(default=0) tolerances: two element array specifiying the NLP solver Optimality and Feasibility tolerances default=“{1e-6,2e-6]”) Furthermore, it is important to note that gPOPS has been designed so that the independent variable must be monotonically increasing'across each phase of the trajectory 2.2 Syntax for Structurc setup funcs The synt ax for specifying the names of the matlaB functions is done by setting the fields in the structure FUNCS and is given as follows setup. funcs cost cost fun.m setup. funcs dac dachun.m setup funcs event =eventful.m setup. funcs link link fun.m Example of Specifying Function Names for Use in GPOPS Suppose we have a problem whose cost functional, differential-algebraic equations, event constraints, and link age constraints are defined, respectively, via the user-defined fullctiOls Imycostful. Ill, InlydaefunIll, Inyevenlt- fun. m, and mylinkfun m. Then the syntax for specifying these functions for use in GPOPS is given as follows setup. funcs cost ='mycostfun: setup. funcs. dae mydaefun> setup. funcs event myeventfun setup. funcs link 'mvlinkfun 3 Syntax for limits Structure Once the user-defined structure setup has been defined, the next step in setting up a problem for use with GPOPS is to create an array of structures of length P(where P is the number of phases) called limits where linits is a field of the structure setup. The array of structures linits is specified as follows limits(p). meshPoints: a monotonically increasing row vector of length Mp,(pE 1,., PD), where each entry in the vector is on the domain [-1, +1]. that contains a set of mesh points for the initial run of GPOPS. If the user does not have an estimate of the mesh point, locations, this field should be left blank 2.3 Syntax for limits Structure 10 limits(p). nodesPerInterval: a row vector of length Mp-1,(P E [1,.., P]), where each entr the vector is a positive integer that contains the number of collocation points in each mesh interval for the initial run of GPOPS. If the uscr does not havc an estimate of the number of collocation points in each mesh interval, this entry should be left blank limits(p).time. min and limits(p).time. max: row vectors, each of length two, that contain the information about the lower and upper limits, respectively, on the initial and terminal time in phase 1,...,P. The row vectors limits(p) time. min and limits(p).time. max have the following orm limits(p)time. min IlIlI limits(p)time. max to nax maX limits(p).state. min and limits(p).state. max: matrices, each of size np X3, that contain the lower and upper limits, respectively, on the state in phase p E [1,.., P. Each of the columns of the matrices limits(p) state. min and limits(p). state. max are given as follows limits().statc. min(:, 1 ):a column vector containing the lowcr(uppcr) limits on the statc at the start of phase pE,..., P limits(p)state. min(, 2): a column vector containing the lower (upper) limits on the state at the during phase p∈[l,,P limits(p). state. min(:, 3): a column vector containing the lower(upper) limits on the state at the terminus of phasc p c [1 The matrices limits(p)state. min and limits(p)state. max then have the following form Ln Imir 1f limits(p) state. min rrin m min n rax in ax f limits(p)state.max nax nax rmax nf limits(p) control. min and limits(p). control. max: column vectors, each of length mp, that contain the lower and upper limits, respectively, on the controls in phase p E [1,..., P. The column vectors limits(p). control Inin and linits(p). control.max have the following forI: limits(p) control. min rnax limits(p) control.max laX limits(p) parameter. min and limits(p)-parameter. max: column vectors, each of length qp, that contain the lower and upper limits. respectively, on the static parameters in phase pE,., P. TI 【实例截图】
【核心代码】
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论