Abstract
The indirect solution of optimal control problems (OCPs) with inequality constraints and parameters is obtained by solving the two-point boundary value problem (BVP) involving index-1 differential-algebraic equations (DAEs) associated with its first-order optimality conditions. This paper introduces an adaptive mesh refinement method based on a collocation method for solving the index-1 BVP-DAEs. The paper first derives a method to estimate the relative error between the numerical solution and the exact solution. The relative error estimate is then used to guide the mesh refinement process. The mesh size is increased when the estimated error within a mesh interval is beyond the numerical tolerance by either increasing the order of the approximating polynomial or dividing the interval into multiple subintervals. In the mesh interval where the error tolerance has been met, the mesh size is reduced by either decreasing the degree of the approximating polynomial or merging adjacent mesh intervals. An efficient parallel implementation of the method is implemented using Python and CUDA. The paper presents three examples which show that the approach is more computationally efficient and robust when compared with fixed-order methods.
Similar content being viewed by others
References
Agamawi, Y.M., Hager, W.W., Rao, A.V.: Mesh refinement method for solving bang-bang optimal control problems using direct collocation. arXiv:1905.11895 (2019)
Amodio, P., Cash, J., Roussos, G., Wright, R., Fairweather, G., Gladwell, I., Kraut, G., Paprzycki, M.: Almost block diagonal linear systems: sequential and parallel solution techniques, and applications. Numerical Linear Algebra with Applications 7(5), 275–317 (2000)
Ascher, U.: On numerical differential algebraic problems with application to semiconductor device simulation. SIAM J. Numer. Anal. 26(3), 517–538 (1989)
Ascher, U.M., Spiteri, R.J.: Collocation software for boundary value differential-algebraic equations. SIAM J. Sci. Comput. 15(4), 938–952 (1994)
Benson, D.: A Gauss pseudospectral transcription for optimal control. PhD thesis, Massachusetts Institute of Technology (2005)
Betts, J.T.: Survey of numerical methods for trajectory optimization. Journal of Guidance Control, and Dynamics 21(2), 193–207 (1998)
Betts, J.T.: Practical methods for optimal control and estimation using nonlinear programming. SIAM (2010)
Büskens, C., Maurer, H.: Sqp-methods for solving optimal control problems with control and state constraints: adjoint variables, sensitivity analysis and real-time control. J. Comput. Appl. Math. 120(1-2), 85–108 (2000)
Darby, C.L., Hager, W.W., Rao, A.V.: Direct trajectory optimization using a variable low-order adaptive pseudospectral method. J. Spacecr. Rocket. 48(3), 433–445 (2011)
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), 476–502 (2011)
Dontchev, A.L.: An a priori estimate for discrete approximations in nonlinear optimal control. SIAM J. Control. Optim. 34(4), 1315–1328 (1996)
Elnagar, G., Kazemi, M.A., Razzaghi, M.: The pseudospectral legendre method for discretizing optimal control problems. IEEE Trans. Autom. Control 40(10), 1793–1796 (1995)
Elnagar, G.N., Razzaghi, M.: A collocation-type method for linear quadratic optimal control problems. Optimal Control Applications and Methods 18(3), 227–235 (1997)
Fabien, B.C.: Indirect numerical solution of constrained optimal control problems with parameters. In: American Control Conference, Proceedings of the 1995, vol. 3, pp. 2075–2076. IEEE (1995)
Fabien, B.C.: Some tools for the direct solution of optimal control problems. Adv. Eng. Softw. 29(1), 45–61 (1998)
Fabien, B.C.: Direct optimization of dynamic systems described by differential-algebraic equations. Optimal Control Applications and Methods 29(6), 445–466 (2008)
Fabien, B.C.: Indirect solution of inequality constrained and singular optimal control problems via a simple continuation method. J. Dyn. Syst. Meas. Control. 136(2) (2014)
Fabien, B.C.: Parallel indirect solution of optimal control problems. Optimal Control Applications and Methods 35(2), 204–230 (2014)
Fabien, B.C.: A noninterior continuation method for constrained optimal control problems. In: 2016 European Control Conference (ECC), pp. 1598–1603. IEEE (2016)
Fabien, B.C.: Parallel collocation solution of index-1 bvp-daes arising from constrained optimal control problems. Numer. Algorithms 71(2), 311–335 (2016)
Fornberg, B.: A Practical Guide to Pseudospectral Methods, vol 1. Cambridge University Press, Cambridge (1998)
Gerdts, M.: Global convergence of a nonsmooth newton method for control-state constrained optimal control problems. SIAM J. Optim. 19(1), 326–350 (2008)
Goh, C., Teo, K.: Miser: a fortran program for solving optimal control problems. Advances in Engineering Software (1978) 10(2), 90–99 (1988)
Gong, Q., Fahroo, F., Ross, I.M.: Spectral algorithm for pseudospectral methods in optimal control. Journal of Guidance, Control, and Dynamics 31(3), 460–471 (2008)
Grüne, L.: An adaptive grid scheme for the discrete hamilton-jacobi-bellman equation. Numer. Math. 75(3), 319–337 (1997)
Hairer, E., Nørsett, S.P., Wanner, G.: Solving ordinary differential equations I (2nd Revised. Ed.): Nonstiff Problems. Springer, Berlin (1993)
Herman, A.L.: Improved collocation methods with application to direct trajectory Optimization. PhD thesis, University of Illinois at Urbana-Champaign (1995)
Herman, A.L., Conway, B.A.: Direct optimization using collocation based on high-order gauss-lobatto quadrature rules. Journal of Guidance, Control, and Dynamics 19(3), 592–599 (1996)
Kanzow, C.: Some noninterior continuation methods for linear complementarity problems. SIAM Journal on Matrix Analysis and Applications 17(4), 851–868 (1996)
Kierzenka, J., Shampine, L.F.: A bvp solver based on residual control and the maltab pse. ACM Transactions on Mathematical Software (TOMS) 27 (3), 299–316 (2001)
Liu, F., Hager, W.W., Rao, A.V.: Adaptive mesh refinement method for optimal control using nonsmoothness detection and mesh size reduction. J. Franklin Inst. 352(10), 4081–4106 (2015)
Liu, F., Hager, W.W., Rao, A.V.: Adaptive mesh refinement method for optimal control using decay rates of legendre polynomial coefficients. IEEE Trans. Control Syst. Technol. 26(4), 1475–1483 (2018). https://doi.org/10.1109/TCST.2017.2702122
Luebke, D.: Cuda: scalable parallel programming for high-performance scientific computing. In: 2008 5th IEEE International Symposium on Biomedical Imaging: from Nano to Macro, pp. 836–838. IEEE (2008)
Miele, A.: Gradient algorithms for the optimization of dynamic systems. In: Control and Dynamic Systems, vol. 16, pp. 1–52. Elsevier (1980)
Miller, A.T., Hager, W.W., Rao, A.V.: Mesh refinement method for solving optimal control problems with nonsmooth solutions using jump function approximations. Optimal Control Applications and Methods 42(4), 1119–1140 (2021)
Munos, R., Moore, A.: Variable resolution discretization in optimal control. Mach. Learn. 49(2-3), 291–323 (2002)
Nickolls, J., Buck, I., Garland, M., Skadron, K.: Scalable parallel programming with cuda. Queue 6(2), 40–53 (2008)
Patterson, M.A., Hager, W.W., Rao, A.V.: A ph mesh refinement method for optimal control. Optimal Control Applications and Methods 36(4), 398–421 (2015)
Rao, A.V.: A survey of numerical methods for optimal control. Adv. Astronaut. Sci. 135(1), 497–528 (2009)
Rao, A.V., Mease, K.D.: Eigenvector approximate dichotomic basis method for solving hyper-sensitive optimal control problems. Optimal Control Applications and Methods 21(1), 1–19 (2000)
Rao, A.V., Benson, D.A., Darby, C., Patterson, M.A., Francolin, C., Sanders, I., Huntington, G.T.: Algorithm 902: Gpops, a matlab software for solving multiple-phase optimal control problems using the gauss pseudospectral method. ACM Transactions on Mathematical Software (TOMS) 37(2), 1–39 (2010)
Stoer, J., Bulirsch, R.: Introduction to numerical analysis, vol. 12. Springer Science & Business Media (2013)
Storti, D., Yurtoglu, M.: CUDA for engineers: an introduction to high-performance parallel computing. Addison-Wesley Professional (2015)
Trefethen, L.N.: Spectral Methods in MATLAB. SIAM (2000)
Van Rossum, G., Drake, F.L. Jr: Python tutorial, vol. 620. Centrum voor Wiskunde en Informatica Amsterdam (1995)
Von Stryk, O., Bulirsch, R.: Direct and indirect methods for trajectory optimization. Ann. Oper. Res. 37(1), 357–373 (1992)
Zhao, J., Li, S.: Adaptive mesh refinement method for solving optimal control problems using interpolation error analysis and improved data compression. J. Franklin Inst. 357(3), 1603–1627 (2020)
Acknowledgements
The authors would also like to thank the reviewers for their careful reading of the article and the many helpful suggestions.
Funding
This work was supported by the National Science Foundation under (grant numbers 1542228) and University of Washington EcoCAR group.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The authors declare no competing interests.
Additional information
Availability of data and material
Not applicable.
Code availability
All the code used for this research can be obtained at https://github.com/UW-OCP/Collocation-Method-with-Adaptive-Mesh.
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendix: A
Appendix: A
1.1 A.1 Derivation of the necessary conditions
To present the necessary conditions for a minimum, define the scalar Hamiltonian function as
where α > 0 is a penalty parameter, \(\nu (t) \in \mathbb {R}^{n_d}\) are the non-negative slack variables, \(\lambda (t) \in \mathbb {R}^{n_{x}}\) are the costate variables, \(\mu (t) \in \mathbb {R}^{n_{d}}\) are the Lagrange multipliers associated with the non-negative slack variables ν(t).
If (x,u,w) represents a local minimum of the OCP (1)–(5), then it is necessary that the following conditions be satisfied.
where \(\psi (\mu _{i}, \nu _{i}; \alpha ) = \mu _{i} + \nu _{i} - \sqrt {\mu _{i}^{2} + \nu _{i}^{2} + 2\alpha }\) is the Kanzow’s smoothed Fisher-Burmeister formula used.
The variables \(\gamma (t) \in \mathbb {R}^{n_{w}}\) are used to write the stationary conditions associated with the parameters w as a differential equation instead of an integral equation. The Lagrange multipliers \(\kappa _{\mathrm {i}} \in \mathbb {R}^{n_{{{\varGamma }}}}\) are associated with the initial time constraints and the Lagrange multipliers \(\kappa _{\mathrm {f}} \in \mathbb {R}^{n_{{{\varPsi }}}}\) are associated with the final time constraints.
1.1.1 A.1.1 Boundary value problem
The necessary conditions (58)–(69) can then be represented in a compact form as a boundary value problem involving differential algebraic equations (BVP-DAEs) by separating the unknowns into: (i) differential variables; (ii) algebraic variables; and (iii) parameters. In particular, define
where \(y(t) \in \mathbb {R}^{n_{y}}\) are the differential variables, \(z(t) \in \mathbb {R}^{n_{z}}\) are the algebraic variables, and \(p \in \mathbb {R}^{n_{p}}\) are the parameter variables with ny = 2nx + nw, nz = nu + 2nd, and np = nw + nΓ + nΨ.
Using these definitions, the necessary conditions for a minimum can be written as the BVP-DAEs
Here, (71) defines a set of differential equations, (72) defines a set of algebraic equations, and (73) defines a set of boundary conditions. Moreover,
with \(d(x,u,w) = [d_{1}(x,u,w), d_{2}(x,u,w), \ldots , d_{n_{d}}(x,u,w)]^{T}\), \(\mathcal {N} = \text {diag} (\nu _{1},\) \(\nu _{2}, \ldots ,\nu _{n_{d}})\), \({\mathscr{M}} = \text {diag} (\mu _{1}, \mu _{2}, \ldots ,\mu _{n_{d}})\), ψd(μ,ν; α) = [ψ(μ1,ν1; α),ψ(μ2, \(\nu _{2};\alpha ), \ldots , \psi (\mu _{n_{d}},\nu _{n_{d}};\alpha )]^{T}\), \(D_x{{{\varGamma }}} = [\partial {{{\varGamma }}}_{1}/\partial x, \partial {{{\varGamma }}}_{2}/\partial x, \ldots ,\) \(\partial {{{\varGamma }}}_{n_{{{{\varGamma }}}}}/\partial x]^{T}\), \(D_{w}{{{\varGamma }}} = [\partial {{{\varGamma }}}_{1}/\partial w, \partial {{{\varGamma }}}_{2}/\partial w, \ldots , \partial {{{\varGamma }}}_{n_{{{{\varGamma }}}}}/\partial w]^{T}\), \(D_x{{\varPsi }} = [ \partial {{\varPsi }}_{1}/\partial x, \partial {{\varPsi }}_{2}/\partial x, \ldots , \partial {{\varPsi }}_{n_{{{\varPsi }}}}/\partial x]^{T}\), \(D_{w}{{\varPsi }} = [\partial {{\varPsi }}_{1}/\partial w, \partial {{\varPsi }}_{2}/\partial w, \ldots , \partial {{\varPsi }}_{n_{{{\varPsi }}}}/\partial w]^{T}\), and e = [1, 1,…, 1]T.
Rights and permissions
About this article
Cite this article
Yang, C., Fabien, B.C. An adaptive mesh refinement method for indirectly solving optimal control problems. Numer Algor 91, 193–225 (2022). https://doi.org/10.1007/s11075-022-01259-1
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11075-022-01259-1