Solving Differential Equations in R: Package deSolve
By Karline Soetaert, Thomas Petzoldt. 2010
1,654 citations recorded by the source corpus.
In this paper we present the R package deSolve to solve initial value problems (IVP) written as ordinary differential equations (ODE), differential algebraic equations (DAE) of index 0 or 1 and partial differential equations (PDE), the latter solved using the method of lines approach. The differential equations can be represented in R code or as compiled code. In the latter case, R is used as a tool to trigger the integration and post-process the results, which facilitates model development and application, whilst the compiled code significantly increases simulation speed. The methods implemented are efficient, robust, and well documented public-domain Fortran routines. They include four integrators from the ODEPACK package (LSODE, LSODES, LSODA, LSODAR), DVODE and DASPK2.0. In addition, a suite of Runge-Kutta integrators and special-purpose solvers to efficiently integrate 1-, 2- and 3-dimensional partial differential equations are available. The routines solve both stiff and non-stiff systems, and include many options, e.g., to deal in an efficient way with the sparsity of the Jacobian matrix, or finding the root of equations. In this article, our objectives are threefold: (1) to demonstrate the potential of using R for dynamic modeling, (2) to highlight typical uses of the different methods implemented and (3) to compare the performance of models specified in R code and in compiled code for a number of test cases. These comparisons demonstrate that, if the use of loops is avoided, R code can efficiently integrate problems comprising several thousands of state variables. Nevertheless, the same problem may be solved from 2 to more than 50 times faster by using compiled code compared to an implementation using only R code. Still, amongst the benefits of R are a more flexible and interactive implementation, better readability of the code, and access to R’s high-level procedures. deSolve is the successor of package odesolve which will be deprecated in the future; it is free software and distributed under the GNU General Public License, as part of the R software project.
Subfields: Computational Theory and Mathematics, Management Science and Operations Research, Numerical Analysis
View Paper: https://www.semanticscholar.org/paper/d6271cfad475e0754189d9189546cac2c1d83617
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Computational Theory and Mathematics
- Richard G. FitzJohn
- Qing Nie
- Stefanie Widder
- D. Berry
- Christopher Rackauckas
- Jeff R. Cash
- S. Q. Foster
- Francesca Mazzia
In Management Science and Operations Research
- Richard G. FitzJohn
- Qing Nie
- Stefanie Widder
- D. Berry
- Christopher Rackauckas
- Jeff R. Cash
- S. Q. Foster
- Francesca Mazzia
In Numerical Analysis
- Richard G. FitzJohn
- Qing Nie
- Stefanie Widder
- D. Berry
- Christopher Rackauckas
- Jeff R. Cash
- S. Q. Foster
- Francesca Mazzia
Citations in the corpus
- A Systems Approach to Designing Effective Clinical Trials Using Simulations (2012, methodology): “We used the S-warfarin concentration in combination with the estimated parameters to solve a system of coupled nonlinear ordinary differential equations, using the deSolve package 28 in R, to calculate the daily INR value for each avatar.”
- Deciphering microbial interactions and detecting keystone species with co-occurrence networks (2014, methodology): “The model was evaluated using numerical integration with the lsoda function in the R package deSolve (Soetaert et al., 2010).”
- Solving Ordinary Differential Equations in R (2012, methodology): “The R package deSolve [26] has several built-in functions for computing a numerical solution of initial value problems for ODEs.”
- DifferentialEquations.jl – A Performant and Feature-Rich Ecosystem for Solving Differential Equations in Julia (2017, methodology): “Instead, since these are the standard algorithms wrapped in packages such as SciPy [15] and R’s deSolve [26], the limitations of these wrapped solvers match the limitations of other common libraries.”
- Phytoplankton primary production in the world's estuarine-coastal ecosystems (2013, methodology): “10-3 (Soetaert et al., 2010), using a time step 1t = 0.”
- Diversitree: comparative phylogenetic analyses of diversification in R (2012, methodology): “e"deSolve"backenduses the lsoda algorithm from theRpackage deSolve (Soetaert et al., 2010) to solve the system of dierential equations.”
- RPANDA: an R package for macroevolutionary analyses on phylogenetic trees (2016, neutral): “RPANDA relies on the R packages ‘ape’ (Paradis, Claude & Strimmer 2004), ‘picante’ (Kembel et al. 2010), ‘phytools’ (Revell 2012), ‘deSolve’ (Soetaert, Petzoldt & Setzer 2010) and ‘igraph’ (Csardi & Nepusz 2006).”