Skip to main content

Solving Boundary Value Problems in R

  • Chapter
  • First Online:
Solving Differential Equations in R

Part of the book series: Use R! ((USE R))

  • 9286 Accesses

Abstract

Boundary Value Problems can be solved in R using shooting, MIRK and collocation methods and these can be found in the R package bvpSolve. The functions in this R package have an interface which is similar to the interface of the initial value problem solvers in the package deSolve. The default input to the solvers is very simple, requiring specification of only one function that calculates the derivatives while the boundary conditions are represented as simple vectors. However, in order to speed-up the simulations, and to increase the number of problems that can be solved, it is also possible to specify the boundary conditions by means of a function and provide analytic functions for the derivative and boundary gradients. In this chapter we demonstrate how to solve BVPs using a variety of well-known test problems, illustrating a wide range of difficulties in solving BVPs. We show how to use (manual and automatic) continuation, how difficult boundary conditions can be handled, and give many examples of how to convert BVPs to standard form. Some BVPs are much better solved using the finite difference methods as explained in the PDE chapter. We give an example of such a boundary value problem at the end of this chapter.

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

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 16.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.

    From (http://www.ma.ic.ac.uk/~jcash/BVP_software).

  2. 2.

    The ‘—’ in function bound is the ‘OR’ operator.

References

  1. Ames, W., & Lohner, E. (1981). Nonlinear models of reaction–diffusion in rivers. In R. Vichnevetsky & R. Stepleman (Eds.), Advances in computer methods for partial differential equations (Vol. IV, pp. 217–219). New Brunswick: IMACS.

    Google Scholar 

  2. Ascher, U. M., & Petzold, L. R. (1998). Computer methods for ordinary differential equations and differential-algebraic equations. Philadelphia: SIAM.

    Google Scholar 

  3. Ascher, U. M., Christiansen, J., & Russell, R. D. (1979). COLSYS–a collocation code for boundary value problems. In B. Childs et al. (Ed.), Lecture notes in computer science 76 (pp. 164–185). New York: Springer.

    Google Scholar 

  4. Ascher, U. M., Christiansen, J., & Russell, R. D. (1981). Collocation software for boundary-value ODEs. ACM Transactions on Mathematical Software, 7, 209–222.

    Google Scholar 

  5. Ascher, U. M., Mattheij, R. M. M., & Russell, R. D. (1995). Numerical solution of boundary value problems for ordinary differential equations. Philadelphia: SIAM.

    Google Scholar 

  6. Bader, G., & Ascher, U. M. (1987). A new basis implementation for a mixed order boundary value ODE solver. SIAM Journal on Scientific and Statistical Computing, 8, 483–500.

    Google Scholar 

  7. Cash, J. R. (2007). Algorithms for the solution of two-point boundary value problems (http://www.ma.ic.ac.uk/~jcash/BVPsoftware).

  8. Cash, J. R., & Mazzia, F. (2005). A new mesh selection algorithm, based on conditioning, for two-point boundary value codes. Journal of Computational and Applied Mathematics, 184, 362–381.

    Google Scholar 

  9. Cash, J. R., & Mazzia, F. (2006). Hybrid mesh selection algorithms based on conditioning for two-point boundary value problems. Journal of Numerical Analysis, Industrial and Applied Mathematics, 1(1), 81–90.

    Google Scholar 

  10. Cash, J. R., & Mazzia, F. (2009). Conditioning and hybrid mesh selection algorithms for two-point boundary value problems. Scalable Computing: Practice and Experience, 10(4), 347–361.

    Google Scholar 

  11. Cash, J. R., & Wright, M. H. (1991). A deferred correction method for nonlinear two-point boundary value problems: Implementation and numerical evaluation. SIAM Journal on Scientific and Statistical Computing, 12, 971–989.

    Google Scholar 

  12. Cash, J. R., Moore, G. & Wright, R. W. (1995). An automatic continuation strategy for the solution of singularly perturbed linear two-point boundary value problems. Journal of Computational Physics, 122, 266–279.

    Google Scholar 

  13. Moore, G. (1995). Computation and parameterisation of periodic and connecting orbits. IMA Journal of Numerical Analysis, 15, 245–263.

    Google Scholar 

  14. Seydel, R. (1988). From equilibrium to Chaos. New York: Elsevier.

    Google Scholar 

  15. Shampine, L. F., Gladwell, I., & Thompson, S. (2003). Solving ODEs with MATLAB. Cambridge: Cambridge University Press.

    Google Scholar 

  16. Shampine, L. F., Kierzenka, J., & Reichelt, M. W. (2000). Solving boundary value problems for ordinary differential equations in MATLAB with bvp4c. In Matlab Guide, D.J. Higham and N.J. Higham, pp 163–169, Philadelphia: SIAM.

    Google Scholar 

  17. Soetaert, K. (2011). rootSolve: Nonlinear root finding, equilibrium and steady-state analysis of ordinary differential equations. R package version 1.6.2.

    Google Scholar 

  18. Soetaert, K., & Meysman, F. (2012). Reactive transport in aquatic ecosystems: Rapid model prototyping in the open source software R. Environmental Modelling and Software, 32, 49–60.

    Google Scholar 

  19. Soetaert, K., Middelburg, J. J., Heip, C., Meire, P., Van Damme, S., & Maris, T. (2006). Long-term change in dissolved inorganic nutrients in the heterotrophic scheldt estuary (Belgium, the Netherlands). Limnology and Oceanography, 51, 409–423.

    Google Scholar 

  20. Soetaert, K., Cash, J. R., & Mazzia, F. (2011). bvpSolve: Solvers for boundary value problems of ordinary differential equations. R package version 1.2.2.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Soetaert, K., Cash, J., Mazzia, F. (2012). Solving Boundary Value Problems in R. In: Solving Differential Equations in R. Use R!. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-28070-2_11

Download citation

Publish with us

Policies and ethics