# GPOPS-II

**GPOPS-II** 是一个用于求解一般非线性最优控制问题的 MATLAB 软件包，所谓最优控制问题，即对由微分代数方程定义的系统进行优化的问题。它利用变阶[高斯求积](https://www.edgepedia.org/zh/gaussian-quadrature)配点法（强制方程在选定的离散点上成立以逼近解），将连续时间最优控制问题转化为稀疏非线性规划问题（NLP），然后使用求解器 IPOPT（已内置）或 SNOPT（提供接口但需单独购买）求解该 NLP。<sup>[1](https://www.gpops2.com/)</sup> 该软件包由迈克尔·A·帕特森和阿尼尔·V·拉奥编写，相关文档发表于 2014 年《ACM 数学软件汇刊》的一篇文章中。<sup>[2](https://paperity.org/p/376485991/gpops-ii-a-matlab-software-for-solving-multiple-phase-optimal-control-problems-using-hp)</sup>

| 关键事实 | 详情 |
|---|---|
| 用途 | 用于多阶段非线性最优控制问题的通用 MATLAB 软件，包括由微分代数方程支配的系统<sup>[1](https://www.gpops2.com/)</sup> |
| 核心方法 | 变阶勒让德-高斯-拉道（LGR）求积配点法，结合 hp 自适应网格细化<sup>[3](https://www.gpops2.com/resources/gpops2UsersGuide.pdf)</sup><sup> • </sup><sup>[4](https://www.researchgate.net/publication/373421336_Enhancements_to_the_Astrodynamics_Software_and_Science_Enabling_Toolkit_ASSET)</sup> |
| NLP 求解器 | 内置 IPOPT，软件可“开箱即用”；包含 SNOPT 接口，但 SNOPT 需单独购买<sup>[1](https://www.gpops2.com/)</sup> |
| 参考出版物 | 帕特森与拉奥，《ACM 数学软件汇刊》，2014 年，第 41 卷第 1 期，第 1–37 页，DOI 10.1145/2558904<sup>[2](https://paperity.org/p/376485991/gpops-ii-a-matlab-software-for-solving-multiple-phase-optimal-control-problems-using-hp)</sup> |
| 导数 | 对最优控制问题进行完整的一阶和二阶稀疏有限差分；自动微分软件包 ADiGATOR 也可生成精确的一阶和二阶导数<sup>[1](https://www.gpops2.com/)</sup><sup> • </sup><sup>[4](https://www.researchgate.net/publication/373421336_Enhancements_to_the_Astrodynamics_Software_and_Science_Enabling_Toolkit_ASSET)</sup> |
| 许可 | 对 K-12 或大学课堂教学使用、佛罗里达大学或佛罗里达州用户免费；学术研究、非营利、美国政府或商业用途需支付许可费<sup>[1](https://www.gpops2.com/)</sup> |
| 前身 | GPOPS（ACM 算法 902，2010 年），基于麻省理工学院、德雷珀实验室和佛罗里达大学开发的高斯伪谱法<sup>[5](https://www.mathworks.com/matlabcentral/fileexchange/21729-gpops)</sup> |

## 方法

GPOPS-II 通过在勒让德-高斯-拉道（LGR）点处配点来逼近连续时间最优控制问题，该点集定义在区间 [−1, 1] 上，仅包含其中一个端点。<sup>[6](https://doi.org/10.1016%2Fj.actaastro.2016.01.016)</sup> 离散化后的问题是一个稀疏 NLP，其决策变量包括状态、控制、积分、阶段起止时间和静态参数；随后由 IPOPT 或 SNOPT 求解该 NLP。<sup>[1](https://www.gpops2.com/)</sup>

**网格细化。** 该软件采用 hp 自适应网格细化，即同时调整网格区间数（h）和每个区间内的多项式阶数（p），直至满足用户指定的精度容差。其底层 hp 自适应伪谱法由达比、哈格和拉奥于 2011 年发表，迭代确定分段断点和多项式阶数；当某段上的误差在性质上均匀分布时，提高多项式阶数；当误差集中在孤立点时，在该处细分该段。<sup>[7](https://onlinelibrary.wiley.com/doi/abs/10.1002/oca.957)</sup> 与全局伪谱法相比，该方法以更少的计算量和内存获得更高的精度，使得那些用单一高阶全局多项式在计算上难以处理的问题变得可解。<sup>[7](https://onlinelibrary.wiley.com/doi/abs/10.1002/oca.957)</sup> 在基准使用中，GPOPS-II 已采用 Liu-Rao-Legendre 网格细化方法运行，例如根据问题不同，允许每个网格区间有 4 到 6 个或 3 到 20 个配点。<sup>[4](https://www.researchgate.net/publication/373421336_Enhancements_to_the_Astrodynamics_Software_and_Science_Enabling_Toolkit_ASSET)</sup>

**缩放与问题设置。** 用户指南描述了若干自动缩放选项（automatic-bounds、automatic-guess、automatic-guessUpdate、automatic-hybrid 和 automatic-hybridUpdate），适用于用户无法手动确定合适缩放的情况，同时指出基于对问题本身理解的缩放更为可取。<sup>[3](https://www.gpops2.com/resources/gpops2UsersGuide.pdf)</sup> 时间、状态、控制、积分和静态参数的初始猜测可在端点处或沿路径的任意数量点处给出，因此整条轨迹都可作为猜测值。<sup>[8](https://etd.lib.metu.edu.tr/upload/12618011/index.pdf)</sup>

## 历史

GPOPS-II 是 GPOPS 软件的第二代。最初的 GPOPS 于 2010 年作为 ACM 算法 902 发表，使用麻省理工学院、德雷珀实验室和[佛罗里达大学](https://www.edgepedia.org/zh/university-of-florida)开发的高斯伪谱法求解多阶段最优控制问题，需要外部稀疏非线性优化器 SNOPT。<sup>[5](https://www.mathworks.com/matlabcentral/fileexchange/21729-gpops)</sup> GPOPS-II 用变阶 LGR 配点和 hp 自适应网格细化取代了固定高斯伪谱离散化，并内置 IPOPT，因此除 MATLAB 外无需任何第三方产品。<sup>[1](https://www.gpops2.com/)</sup> 其 C++ 对应版本 CGPOPS 由尤努斯·M·阿加马维和阿尼尔·V·拉奥于 2019 年描述，并提供与开源 NLP 求解器 IPOPT 的接口。<sup>[9](https://arxiv.org/abs/1905.11898)</sup>

## 应用

GPOPS-II 在航空航天轨迹优化中广泛应用。已记录的应用包括多级运载火箭上升轨迹与推力剖面优化，<sup>[10](https://avesis.metu.edu.tr/yonetilen-tez/fe89bb33-5015-4e4a-b832-5d1926f04b82/multistage-launch-vehicle-design-with-thrust-profile-and-trajectory-optimization)</sup> 低推力轨道转移与航天器部署排序，<sup>[4](https://www.researchgate.net/publication/373421336_Enhancements_to_the_Astrodynamics_Software_and_Science_Enabling_Toolkit_ASSET)</sup><sup> • </sup><sup>[11](https://www.space-flight.org/docs/2025_summer/2025_ASC_Program_Full_2025-08-09.pdf)</sup> 飞机地形跟随轨迹生成，<sup>[12](https://scholar.afit.edu/facpub/1902/)</sup> 以及美国大陆上空使音爆最小化的超音速运输机轨迹。<sup>[13](https://hammer.purdue.edu/articles/thesis/Trajectory_Optimization_for_Boom-Minimizing_Supersonic_Transport_over_the_Continental_U_S_/27934614)</sup> 它也被应用于航空航天之外的领域：赛车最短单圈时间最优控制，<sup>[14](https://www.researchgate.net/publication/325559015_Comparison_of_direct_and_indirect_methods_for_minimum_lap_time_optimal_control_problems)</sup> 四旋翼竞速轨迹规划，<sup>[15](https://github.com/jtorde/drone_racing_gpops)</sup> 以及基于 OpenSim 构建的神经肌肉骨骼仿真与治疗优化流程，其中 GPOPS-II 求解预测特定受试者步行运动的直接配点问题。<sup>[16](https://pmc.ncbi.nlm.nih.gov/articles/PMC12087055/)</sup>

## 性能与局限

独立基准测试给出的速度表现参差不齐。在 2023 年与 ASSET 天体动力学软件包在两个贝茨基准问题上的比较中，GPOPS-II 正确求解了这两个问题（一个最终质量为 0.220179 lbm 的低推力转移，一个最大横程为 34.1 度的航天飞机再入，均与贝茨发表的结果一致），但比 ASSET 的方法需要更多的 CPU 时间和更多的网格迭代；在低推力问题上，GPOPS-II 总共耗时 6.763 秒，而 ASSET 基于积分器的方法为 0.194 秒。<sup>[4](https://www.researchgate.net/publication/373421336_Enhancements_to_the_Astrodynamics_Software_and_Science_Enabling_Toolkit_ASSET)</sup>

文献中反复出现两个实际局限。第一，解可能对初始猜测敏感：对高超声速飞行器和轮式装载机问题的研究报告称，收敛到可行或期望的局部解通常需要较好的初始猜测，且不同的初始猜测会导致不同的局部极值。<sup>[17](https://oaktrust.library.tamu.edu/server/api/core/bitstreams/4302c104-8ad5-4778-82f1-43a691d865ec/content)</sup><sup> • </sup><sup>[18](https://1library.co/article/delegaci%C3%B3n-territorial-de-conocimiento-y-empleo-de-ja%C3%A9n.yngopl1j)</sup> 第二，GPOPS-II 最初并非为含时滞问题设计。贝茨、坎贝尔和迪吉罗拉莫于 2020 年考察了此类问题，发现当 GPOPS-II 作为时滞问题的直接离散求解器使用时，会找到次优解，但当作为必要条件的时滞边值求解器使用时，往往能产生良好的解。<sup>[19](https://www.aimsciences.org/article/doi/10.3934/naco.2020026)</sup>

## References

1. [GPOPS-II - Next-Generation Optimal Control Software, official website](https://www.gpops2.com/)
2. [Patterson, M. A., Rao, A. V. GPOPS-II: A MATLAB Software for Solving Multiple-Phase Optimal Control Problems Using hp-Adaptive Gaussian Quadrature Collocation Methods and Sparse Nonlinear Programming, ACM Trans. Math. Software 41(1), 2014](https://paperity.org/p/376485991/gpops-ii-a-matlab-software-for-solving-multiple-phase-optimal-control-problems-using-hp)
3. [GPOPS-II Version 2.0 User's Guide](https://www.gpops2.com/resources/gpops2UsersGuide.pdf)
4. [Enhancements to the Astrodynamics Software and Science Enabling Toolkit (ASSET), ResearchGate](https://www.researchgate.net/publication/373421336_Enhancements_to_the_Astrodynamics_Software_and_Science_Enabling_Toolkit_ASSET)
5. [GPOPS, MATLAB Central File Exchange](https://www.mathworks.com/matlabcentral/fileexchange/21729-gpops)
6. [Suboptimal LQR-based spacecraft full motion control: Theory and experimentation, Acta Astronautica](https://doi.org/10.1016%2Fj.actaastro.2016.01.016)
7. [Darby, C. L., Hager, W. W., Rao, A. V. An hp-adaptive pseudospectral method for solving optimal control problems, Optimal Control Applications and Methods 32(4), 2011](https://onlinelibrary.wiley.com/doi/abs/10.1002/oca.957)
8. [Multistage launch vehicle design with thrust profile and trajectory optimization, METU thesis](https://etd.lib.metu.edu.tr/upload/12618011/index.pdf)
9. [Agamawi, Y. M., Rao, A. V. CGPOPS: A C++ Software for Solving Multiple-Phase Optimal Control Problems, arXiv:1905.11898](https://arxiv.org/abs/1905.11898)
10. [Multistage launch vehicle design with thrust profile and trajectory optimization, METU AVESİS](https://avesis.metu.edu.tr/yonetilen-tez/fe89bb33-5015-4e4a-b832-5d1926f04b82/multistage-launch-vehicle-design-with-thrust-profile-and-trajectory-optimization)
11. [Maneuver planning and trajectory optimization for small satellite deployment, 2025 ASC Program](https://www.space-flight.org/docs/2025_summer/2025_ASC_Program_Full_2025-08-09.pdf)
12. [Stephens, S. S., Hess, J. A., Kunz, D. L. Optimal control approach to terrain following trajectory generation, AIAA Scitech 2020](https://scholar.afit.edu/facpub/1902/)
13. [Trajectory Optimization for Boom-Minimizing Supersonic Transport over the Continental U.S., Purdue thesis](https://hammer.purdue.edu/articles/thesis/Trajectory_Optimization_for_Boom-Minimizing_Supersonic_Transport_over_the_Continental_U_S_/27934614)
14. [Comparison of direct and indirect methods for minimum lap time optimal control problems, ResearchGate](https://www.researchgate.net/publication/325559015_Comparison_of_direct_and_indirect_methods_for_minimum_lap_time_optimal_control_problems)
15. [Optimal Control for UAVs using GPOPS-II, GitHub](https://github.com/jtorde/drone_racing_gpops)
16. [The Neuromusculoskeletal Modeling Pipeline, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC12087055/)
17. [Optimal Control of an Autonomous Wheel Loader, Texas A&M thesis](https://oaktrust.library.tamu.edu/server/api/core/bitstreams/4302c104-8ad5-4778-82f1-43a691d865ec/content)
18. [Initial guess sensitivity study with GPOPS-II](https://1library.co/article/delegaci%C3%B3n-territorial-de-conocimiento-y-empleo-de-ja%C3%A9n.yngopl1j)
19. [Betts, J. T., Campbell, S., Digirolamo, C. Examination of solving optimal control problems with delays using GPOPS-II, Numerical Algebra, Control and Optimization 11(2), 2021](https://www.aimsciences.org/article/doi/10.3934/naco.2020026)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 工程与制造 › 机器人技术与自动化 › 机器人软件、人工智能与方法 › 最优控制、模型预测控制与安全控制

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/gpops-ii

English original: https://www.edgepedia.org/gpops-ii
