Skip to content

Commit 49f2540

Browse files
committed
polish text
1 parent 2ad9285 commit 49f2540

1 file changed

Lines changed: 21 additions & 39 deletions

File tree

  • content/landscape-of-ode-solvers-in-r

content/landscape-of-ode-solvers-in-r/index.md

Lines changed: 21 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -26,34 +26,33 @@ tags:
2626
---
2727
![Cover](./img/fig0-cover.png)
2828

29-
Solving **ordinary differential equations (ODEs)** is a common task in many fields, including systems biology, pharmacometrics, and engineering. The R ecosystem offers a collection of tools for this purpose: from lightweight numerical solvers to full modeling frameworks.
29+
Solving **ordinary differential equations (ODEs)** is a common task in many fields, including systems biology, pharmacometrics, physics, and engineering. The R ecosystem offers a collection of tools for this purpose: from lightweight numerical solvers to full modeling frameworks.
3030

3131
This article provides **a practical overview of ODE solvers in R**, with a focus on helping users navigate the ecosystem and choose appropriate tools.
3232

33-
All packages here was tested with simple examples and the code was published in the [GitHub repository](https://github.com/metelkin/ode-solvers-in-r).
33+
All packages included here were tested with simple examples and the code was published in the [GitHub repository](https://github.com/metelkin/ode-solvers-in-r).
3434

3535
## What is included
3636

37-
We include tools that:
37+
We include R packages that:
3838

39-
- Provide an API for R
4039
- Support solving general ODE systems
4140
- Are mentioned in literature, documentation, or community discussions
4241

4342
We intentionally exclude:
4443

45-
- Deprecated or archived packages (e.g., RxODE)
46-
- Thin wrappers around other frameworks without original solvers or formats (e.g., nlmixr2)
44+
- Deprecated or archived packages
45+
- Thin wrappers around other frameworks without original solvers or formats
4746
- Small helper packages
48-
- Highly specialized tools limited to narrow domains
47+
- Proprietary tools with limited public documentation
4948

5049
Some tools included in this review go beyond ODE solving and provide additional capabilities such as parameter estimation or simulation workflows. We include them for completeness, without going into those advanced features.
5150

5251
## Packages overview table
5352

5453
<div class="table-h-scroll">
5554

56-
| Package | Engine | Solver type | Algorithms | Model format | Stiff | DAE | DDE | Time events | Conditional events | CRAN (2025) |
55+
| Package | Engine | Solver type | Algorithms | Model format | Stiff | DAE | DDE | Time events | Conditional events | Downloads (2025) |
5756
|--------|--------|------|------------|--------------|-------|-----|-----|-------------|--------------------|------------------------|
5857
| [deSolve](https://cran.r-project.org/package=deSolve) | [ODEPACK](http://www.netlib.org/odepack/); [DASPK](http://www.netlib.org/ode/) (Fortran) | Compiled | lsoda, lsode, lsodes, lsodar, vode, daspk, bdf, adams, euler, rk4, ode23, ode45, | R func (interpreted); C/C++/Fortran (compiled) | Yes (lsoda) | Yes (daspk) | Yes (dede) | Yes | Yes (rootfun) | 635628 |
5958
| [rxode2](https://cran.r-project.org/package=rxode2) | [LIBLSODA](https://github.com/sdwfrost/liblsoda) + custom (C) | Compiled | liblsoda, lsoda, dop853, indLin | DSL (R-like, compiled) | Yes | - | - | Yes | - | 42872 |
@@ -75,10 +74,10 @@ Some tools included in this review go beyond ODE solving and provide additional
7574
#### Engine
7675

7776
This refers to the underlying numerical implementation used by the package. This can be:
78-
- a well-known external library (e.g., ODEPACK),
79-
- a custom compiled implementation,
80-
- or an external runtime (e.g., Julia),
81-
- another R package.
77+
- a well-known external library (e.g., ODEPACK)
78+
- a custom compiled implementation
79+
- another R package
80+
- or an external runtime (e.g., another language)
8281

8382
#### Solver type
8483

@@ -117,9 +116,9 @@ These features are important for modeling real-world systems with discontinuitie
117116
- **Time events**: Discrete changes applied at predefined time points (e.g., dosing events).
118117
- **Conditional events**: Events triggered when a condition is met during simulation (e.g., threshold crossing).
119118

120-
#### CRAN 2025
119+
#### Downloads 2025
121120

122-
Total number of downloads in 2025, reflecting usage statistics. Calculated with [CRAN logs](https://cranlogs.r-pkg.org/) service.
121+
Total number of downloads in 2025 from CRAN, reflecting usage statistics. Calculated with [CRAN logs](https://cranlogs.r-pkg.org/).
123122

124123
## Repository and test cases
125124

@@ -203,36 +202,19 @@ The goal of this review was to provide **a maximally complete and objective over
203202

204203
Many aspects - such as computational performance, numerical accuracy, and advanced functionality - are intentionally not covered in this article.
205204

206-
The table includes popularity metrics as download counts. However, these numbers do not reflect the actual capabilities of the packages. Downloads may include one-time installations for educational purposes, CI/CD workflows, or usage of a package for non-ODE problems. Therefore, they should not be considered a deciding factor when choosing a tool, but rather as a rough indicator of visibility within the community.
207-
208-
Below is a subjective selection of packages that I would recommend paying attention to.
209-
210-
#### General-purpose solution: deSolve
211-
212-
[deSolve](https://cran.r-project.org/package=deSolve) is a robust and well-established package with broad functionality and support for multiple numerical methods. It provides advanced capabilities such as handling stiffness, DAEs, DDEs, and events, while maintaining good computational performance through compiled solvers and model interfaces. It also offers flexible ways to define models.
213-
214-
With a large user base and extensive documentation, it is a reliable default choice.
205+
Many packages designed for specific application areas (e.g., PK/PD) can also be used to solve general ODE systems. These are included here on equal footing, without focusing on their domain-specific features.
215206

216-
I would recommend it as a general-purpose tool for most ODE tasks in R. If you are new to ODE modeling in R, starting with deSolve is a safe and practical choice before exploring more specialized tools.
217-
218-
#### Domain-specific tool: rxode2
219-
220-
[rxode2](https://cran.r-project.org/package=rxode2) is a powerful tool designed for pharmacokinetics and pharmacodynamics (PK/PD).
221-
222-
Together with the [nlmixr2](https://nlmixr2.org/) toolkit, it extends beyond ODE solving to include parameter estimation from data and efficient Monte Carlo simulations in parallel and distributed environments.
223-
224-
If your work is related to PK/PD modeling, this can be an excellent choice.
207+
The table includes popularity metrics as download counts. However, these numbers do not reflect the actual capabilities of the packages. Downloads may include one-time installations for educational purposes, CI/CD workflows, or usage of a package for non-ODE problems. Therefore, they should not be considered a deciding factor when choosing a tool, but rather as a rough indicator of visibility within the community.
225208

226-
#### Underappreciated tool: dMod
209+
For a broader catalogue, see the [CRAN Task View: Differential Equations](https://cran.r-project.org/web/views/DifferentialEquations.html), which also covers SDEs, DDEs, DAEs, PDEs, boundary value problems, calibration tools, and related modeling packages. The present review is narrower and more practical: it focuses on packages that can be used to solve general ODE systems in R and provides tested examples for each included tool.
227210

228-
[dMod](https://cran.r-project.org/package=dMod) provides a powerful framework for dynamic modeling, parameter estimation, and identifiability analysis.
211+
### deSolve
229212

230-
It combines symbolic model definition with efficient numerical solvers and supports gradient-based optimization workflows. While it has a steeper learning curve compared to simpler solvers, it offers a high level of flexibility and is particularly useful for more advanced modeling tasks.
213+
[deSolve](https://cran.r-project.org/package=deSolve) is one of the most widely used and established ODE packages in R. Its central role in the ecosystem is reflected not only in its large user base, but also in the number of other packages that build on top of it.
231214

232-
Despite its capabilities, it appears to be less widely used, making it an interesting but often overlooked option.
215+
It provides a broad set of numerical methods and supports a wide range of problem types, including stiff systems, DAEs, DDEs, and event handling. At the same time, it offers flexible model definitions, from simple R functions to compiled code.
233216

234-
#### Bridge to high-performance: diffeqr
217+
Overall, deSolve can be seen as a foundational tool in the R ecosystem for differential equations. Its popularity is well justified by its versatility, stability, and long-term development. If you are new to ODE modeling in R, starting with deSolve is a safe and practical choice before exploring more specialized tools.
235218

236-
[diffeqr](https://cran.r-project.org/package=diffeqr) provides an interface to the Julia-based DifferentialEquations.jl ecosystem, exposing a large collection of state-of-the-art solvers directly in R.
219+
### Model formats
237220

238-
Rather than implementing its own numerical methods, it delegates computation to Julia, allowing access to advanced algorithms, GPU acceleration, and high-performance execution that are often beyond native R tools.

0 commit comments

Comments
 (0)