Skip to main content

Vectorized Solution of ODEs in Matlab with Control of Residual and Error

  • Conference paper
Book cover Recent Advances in Computational and Applied Mathematics

Abstract

Vectorization is very important to the efficiency of computation in the popular problem-solving environment Matlab. Here we develop an explicit Runge–Kutta (7,8) pair of formulas that exploits vectorization. Conventional Runge–Kutta pairs control local error at the end of a step. The new method controls the extended local error at 8 points equally spaced in the span of a step. This is a byproduct of a control of the residual at these points. A new solver based on this pair, odevr7, not only has a very much stronger control of error than the recommended Matlab solver ode45, but on standard sets of test problems, it competes well at modest tolerances and is notably more efficient at stringent tolerances.

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 169.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 219.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 219.99
Price excludes VAT (USA)
  • Durable hardcover 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

References

  1. Dormand, J.R.: Numerical Methods for Differential Equations a Computational Approach. CRC Press, Boca Raton (1996)

    MATH  Google Scholar 

  2. Enright, W.H., Li, Y.: The reliability/cost trade-off for a class of ODE solvers. Numer. Alg. 53, 239–260 (2010)

    Article  MATH  Google Scholar 

  3. Higham, D.J.: Robust defect control with Runge–Kutta schemes. SIAM J. Numer. Anal. 26, 1175–1183 (1989)

    Article  MathSciNet  MATH  Google Scholar 

  4. Hull, T.E., Enright, W.H., Fellen, B.M., Sedgwick, A.E.: Comparing numerical methods for ordinary differential equations. SIAM J. Numer. Anal. 9, 603–637 (1972)

    Article  MathSciNet  MATH  Google Scholar 

  5. Kierzenka, J., Shampine, L.F.: A BVP solver based on residual control and the Matlab PSE. ACM Trans. Math. Softw. 27, 299–316 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  6. Krogh, F.T.: On testing a subroutine for the numerical integration of ordinary differential equations. J. ACM 20, 545–562 (1973)

    MATH  Google Scholar 

  7. Matlab: The MathWorks, Inc., 3 Apple Hill Dr., Natick, MA 01760

    Google Scholar 

  8. Milne, W.E.: Numerical Solution of Differential Equations. Dover, Mineola (1970)

    MATH  Google Scholar 

  9. Rosser, J.B.: A Runge-Kutta for all seasons. SIAM Rev. 9, 417–452 (1967)

    Article  MathSciNet  MATH  Google Scholar 

  10. Shampine, L.F.: Local error control in codes for ordinary differential equations. Appl. Math. Comput. 3, 189–210 (1977)

    Article  MathSciNet  MATH  Google Scholar 

  11. Shampine, L.F.: Interpolation for Runge–Kutta methods. SIAM J. Numer. Anal. 22, 1014–1027 (1985)

    Article  MathSciNet  MATH  Google Scholar 

  12. Shampine, L.F.: Solving ODEs and DDEs with residual control. Appl. Numer. Math. 52, 113–127 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  13. Shampine, L.F.: Vectorized solution of ODEs in Matlab. Scalable Comput.: Pract. Experience 10, 337–345 (2010). A preprint is available at http://faculty.smu.edu/shampine/current.html

    Google Scholar 

  14. Shampine, L.F., Kierzenka, J.: A BVP solver that controls residual and error. J. Numer. Anal. Ind. Appl. Math. 3, 27–41 (2008)

    MathSciNet  MATH  Google Scholar 

  15. The MathWorks, Code Vectorization Guide, available at http://www.mathworks.com/support/tech-notes/1100/1109.html

  16. Verner, J.H.: A ‘most efficient’ Runge-Kutta (13:7,8) pair. Available at http://www.math.sfu.ca/~jverner/

  17. Watts, H.A., Shampine, L.F.: A-stable block implicit one step methods. BIT 12, 252–256 (1972)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to L. F. Shampine .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer Science+Business Media B.V.

About this paper

Cite this paper

Shampine, L.F. (2011). Vectorized Solution of ODEs in Matlab with Control of Residual and Error. In: Simos, T. (eds) Recent Advances in Computational and Applied Mathematics. Springer, Dordrecht. https://doi.org/10.1007/978-90-481-9981-5_11

Download citation

Publish with us

Policies and ethics