Skip to main content

Verified Numerical Methods for Ordinary Differential Equations

  • Conference paper
  • First Online:
Software Verification and Formal Methods for ML-Enabled Autonomous Systems (NSV 2022, FoMLAS 2022)

Abstract

Ordinary differential equations (ODEs) are used to model the evolution of the state of a system over time. They are ubiquitous in the physical sciences and are often used in computational models with safety-critical applications. For critical computations, numerical solvers for ODEs that provide useful guarantees of their accuracy and correctness are required, but do not always exist in practice. In this work, we demonstrate how to use the Coq proof assistant to verify that a C program correctly and accurately finds the solution to an ODE initial value problem (IVP). Our verification framework is modular, and concisely disentangles the high-level mathematical properties expected of the system being modeled from the low-level behavior of a particular C program. Our approach relies on the construction of two simple functional models in Coq: a floating-point valued functional model for analyzing the intermediate-level behavior of the program, and a real-valued functional model for analyzing the high-level mathematical properties of the system being modeled by the IVP. Our final result is a proof that the floating-point solution returned by the C program is an accurate solution to the IVP, with a good quantitative bound. Our framework assumes only the operational semantics of C and of IEEE-754 floating point arithmetic.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    This particular model problem admits an analytical solution and is therefore not expected to be of practical interest on its own. Instead, it is chosen for demonstrating and analyzing the performance of our logical framework.

  2. 2.

    The form name (arguments) : type := term in Coq binds name to the value of the term of type type; is the type of well-formed propositions.

References

  1. Hairer, E., Lubich, C., Wanner, G.: Geometric numerical integration illustrated by the Störmer-Verlet method. Acta Numerica 12, 399–450 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  2. Nedialkov, N.S., Jackson, K.R., Corliss, G.F.: Validated solutions of initial value problems for ordinary differential equations. Appl. Math. Comput. 105(1), 21–68 (1999)

    MathSciNet  MATH  Google Scholar 

  3. Lin, Y., Stadtherr, M.A.: Validated solutions of initial value problems for parametric ODEs. Appl. Numer. Math. 57(10), 1145–1162 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  4. dit Sandretto, J.A., Chapoutot, A.: Validated explicit and implicit Runge-Kutta methods. Reliable Computing Electronic Edition, 22 July 2016

    Google Scholar 

  5. Rauh, A., Auer, E.: Verified simulation of ODEs and their solution. Reliab. Comput. 15(4), 370–381 (2011)

    MathSciNet  Google Scholar 

  6. Nedialkov, N.S., Jackson, K.R.: ODE software that computes guaranteed bounds on the solution. In: Langtangen, H.P., Bruaset, A.M., Quak, E. (eds.) Advances in Software Tools for Scientific Computing, pp. 197–224. Springer, Heidelberg (2000). https://doi.org/10.1007/978-3-642-57172-5_6

    Chapter  Google Scholar 

  7. Nedialkov, N.S.: Interval tools for ODEs and DAEs. In: 12th GAMM - IMACS International Symposium on Scientific Computing, Computer Arithmetic and Validated Numerics (SCAN 2006), p. 4 (2006)

    Google Scholar 

  8. Appel, A.W.: Verified software toolchain. In: Barthe, G. (ed.) ESOP 2011. LNCS, vol. 6602, pp. 1–17. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-19718-5_1

    Chapter  Google Scholar 

  9. Boldo, S., Lelay, C., Melquiond, G.: Coquelicot: a user-friendly library of real analysis for Coq. Math. Comput. Sci. 9(1), 41–62 (2015)

    Article  MathSciNet  MATH  Google Scholar 

  10. Boldo, S., Melquiond, G.: Computer Arithmetic and Formal Proofs: Verifying Floating-point Algorithms with the Coq System. Elsevier, Amsterdam (2017)

    MATH  Google Scholar 

  11. Appel, A.W., Kellison, A.E.: VCFloat2: floating-point error analysis in Coq. Draft (2022)

    Google Scholar 

  12. Ramananandro, T., Mountcastle, P., Meister, B., Lethin, R.: A unified Coq framework for verifying C programs with floating-point computations. In: Proceedings of the 5th ACM SIGPLAN Conference on Certified Programs and Proofs, CPP 2016, pp. 15–26. Association for Computing Machinery, New York (2016)

    Google Scholar 

  13. Hairer, E., Norsett, S.P., Wanner, G.: Solving Ordinary Differential Equations I. Nonstiff Problems, 2nd rev. edition. Springer, Heidelberg (1993). https://doi.org/10.1007/978-3-540-78862-1. Corr. 3rd printing edition, 1993

    Book  MATH  Google Scholar 

  14. LeVeque, R.J.: Finite Difference Methods for Ordinary and Partial Differential Equations. Society for Industrial and Applied Mathematics, Philadelphia (2007)

    Book  MATH  Google Scholar 

  15. Hairer, E., Lubich, C., Wanner, G.: Geometric Numerical Integration. Structure-Preserving Algorithms for Ordinary Differential Equations. Springer Series in Computational Mathematics, vol. 31, 2nd edn. Springer, Heidelberg (2006). https://doi.org/10.1007/3-540-30666-8

    Book  MATH  Google Scholar 

  16. Bou-Rabee, N., Sanz-Serna, J.M.: Geometric integrators and the Hamiltonian Monte Carlo method. Acta Numerica 27, 113–206 (2018)

    Article  MathSciNet  MATH  Google Scholar 

  17. Blanes, S., Casas, F., Sanz-Serna, J.M.: Numerical integrators for the hybrid Monte Carlo method. SIAM J. Sci. Comput. 36(4), A1556–A1580 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  18. Skeel, R.D.: Integration schemes for molecular dynamics and related applications. In: Ainsworth, M., Levesley, J., Marletta, M. (eds.) The Graduate Student’s Guide to Numerical Analysis ’98. Springer, Heidelberg (1999). https://doi.org/10.1007/978-3-662-03972-4_4

    Chapter  Google Scholar 

  19. Appel, A.W., et al.: Program Logics for Certified Compilers. Cambridge University Press, Cambridge (2014)

    Book  MATH  Google Scholar 

  20. Beringer, L., Appel, A.W.: Abstraction and subsumption in modular verification of C programs. Formal Methods Syst. Des. 58, 322–345 (2021). https://doi.org/10.1007/s10703-020-00353-1

    Article  MATH  Google Scholar 

  21. Boldo, S., Clément, F., Filliâtre, J.-C., Mayero, M., Melquiond, G., Weis, P.: Trusting computations: a mechanized proof from partial differential equations to actual program. Comput. Math. Appl. 68(3), 325–352 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  22. Boldo, S., Faissole, F., Chapoutot, A.: Round-off error analysis of explicit one-step numerical integration methods. In: 24th IEEE Symposium on Computer Arithmetic, London, UK, July 2017

    Google Scholar 

  23. Daumas, M., Melquiond, G.: Certification of bounds on expressions involving rounded operators. ACM Trans. Math. Softw. 37(1), 1–20 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  24. de Dinechin, F., Lauter, C., Melquiond, G.: Certifying the floating-point implementation of an elementary function using Gappa. IEEE Trans. Comput. 60(2), 242–253 (2011)

    Article  MathSciNet  MATH  Google Scholar 

  25. Immler, F., Hölzl, J.: Numerical analysis of ordinary differential equations in Isabelle/HOL. In: Beringer, L., Felty, A. (eds.) ITP 2012. LNCS, vol. 7406, pp. 377–392. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-32347-8_26

    Chapter  Google Scholar 

  26. Corliss, G.F.: Guaranteed Error Bounds for Ordinary Differential Equations. Oxford University Press, Oxford (1994)

    MATH  Google Scholar 

  27. Nedialkov, N.S., Jackson, K.R., Pryce, J.D.: An effective high-order interval method for validating existence and uniqueness of the solution of an IVP for an ODE. Reliab. Comput. 7(6), 449–465 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  28. Jackson, K.R., Nedialkov, N.S.: Some recent advances in validated methods for IVPs for ODEs. Appl. Numer. Math. 42(1), 269–284 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  29. Rihm, R.: Interval methods for initial value problems in ODEs. In: Topics in Validated Computations: Proceedings of IMACS-GAMM International Workshop on Validated Computation, September 1993

    Google Scholar 

  30. Shampine, L.F.: Error estimation and control for ODEs. J. Sci. Comput. 25(1), 3–16 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  31. Cao, Y., Petzold, L.: A posteriori error estimation and global error control for ordinary differential equations by the adjoint method. SIAM J. Sci. Comput. 26(2), 359–374 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  32. Kehlet, B., Logg, A.: A posteriori error analysis of round-off errors in the numerical solution of ordinary differential equations. Numer. Algorithms 76(1), 191–210 (2017)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Acknowledgments

This work benefited substantially from discussions with David Bindel. We thank Michael Soegtrop for his close reading and helpful feedback. Ariel Kellison is supported by the U.S. Department of Energy, Office of Science, Office of Advanced Scientific Computing Research, Department of Energy Computational Science Graduate Fellowship under Award Number DE-SC0021110.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ariel E. Kellison .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Kellison, A.E., Appel, A.W. (2022). Verified Numerical Methods for Ordinary Differential Equations. In: Isac, O., Ivanov, R., Katz, G., Narodytska, N., Nenzi, L. (eds) Software Verification and Formal Methods for ML-Enabled Autonomous Systems. NSV FoMLAS 2022 2022. Lecture Notes in Computer Science, vol 13466. Springer, Cham. https://doi.org/10.1007/978-3-031-21222-2_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-21222-2_9

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-21221-5

  • Online ISBN: 978-3-031-21222-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics