From 3f547a5abbd56f31c0ffcf78765bc46d43412583 Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Fri, 14 Mar 2025 15:59:04 +0000 Subject: [PATCH 01/16] paper first draft --- paper/.gitignore | 2 + paper/paper.bib | 141 +++++++++++++++++++++++++++++++++++++++++++++++ paper/paper.md | 71 ++++++++++++++++++++++++ 3 files changed, 214 insertions(+) create mode 100644 paper/.gitignore create mode 100644 paper/paper.bib create mode 100644 paper/paper.md diff --git a/paper/.gitignore b/paper/.gitignore new file mode 100644 index 00000000..33fe13a5 --- /dev/null +++ b/paper/.gitignore @@ -0,0 +1,2 @@ +*.pdf +jats \ No newline at end of file diff --git a/paper/paper.bib b/paper/paper.bib new file mode 100644 index 00000000..4c85244c --- /dev/null +++ b/paper/paper.bib @@ -0,0 +1,141 @@ +@software{cranelift, + author = {{Bytecode Alliance}}, + title = {cranelift}, + url = {https://wasmtime.dev/}, + version = {0.115.1}, + date = {2025-03-13}, +} + +@software{nalgebra, + author = {{Dimforge}}, + title = {nalgebra}, + url = {https://github.com/dimforge/nalgebra}, + version = {0.33.2}, + date = {2025-03-13}, +} + +@software{faer, + author = {Sarah El Kazdadi}, + title = {faer-rs}, + url = {https://faer-rs.github.io/}, + version = {0.1.0}, + date = {2025-03-13}, +} + +@article{virtanen2020scipy, + title={SciPy 1.0: fundamental algorithms for scientific computing in Python}, + author={Virtanen, Pauli and Gommers, Ralf and Oliphant, Travis E and Haberland, Matt and Reddy, Tyler and Cournapeau, David and Burovski, Evgeni and Peterson, Pearu and Weckesser, Warren and Bright, Jonathan and others}, + journal={Nature methods}, + volume={17}, + number={3}, + pages={261--272}, + year={2020}, + publisher={Nature Publishing Group US New York} +} + +@article{shampine1997matlab, + title={The matlab ode suite}, + author={Shampine, Lawrence F and Reichelt, Mark W}, + journal={SIAM journal on scientific computing}, + volume={18}, + number={1}, + pages={1--22}, + year={1997}, + publisher={SIAM} +} + +@article{gardner2022sundials, + title = {Enabling new flexibility in the {SUNDIALS} suite of nonlinear and differential/algebraic equation solvers}, + author = {Gardner, David J and Reynolds, Daniel R and Woodward, Carol S and Balos, Cody J}, + journal = {ACM Transactions on Mathematical Software (TOMS)}, + publisher = {ACM}, + volume = {48}, + number = {3}, + pages = {1--24}, + year = {2022}, + doi = {10.1145/3539801} +} + +@article{DifferentialEquations.jl-2017, + author = {Rackauckas, Christopher and Nie, Qing}, + doi = {10.5334/jors.151}, + journal = {The Journal of Open Research Software}, + keywords = {Applied Mathematics}, + note = {Exported from https://app.dimensions.ai on 2019/05/05}, + number = {1}, + pages = {}, + title = {DifferentialEquations.jl – A Performant and Feature-Rich Ecosystem for Solving Differential Equations in Julia}, + url = {https://app.dimensions.ai/details/publication/pub.1085583166 and http://openresearchsoftware.metajnl.com/articles/10.5334/jors.151/galley/245/download/}, + volume = {5}, + year = {2017} +} + +@phdthesis{kidger2021on, + title={{O}n {N}eural {D}ifferential {E}quations}, + author={Patrick Kidger}, + year={2021}, + school={University of Oxford}, +} + +@article{byrne1975polyalgorithm, + title={A polyalgorithm for the numerical solution of ordinary differential equations}, + author={Byrne, George D. and Hindmarsh, Alan C.}, + journal={ACM Transactions on Mathematical Software (TOMS)}, + volume={1}, + number={1}, + pages={71--96}, + year={1975}, + publisher={ACM New York, NY, USA} +} + +@article{bank1985transient, + title={Transient simulation of silicon devices and circuits}, + author={Bank, Randolph E and Coughran, William M and Fichtner, Wolfgang and Grosse, Eric H and Rose, Donald J and Smith, R Kent}, + journal={IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems}, + volume={4}, + number={4}, + pages={436--451}, + year={1985}, + publisher={IEEE} +} + +@article{hosea1996analysis, + title={Analysis and implementation of TR-BDF2}, + author={Hosea, ME and Shampine, LF}, + journal={Applied Numerical Mathematics}, + volume={20}, + number={1-2}, + pages={21--37}, + year={1996}, + publisher={Elsevier} +} + +@article{jorgensen2018family, + title={A family of ESDIRK integration methods}, + author={J{\o}rgensen, John Bagterp and Kristensen, Morten Rode and Thomsen, Per Grove}, + journal={arXiv preprint arXiv:1803.01613}, + year={2018} +} + +@inproceedings{moses22enzyme, +author = {Moses, William S. and Narayanan, Sri Hari Krishna and Paehler, Ludger and Churavy, Valentin and Schanen, Michel and H\"{u}ckelheim, Jan and Doerfert, Johannes and Hovland, Paul}, +title = {Scalable Automatic Differentiation of Multiple Parallel Paradigms through Compiler Augmentation}, +year = {2022}, +isbn = {9784665454445}, +publisher = {IEEE Press}, +booktitle = {Proceedings of the International Conference on High Performance Computing, Networking, Storage and Analysis}, +articleno = {60}, +numpages = {18}, +keywords = {automatic differentiation, tasks, OpenMP, compiler, Julia, parallel, Enzyme, C++, RAJA, hybrid parallelization, MPI, distributed, LLVM}, +location = {Dallas, Texas}, +series = {SC '22} +} + +@inproceedings{lattner2004llvm, + title={LLVM: A compilation framework for lifelong program analysis \& transformation}, + author={Lattner, Chris and Adve, Vikram}, + booktitle={International symposium on code generation and optimization, 2004. CGO 2004.}, + pages={75--86}, + year={2004}, + organization={IEEE} +} \ No newline at end of file diff --git a/paper/paper.md b/paper/paper.md new file mode 100644 index 00000000..5e14a666 --- /dev/null +++ b/paper/paper.md @@ -0,0 +1,71 @@ +--- +title: 'DiffSol: A Rust crate for solving differential equations' +tags: + - rust + - scientific computing + - solver + - ordinary differential equations + - differential Algebraic equations + - runge-kutta + - backward differentiation formula +authors: + - name: Martin Robinson + orcid: 0000-0002-1572-6782 + corresponding: true + affiliation: 1 + - name: Alex Allmont + affiliation: 1 + + +affiliations: + - name: Oxford Research Software Engineering Group, Doctoral Training Centre, University of Oxford, Oxford, UK + index: 1 + ror: 052gg0110 +date: 12 March 2025 +bibliography: paper.bib +--- + +# Summary + +Ordinary Differential Equations (ODEs) are powerful tools for modelling a wide range of physical systems. Unlike purely data-driven models, ODEs can be based on the underlying physics, biology, or chemistry of the system being modelled, making them particularly useful for predicting the behaviour of a system under conditions that have not been observed. ODEs can be used to model everything from the motion of planets to the spread of infectious diseases. + +`Diffsol` is a Rust crate for solving ordinary differential equations (ODEs) or semi-explicit differential algebraic equations (DAEs). It can solve equations in the following form: + +$$ +M \frac{dy}{dt} = f(t, y, p) +$$ + +where $y$ is the state of the system, $p$ are a set of parameters, $t$ is time, $f(t, y, p)$ is a function that describes how the state of the system changes over time and $M$ is an optional and possibly singular mass matrix. The solution to an ODE is a function $y(t)$ that satisfies the ODE and any initial conditions. + +The equations (e.g. $f(t, y, p)$) can be provided by the user either using Rust code, or a custom Domain Specific Language (DSL) called `DiffSL`. `DiffSL` uses automatic differentiation using Enzyme [@moses22enzyme] to calculate the necessary gradients, and JIT compilation (using either `LLVM` [@lattner2004llvm] or `Cranelift` [@cranelift]) to generate efficient native code at runtime. The DSL is ideal for using `DiffSol` from a higher-level language like Python or R while still maintaining similar performance to pure rust. + +ODE solvers require linear algebra containers (e.g. vectors, matrices), operators and linear solvers. `DiffSol` allows users to choose both dense and sparse matrices and solvers from the `nalgebra` [@nalgebra] or `faer` [@faer] crates, and uses a trait-based approach to allow other linear algebra libraries to be added at a later date. + +# Statement of need + +ODE solvers have a long history in scientific computing, and many libraries currently exist. Some notable examples include `scipy.integrate.odeint` [@virtanen2020scipy] in Python, `ode45` [@shampine1997matlab] in MATLAB, and the `Sundials` suite of solvers [@gardner2022sundials] in C. Rust is a systems programming language that is gaining popularity in the scientific computing community due to its performance, safety, and ease of use. There is currently no ODE solver library written in Rust that provides the same level of functionality as these other libraries, and this is the gap that `DiffSol` aims to fill. + +ODE solvers written in lower-level languages like C, Fortran or Rust offer significant performance benifits. However, these solvers are more difficult to wrap and use in higher-level languages like Python or MATLAB, primarily because users must supply their equations in the language of the solver. `DiffSol` solves this issue by providing its own custom `DiffSL` DSL which is JIT compiled to efficient native code at run-time, meaning that users from from a higher-level language like Python or R can specify their equations using a simple string-based format while still maintaining similar performance to pure Rust. Two other popular ODE solvers that take advantage of JIT compilation are `DifferentialEquations.jl` [@DifferentialEquations.jl-2017] in Julia, and `diffrax` [@kidger2021on] in Python. However, both these packages compile the entire solver as well as the equations, which is a significant amount of code. `DiffSol` only compiles the equations, meaning that it has a significantly smaller "time-to-first-plot" for users. + +# Features + +The following solvers are available in `DiffSol`: + +1. A variable order Backwards Difference Formulae (BDF) solver, suitable for stiff problems and singular mass matrices. The basic algorithm is derived in @byrne1975polyalgorithm, however this particular implementation follows that implemented in the Matlab routine ode15s [@shampine1997matlab] and the SciPy implementation [@virtanen2020scipy], which features the NDF formulas for improved stability +2. A Singly Diagonally Implicit Runge-Kutta (SDIRK or ESDIRK) solver, suitable for moderately stiff problems and singular mass matrices. Two different butcher tableau are provided, TR-BDF2 [@bank1985transient, @hosea1996analysis] and ESDIRK34 [@jorgensen2018family], or users can supply their own. + +All solvers feature: + +- Linear algebra containers and linear solvers from the `nalgebra` or `faer` crates, including both dense and sparse matrix support. +- Adaptive step-size control to given relative and absolute tolerances. Tolerances can be set separately for the main equations, quadrature of the output function, and sensitivity analysis. +- Dense output, interpolating to times provided by the user. +- Event handling, stopping when a given condition $g_e(t, y, p)$ is met or at a specific time. +- Numerical quadrature of an optional output $g_o(t, y, p)$ function over time. +- Forward sensitivity analysis, calculating the gradient of an output function or the solver states $y$ with respect to the parameters $p$. +- Adjoint sensitivity analysis, calculating the gradient of cost function $G(p)$ with respect to the parameters $p$. The cost function can be the integral of a continuous output function $g(t, y, p)$ or a sum of a set of discrete functions $h_i(t_i, y, p)$ at time points $t_i$. + +# Acknowledgements + +We greatfully acknowledge the support of all the contributors to the `DiffSol` project, for their advice, enthusiasm, bug reports and code contributions. In particular, we would like to thank the authors of the `pharmsol` crate, Julian Otalvaro and Markus Hovd. + +# References From 424b46a56ea38a1a759879f073658280c7ca7be7 Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Sat, 15 Mar 2025 23:01:44 +0000 Subject: [PATCH 02/16] update ack --- paper/paper.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper/paper.md b/paper/paper.md index 5e14a666..1f83d08d 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -62,10 +62,10 @@ All solvers feature: - Event handling, stopping when a given condition $g_e(t, y, p)$ is met or at a specific time. - Numerical quadrature of an optional output $g_o(t, y, p)$ function over time. - Forward sensitivity analysis, calculating the gradient of an output function or the solver states $y$ with respect to the parameters $p$. -- Adjoint sensitivity analysis, calculating the gradient of cost function $G(p)$ with respect to the parameters $p$. The cost function can be the integral of a continuous output function $g(t, y, p)$ or a sum of a set of discrete functions $h_i(t_i, y, p)$ at time points $t_i$. +- Adjoint sensitivity analysis, calculating the gradient of cost function $G(p)$ with respect to the parameters $p$. The cost function can be the integral of a continuous output function $g(t, y, p)$ or a sum of a set of discrete functions $g_i(t_i, y, p)$ at time points $t_i$. # Acknowledgements -We greatfully acknowledge the support of all the contributors to the `DiffSol` project, for their advice, enthusiasm, bug reports and code contributions. In particular, we would like to thank the authors of the `pharmsol` crate, Julian Otalvaro and Markus Hovd. +We greatfully acknowledge the support of all the past and future contributors to the `DiffSol` project, for their advice, enthusiasm, bug reports and code. In particular, we would like to thank the authors of the `pharmsol` crate, Julian Otalvaro and Markus Hovd. # References From 3780ae28d1e765bccaf4d26f5fd87726fecfaa70 Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Thu, 6 Nov 2025 09:23:59 +0000 Subject: [PATCH 03/16] add github action and add pydiffsol --- .github/workflows/draft-pdf.yml | 24 ++++++++++++++++++++++++ paper/paper.bib | 17 +++++++++++++++++ paper/paper.md | 23 +++++++++++++++-------- 3 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/draft-pdf.yml diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml new file mode 100644 index 00000000..a319c6c7 --- /dev/null +++ b/.github/workflows/draft-pdf.yml @@ -0,0 +1,24 @@ +name: Draft PDF +on: [push] + +jobs: + paper: + runs-on: ubuntu-latest + name: Paper Draft + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build draft PDF + uses: openjournals/openjournals-draft-action@master + with: + journal: joss + # This should be the path to the paper within your repo. + paper-path: paper.md + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: paper + # This is the output path where Pandoc will write the compiled + # PDF. Note, this should be the same directory as the input + # paper.md + path: paper.pdf \ No newline at end of file diff --git a/paper/paper.bib b/paper/paper.bib index 4c85244c..d883dd10 100644 --- a/paper/paper.bib +++ b/paper/paper.bib @@ -138,4 +138,21 @@ @inproceedings{lattner2004llvm pages={75--86}, year={2004}, organization={IEEE} +} + +@article{tsitouras2011runge, + title={Runge--Kutta pairs of order 5 (4) satisfying only the first column simplifying assumption}, + author={Tsitouras, Ch}, + journal={Computers \& mathematics with applications}, + volume={62}, + number={2}, + pages={770--775}, + year={2011}, + publisher={Elsevier} +} + +@software{PyO3_Project_and_Contributors_PyO3, +author = {{PyO3 Project and Contributors}}, +license = {["Apache-2.0", "MIT"]}, +title = {{PyO3}} } \ No newline at end of file diff --git a/paper/paper.md b/paper/paper.md index 1f83d08d..94f666ea 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -1,5 +1,5 @@ --- -title: 'DiffSol: A Rust crate for solving differential equations' +title: '`diffsol`: A Rust crate for solving differential equations' tags: - rust - scientific computing @@ -29,7 +29,7 @@ bibliography: paper.bib Ordinary Differential Equations (ODEs) are powerful tools for modelling a wide range of physical systems. Unlike purely data-driven models, ODEs can be based on the underlying physics, biology, or chemistry of the system being modelled, making them particularly useful for predicting the behaviour of a system under conditions that have not been observed. ODEs can be used to model everything from the motion of planets to the spread of infectious diseases. -`Diffsol` is a Rust crate for solving ordinary differential equations (ODEs) or semi-explicit differential algebraic equations (DAEs). It can solve equations in the following form: +[`diffsol`](https://github.com/martinjrobins/diffsol) is a Rust crate for solving ordinary differential equations (ODEs) or semi-explicit differential algebraic equations (DAEs). It can solve equations in the following form: $$ M \frac{dy}{dt} = f(t, y, p) @@ -37,22 +37,23 @@ $$ where $y$ is the state of the system, $p$ are a set of parameters, $t$ is time, $f(t, y, p)$ is a function that describes how the state of the system changes over time and $M$ is an optional and possibly singular mass matrix. The solution to an ODE is a function $y(t)$ that satisfies the ODE and any initial conditions. -The equations (e.g. $f(t, y, p)$) can be provided by the user either using Rust code, or a custom Domain Specific Language (DSL) called `DiffSL`. `DiffSL` uses automatic differentiation using Enzyme [@moses22enzyme] to calculate the necessary gradients, and JIT compilation (using either `LLVM` [@lattner2004llvm] or `Cranelift` [@cranelift]) to generate efficient native code at runtime. The DSL is ideal for using `DiffSol` from a higher-level language like Python or R while still maintaining similar performance to pure rust. +The equations (e.g. $f(t, y, p)$) can be provided by the user either using Rust code, or a custom Domain Specific Language (DSL) called `DiffSL`. `DiffSL` uses automatic differentiation using Enzyme [@moses22enzyme] to calculate the necessary gradients, and JIT compilation (using either `LLVM` [@lattner2004llvm] or `Cranelift` [@cranelift]) to generate efficient native code at runtime. The DSL is ideal for using `diffsol` from a higher-level language like Python or R while still maintaining similar performance to pure rust. -ODE solvers require linear algebra containers (e.g. vectors, matrices), operators and linear solvers. `DiffSol` allows users to choose both dense and sparse matrices and solvers from the `nalgebra` [@nalgebra] or `faer` [@faer] crates, and uses a trait-based approach to allow other linear algebra libraries to be added at a later date. +ODE solvers require linear algebra containers (e.g. vectors, matrices), operators and linear solvers. `diffsol` allows users to choose both dense and sparse matrices and solvers from the `nalgebra` [@nalgebra] or `faer` [@faer] crates, and uses a trait-based approach to allow other linear algebra libraries to be added at a later date. # Statement of need -ODE solvers have a long history in scientific computing, and many libraries currently exist. Some notable examples include `scipy.integrate.odeint` [@virtanen2020scipy] in Python, `ode45` [@shampine1997matlab] in MATLAB, and the `Sundials` suite of solvers [@gardner2022sundials] in C. Rust is a systems programming language that is gaining popularity in the scientific computing community due to its performance, safety, and ease of use. There is currently no ODE solver library written in Rust that provides the same level of functionality as these other libraries, and this is the gap that `DiffSol` aims to fill. +ODE solvers have a long history in scientific computing, and many libraries currently exist. Some notable examples include `scipy.integrate.odeint` [@virtanen2020scipy] in Python, `ode45` [@shampine1997matlab] in MATLAB, and the `Sundials` suite of solvers [@gardner2022sundials] in C. Rust is a systems programming language that is gaining popularity in the scientific computing community due to its performance, safety, and ease of use. There is currently no ODE solver library written in Rust that provides the same level of functionality as these other libraries, and this is the gap that `diffsol` aims to fill. -ODE solvers written in lower-level languages like C, Fortran or Rust offer significant performance benifits. However, these solvers are more difficult to wrap and use in higher-level languages like Python or MATLAB, primarily because users must supply their equations in the language of the solver. `DiffSol` solves this issue by providing its own custom `DiffSL` DSL which is JIT compiled to efficient native code at run-time, meaning that users from from a higher-level language like Python or R can specify their equations using a simple string-based format while still maintaining similar performance to pure Rust. Two other popular ODE solvers that take advantage of JIT compilation are `DifferentialEquations.jl` [@DifferentialEquations.jl-2017] in Julia, and `diffrax` [@kidger2021on] in Python. However, both these packages compile the entire solver as well as the equations, which is a significant amount of code. `DiffSol` only compiles the equations, meaning that it has a significantly smaller "time-to-first-plot" for users. +ODE solvers written in lower-level languages like C, Fortran or Rust offer significant performance benifits. However, these solvers are more difficult to wrap and use in higher-level languages like Python or MATLAB, primarily because users must supply their equations in the language of the solver. `diffsol` solves this issue by providing its own custom `DiffSL` DSL which is JIT compiled to efficient native code at run-time, meaning that users from from a higher-level language like Python or R can specify their equations using a simple string-based format while still maintaining similar performance to pure Rust. Two other popular ODE solvers that take advantage of JIT compilation are `DifferentialEquations.jl` [@DifferentialEquations.jl-2017] in Julia, and `diffrax` [@kidger2021on] in Python. However, both these packages compile the entire solver as well as the equations, which is a significant amount of code. `diffSol` only compiles the equations, meaning that it has a significantly smaller "time-to-first-plot" for users. # Features -The following solvers are available in `DiffSol`: +The following solvers are available in `diffsol`: 1. A variable order Backwards Difference Formulae (BDF) solver, suitable for stiff problems and singular mass matrices. The basic algorithm is derived in @byrne1975polyalgorithm, however this particular implementation follows that implemented in the Matlab routine ode15s [@shampine1997matlab] and the SciPy implementation [@virtanen2020scipy], which features the NDF formulas for improved stability 2. A Singly Diagonally Implicit Runge-Kutta (SDIRK or ESDIRK) solver, suitable for moderately stiff problems and singular mass matrices. Two different butcher tableau are provided, TR-BDF2 [@bank1985transient, @hosea1996analysis] and ESDIRK34 [@jorgensen2018family], or users can supply their own. +3. A variable order Explict Runge-Kutta (ERK) solver, suitable for non-stiff problems. One butcher tableau is provided, the 4th order TSIT45 [tsitouras2011runge], or users can supply their own. All solvers feature: @@ -64,8 +65,14 @@ All solvers feature: - Forward sensitivity analysis, calculating the gradient of an output function or the solver states $y$ with respect to the parameters $p$. - Adjoint sensitivity analysis, calculating the gradient of cost function $G(p)$ with respect to the parameters $p$. The cost function can be the integral of a continuous output function $g(t, y, p)$ or a sum of a set of discrete functions $g_i(t_i, y, p)$ at time points $t_i$. +# Bindings in higher-level languages + +[`pydiffsol`](https://github.com/alexallmont/pydiffsol) provides Python bindings to `diffsol` using the `PyO3` [PyO3_Project_and_Contributors_PyO3] crate. It allows users to define ODEs in Python using the `DiffSL` DSL, and solve them using the Rust `diffsol` library. `pydiffsol` aims to provide a simple and easy-to-use interface for solving ODEs in Python, while still maintaining the performance benefits of using Rust under the hood. + +The goal is to develop further [bindings to other higher-level languages][https://github.com/martinjrobins/diffsol/issues/131], including R, JAX and JavaScript, exploiting the `DiffSL` DSL to provide high performance while maintaining ease of use and positioning the core `diffsol` library as a widely used cross-language, cross-platform, high-performance ODE solver. + # Acknowledgements -We greatfully acknowledge the support of all the past and future contributors to the `DiffSol` project, for their advice, enthusiasm, bug reports and code. In particular, we would like to thank the authors of the `pharmsol` crate, Julian Otalvaro and Markus Hovd. +We gratefully acknowledge the support of all the past and future contributors to the `diffsol` project, for their advice, enthusiasm, bug reports and code. In particular, we would like to thank the authors of the `pharmsol` crate, Julian Otalvaro and Markus Hovd. # References From 8a96f4417693943027b1ff0b49fa95e56db3dc90 Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Thu, 6 Nov 2025 10:03:29 +0000 Subject: [PATCH 04/16] fix paths --- .github/workflows/draft-pdf.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml index a319c6c7..d6f17740 100644 --- a/.github/workflows/draft-pdf.yml +++ b/.github/workflows/draft-pdf.yml @@ -13,7 +13,7 @@ jobs: with: journal: joss # This should be the path to the paper within your repo. - paper-path: paper.md + paper-path: paper/paper.md - name: Upload uses: actions/upload-artifact@v4 with: @@ -21,4 +21,4 @@ jobs: # This is the output path where Pandoc will write the compiled # PDF. Note, this should be the same directory as the input # paper.md - path: paper.pdf \ No newline at end of file + path: paper/paper.pdf \ No newline at end of file From e052603098ae3d965a3536b7ebed8d72ab45cb3c Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Thu, 6 Nov 2025 10:05:52 +0000 Subject: [PATCH 05/16] fix links --- paper/paper.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paper/paper.md b/paper/paper.md index 94f666ea..a23f87ff 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -1,5 +1,5 @@ --- -title: '`diffsol`: A Rust crate for solving differential equations' +title: '`diffsol`: Rust crate for solving differential equations' tags: - rust - scientific computing @@ -53,7 +53,7 @@ The following solvers are available in `diffsol`: 1. A variable order Backwards Difference Formulae (BDF) solver, suitable for stiff problems and singular mass matrices. The basic algorithm is derived in @byrne1975polyalgorithm, however this particular implementation follows that implemented in the Matlab routine ode15s [@shampine1997matlab] and the SciPy implementation [@virtanen2020scipy], which features the NDF formulas for improved stability 2. A Singly Diagonally Implicit Runge-Kutta (SDIRK or ESDIRK) solver, suitable for moderately stiff problems and singular mass matrices. Two different butcher tableau are provided, TR-BDF2 [@bank1985transient, @hosea1996analysis] and ESDIRK34 [@jorgensen2018family], or users can supply their own. -3. A variable order Explict Runge-Kutta (ERK) solver, suitable for non-stiff problems. One butcher tableau is provided, the 4th order TSIT45 [tsitouras2011runge], or users can supply their own. +3. A variable order Explict Runge-Kutta (ERK) solver, suitable for non-stiff problems. One butcher tableau is provided, the 4th order TSIT45 [@tsitouras2011runge], or users can supply their own. All solvers feature: @@ -67,7 +67,7 @@ All solvers feature: # Bindings in higher-level languages -[`pydiffsol`](https://github.com/alexallmont/pydiffsol) provides Python bindings to `diffsol` using the `PyO3` [PyO3_Project_and_Contributors_PyO3] crate. It allows users to define ODEs in Python using the `DiffSL` DSL, and solve them using the Rust `diffsol` library. `pydiffsol` aims to provide a simple and easy-to-use interface for solving ODEs in Python, while still maintaining the performance benefits of using Rust under the hood. +[`pydiffsol`](https://github.com/alexallmont/pydiffsol) provides Python bindings to `diffsol` using the `PyO3` [@PyO3_Project_and_Contributors_PyO3] crate. It allows users to define ODEs in Python using the `DiffSL` DSL, and solve them using the Rust `diffsol` library. `pydiffsol` aims to provide a simple and easy-to-use interface for solving ODEs in Python, while still maintaining the performance benefits of using Rust under the hood. The goal is to develop further [bindings to other higher-level languages][https://github.com/martinjrobins/diffsol/issues/131], including R, JAX and JavaScript, exploiting the `DiffSL` DSL to provide high performance while maintaining ease of use and positioning the core `diffsol` library as a widely used cross-language, cross-platform, high-performance ODE solver. From 42cfb3b616814d3a3b50bdfa145ebe2a5aed93c9 Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Thu, 6 Nov 2025 10:08:14 +0000 Subject: [PATCH 06/16] fix more links --- paper/paper.bib | 2 +- paper/paper.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paper/paper.bib b/paper/paper.bib index d883dd10..de71e393 100644 --- a/paper/paper.bib +++ b/paper/paper.bib @@ -151,7 +151,7 @@ @article{tsitouras2011runge publisher={Elsevier} } -@software{PyO3_Project_and_Contributors_PyO3, +@software{PyO3_Project_and_Contributors, author = {{PyO3 Project and Contributors}}, license = {["Apache-2.0", "MIT"]}, title = {{PyO3}} diff --git a/paper/paper.md b/paper/paper.md index a23f87ff..2ccfbf91 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -67,9 +67,9 @@ All solvers feature: # Bindings in higher-level languages -[`pydiffsol`](https://github.com/alexallmont/pydiffsol) provides Python bindings to `diffsol` using the `PyO3` [@PyO3_Project_and_Contributors_PyO3] crate. It allows users to define ODEs in Python using the `DiffSL` DSL, and solve them using the Rust `diffsol` library. `pydiffsol` aims to provide a simple and easy-to-use interface for solving ODEs in Python, while still maintaining the performance benefits of using Rust under the hood. +[`pydiffsol`](https://github.com/alexallmont/pydiffsol) provides Python bindings to `diffsol` using the `PyO3` [@PyO3_Project_and_Contributors] crate. It allows users to define ODEs in Python using the `DiffSL` DSL, and solve them using the Rust `diffsol` library. `pydiffsol` aims to provide a simple and easy-to-use interface for solving ODEs in Python, while still maintaining the performance benefits of using Rust under the hood. -The goal is to develop further [bindings to other higher-level languages][https://github.com/martinjrobins/diffsol/issues/131], including R, JAX and JavaScript, exploiting the `DiffSL` DSL to provide high performance while maintaining ease of use and positioning the core `diffsol` library as a widely used cross-language, cross-platform, high-performance ODE solver. +The goal is to develop further [bindings to other higher-level languages](https://github.com/martinjrobins/diffsol/issues/131), including R, JAX and JavaScript, exploiting the `DiffSL` DSL to provide high performance while maintaining ease of use and positioning the core `diffsol` library as a widely used cross-language, cross-platform, high-performance ODE solver. # Acknowledgements From 4c1fbcea304aaad673d2430912f236ed48a752a0 Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Thu, 6 Nov 2025 11:14:09 +0000 Subject: [PATCH 07/16] add modelica --- README.md | 2 +- paper/paper.bib | 12 ++++++++++++ paper/paper.md | 6 +++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3d6a80dd..56db6109 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ The following ODE solvers are available in diffsol 1. A variable order Backwards Difference Formulae (BDF) solver, suitable for stiff problems and singular mass matrices. The basic algorithm is derived in [(Byrne & Hindmarsh, 1975)](#1), however this particular implementation follows that implemented in the Matlab routine ode15s [(Shampine & Reichelt, 1997)](#4) and the SciPy implementation [(Virtanen et al., 2020)](#5), which features the NDF formulas for improved stability 2. A Singly Diagonally Implicit Runge-Kutta (SDIRK or ESDIRK) solver, suitable for moderately stiff problems and singular mass matrices. Two different butcher tableau are provided, TR-BDF2 [(Hosea & Shampine, 1996)](#2) and ESDIRK34 [(Jørgensen et al., 2018)](#3), or users can supply their own. -3. A variable order Explict Runge-Kutta (ERK) solver, suitable for non-stiff problems. One butcher tableau is provided, the 4th order TSIT45 [(Tsitouras, 2011)](#5), or users can supply their own. +3. A variable order Explicit Runge-Kutta (ERK) solver, suitable for non-stiff problems. One butcher tableau is provided, the 4th order TSIT45 [(Tsitouras, 2011)](#5), or users can supply their own. All solvers feature: diff --git a/paper/paper.bib b/paper/paper.bib index de71e393..a68f378e 100644 --- a/paper/paper.bib +++ b/paper/paper.bib @@ -154,5 +154,17 @@ @article{tsitouras2011runge @software{PyO3_Project_and_Contributors, author = {{PyO3 Project and Contributors}}, license = {["Apache-2.0", "MIT"]}, +website = {https://github.com/PyO3}, title = {{PyO3}} +} + +@article{fritzson2020OpenModelica, +author = {Fritzson, Peter and Pop, Adrian and Abdelhak, Karim and Ashgar, Adeel and Bachmann, Bernhard and Braun, Willi and Bouskela, Daniel and Braun, Robert and Buffoni, Lena and Casella, Francesco and Castro, Rodrigo and Franke, Rüdiger and Fritzson, Dag and Gebremedhin, Mahder and Heuermann, Andreas and Lie, Bernt and Mengist, Alachew and Mikelsons, Lars and Moudgalya, Kannan and Ochel, Lennart and Palanisamy, Arunkumar and Ruge, Vitalij and Schamai, Wladimir and Sjölund, Martin and Thiele, Bernhard and Tinnerholm, John and Östlund, Per}, +doi = {10.4173/mic.2020.4.1}, +journal = {Modeling, Identification and Control}, +number = {4}, +pages = {241--295}, +title = {{The OpenModelica Integrated Environment for Modeling, Simulation, and Model-Based Development}}, +volume = {41}, +year = {2020} } \ No newline at end of file diff --git a/paper/paper.md b/paper/paper.md index 2ccfbf91..5a450baf 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -45,7 +45,7 @@ ODE solvers require linear algebra containers (e.g. vectors, matrices), operator ODE solvers have a long history in scientific computing, and many libraries currently exist. Some notable examples include `scipy.integrate.odeint` [@virtanen2020scipy] in Python, `ode45` [@shampine1997matlab] in MATLAB, and the `Sundials` suite of solvers [@gardner2022sundials] in C. Rust is a systems programming language that is gaining popularity in the scientific computing community due to its performance, safety, and ease of use. There is currently no ODE solver library written in Rust that provides the same level of functionality as these other libraries, and this is the gap that `diffsol` aims to fill. -ODE solvers written in lower-level languages like C, Fortran or Rust offer significant performance benifits. However, these solvers are more difficult to wrap and use in higher-level languages like Python or MATLAB, primarily because users must supply their equations in the language of the solver. `diffsol` solves this issue by providing its own custom `DiffSL` DSL which is JIT compiled to efficient native code at run-time, meaning that users from from a higher-level language like Python or R can specify their equations using a simple string-based format while still maintaining similar performance to pure Rust. Two other popular ODE solvers that take advantage of JIT compilation are `DifferentialEquations.jl` [@DifferentialEquations.jl-2017] in Julia, and `diffrax` [@kidger2021on] in Python. However, both these packages compile the entire solver as well as the equations, which is a significant amount of code. `diffSol` only compiles the equations, meaning that it has a significantly smaller "time-to-first-plot" for users. +ODE solvers written in lower-level languages like C, Fortran or Rust offer significant performance benefits. However, these solvers are often more difficult to wrap and use in higher-level languages like Python or MATLAB, primarily because users must supply their equations in the language of the solver. `diffsol` solves this issue by providing its own custom `DiffSL` DSL which is JIT compiled to efficient native code at run-time, meaning that users from a higher-level language like Python or R can specify their equations using a simple string-based format while still maintaining similar performance to pure Rust. Two other popular ODE solvers that take advantage of JIT compilation are `DifferentialEquations.jl` [@DifferentialEquations.jl-2017] in Julia, and `diffrax` [@kidger2021on] in Python. However, both these packages compile the entire solver as well as the equations, which is a significant amount of code. `diffSol` only compiles the equations, meaning that it has a significantly smaller "time-to-first-plot" for users. Another popular differential equations solver package utilising a DSL is OpenModelica [@fritzson2020OpenModelica]. Wrappers to this package in higher-level languages like Python rely on messaging to a separate OpenModelica server, which can be slow and more complicated to set up. In contrast, `diffsol` can be integrated directly into higher-level languages using language bindings and linking to a single shared or static library, see for example the `pydiffsol` Python bindings discussed below. # Features @@ -53,7 +53,7 @@ The following solvers are available in `diffsol`: 1. A variable order Backwards Difference Formulae (BDF) solver, suitable for stiff problems and singular mass matrices. The basic algorithm is derived in @byrne1975polyalgorithm, however this particular implementation follows that implemented in the Matlab routine ode15s [@shampine1997matlab] and the SciPy implementation [@virtanen2020scipy], which features the NDF formulas for improved stability 2. A Singly Diagonally Implicit Runge-Kutta (SDIRK or ESDIRK) solver, suitable for moderately stiff problems and singular mass matrices. Two different butcher tableau are provided, TR-BDF2 [@bank1985transient, @hosea1996analysis] and ESDIRK34 [@jorgensen2018family], or users can supply their own. -3. A variable order Explict Runge-Kutta (ERK) solver, suitable for non-stiff problems. One butcher tableau is provided, the 4th order TSIT45 [@tsitouras2011runge], or users can supply their own. +3. A variable order Explicit Runge-Kutta (ERK) solver, suitable for non-stiff problems. One butcher tableau is provided, the 4th order TSIT45 [@tsitouras2011runge], or users can supply their own. All solvers feature: @@ -67,7 +67,7 @@ All solvers feature: # Bindings in higher-level languages -[`pydiffsol`](https://github.com/alexallmont/pydiffsol) provides Python bindings to `diffsol` using the `PyO3` [@PyO3_Project_and_Contributors] crate. It allows users to define ODEs in Python using the `DiffSL` DSL, and solve them using the Rust `diffsol` library. `pydiffsol` aims to provide a simple and easy-to-use interface for solving ODEs in Python, while still maintaining the performance benefits of using Rust under the hood. +[`pydiffsol`](https://github.com/alexallmont/pydiffsol) provides Python bindings to `diffsol` using the `PyO3` [@PyO3_Project_and_Contributors] crate. It allows users to define ODEs in Python using the `DiffSL` DSL, and solve them using the Rust `diffsol` library. `pydiffsol` aims to provide a simple and easy-to-use interface for solving ODEs in Python, while still maintaining the performance benifits of using Rust under the hood. The goal is to develop further [bindings to other higher-level languages](https://github.com/martinjrobins/diffsol/issues/131), including R, JAX and JavaScript, exploiting the `DiffSL` DSL to provide high performance while maintaining ease of use and positioning the core `diffsol` library as a widely used cross-language, cross-platform, high-performance ODE solver. From 083a5430a8b56ebbc22a4e4377fae5888bbd5875 Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Thu, 6 Nov 2025 11:17:30 +0000 Subject: [PATCH 08/16] fix pyo3 url --- paper/paper.bib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper/paper.bib b/paper/paper.bib index a68f378e..6e1acbae 100644 --- a/paper/paper.bib +++ b/paper/paper.bib @@ -154,7 +154,7 @@ @article{tsitouras2011runge @software{PyO3_Project_and_Contributors, author = {{PyO3 Project and Contributors}}, license = {["Apache-2.0", "MIT"]}, -website = {https://github.com/PyO3}, +url = {https://github.com/PyO3}, title = {{PyO3}} } From 9c1bd83f105a010fc57d508f8fee862ac3662862 Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Thu, 6 Nov 2025 11:18:33 +0000 Subject: [PATCH 09/16] minor fix --- paper/paper.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper/paper.md b/paper/paper.md index 5a450baf..8995f5c2 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -45,7 +45,7 @@ ODE solvers require linear algebra containers (e.g. vectors, matrices), operator ODE solvers have a long history in scientific computing, and many libraries currently exist. Some notable examples include `scipy.integrate.odeint` [@virtanen2020scipy] in Python, `ode45` [@shampine1997matlab] in MATLAB, and the `Sundials` suite of solvers [@gardner2022sundials] in C. Rust is a systems programming language that is gaining popularity in the scientific computing community due to its performance, safety, and ease of use. There is currently no ODE solver library written in Rust that provides the same level of functionality as these other libraries, and this is the gap that `diffsol` aims to fill. -ODE solvers written in lower-level languages like C, Fortran or Rust offer significant performance benefits. However, these solvers are often more difficult to wrap and use in higher-level languages like Python or MATLAB, primarily because users must supply their equations in the language of the solver. `diffsol` solves this issue by providing its own custom `DiffSL` DSL which is JIT compiled to efficient native code at run-time, meaning that users from a higher-level language like Python or R can specify their equations using a simple string-based format while still maintaining similar performance to pure Rust. Two other popular ODE solvers that take advantage of JIT compilation are `DifferentialEquations.jl` [@DifferentialEquations.jl-2017] in Julia, and `diffrax` [@kidger2021on] in Python. However, both these packages compile the entire solver as well as the equations, which is a significant amount of code. `diffSol` only compiles the equations, meaning that it has a significantly smaller "time-to-first-plot" for users. Another popular differential equations solver package utilising a DSL is OpenModelica [@fritzson2020OpenModelica]. Wrappers to this package in higher-level languages like Python rely on messaging to a separate OpenModelica server, which can be slow and more complicated to set up. In contrast, `diffsol` can be integrated directly into higher-level languages using language bindings and linking to a single shared or static library, see for example the `pydiffsol` Python bindings discussed below. +ODE solvers written in lower-level languages like C, Fortran or Rust offer significant performance benefits. However, these solvers are often more difficult to wrap and use in higher-level languages like Python or MATLAB, primarily because users must supply their equations in the language of the solver. `diffsol` solves this issue by providing its own custom `DiffSL` DSL which is JIT compiled to efficient native code at run-time, meaning that users from a higher-level language like Python or R can specify their equations using a simple string-based format while still maintaining similar performance to pure Rust. Two other popular ODE solvers that take advantage of JIT compilation are `DifferentialEquations.jl` [@DifferentialEquations.jl-2017] in Julia, and `diffrax` [@kidger2021on] in Python. However, both these packages compile the entire solver as well as the equations, which is a significant amount of code. `diffSol` only compiles the equations, meaning that it has a significantly smaller "time-to-first-plot" for users. Another popular differential equations solver package utilising a DSL is OpenModelica [@fritzson2020OpenModelica]. Wrappers to this package in higher-level languages like Python rely on messaging to a separate OpenModelica server, which can be slow and more complicated to set up. In contrast, `diffsol` can be integrated directly into higher-level languages using language bindings and linking to a single shared library, see for example the `pydiffsol` Python bindings discussed below. # Features From eadd649db583bed71ec5e2ee5423f2c0e7655efd Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Thu, 6 Nov 2025 11:40:22 +0000 Subject: [PATCH 10/16] update the date --- paper/paper.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper/paper.md b/paper/paper.md index 8995f5c2..040cbab2 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -5,7 +5,7 @@ tags: - scientific computing - solver - ordinary differential equations - - differential Algebraic equations + - differential algebraic equations - runge-kutta - backward differentiation formula authors: @@ -21,7 +21,7 @@ affiliations: - name: Oxford Research Software Engineering Group, Doctoral Training Centre, University of Oxford, Oxford, UK index: 1 ror: 052gg0110 -date: 12 March 2025 +date: 6 Nov 2025 bibliography: paper.bib --- From 29afe3176dbe206d0ebd2be718782c341c9c45c1 Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Thu, 6 Nov 2025 11:50:12 +0000 Subject: [PATCH 11/16] add Alex orcid --- paper/paper.md | 1 + 1 file changed, 1 insertion(+) diff --git a/paper/paper.md b/paper/paper.md index 040cbab2..67b5b08e 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -14,6 +14,7 @@ authors: corresponding: true affiliation: 1 - name: Alex Allmont + orcid: 0009-0001-4162-0180 affiliation: 1 From 0e10ca724755d80a3c4e8cca3168be663ec7be12 Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Thu, 6 Nov 2025 17:51:17 +0000 Subject: [PATCH 12/16] add dois --- paper/paper.bib | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/paper/paper.bib b/paper/paper.bib index 6e1acbae..83e1dad7 100644 --- a/paper/paper.bib +++ b/paper/paper.bib @@ -42,6 +42,7 @@ @article{shampine1997matlab pages={1--22}, year={1997}, publisher={SIAM} + doi = {10.1137/s1064827594276424} } @article{gardner2022sundials, @@ -97,6 +98,7 @@ @article{bank1985transient pages={436--451}, year={1985}, publisher={IEEE} + doi={10.1109/T-ED.1985.22232} } @article{hosea1996analysis, @@ -108,6 +110,7 @@ @article{hosea1996analysis pages={21--37}, year={1996}, publisher={Elsevier} + doi={10.1016/0168-9274(95)00115-8} } @article{jorgensen2018family, @@ -129,6 +132,7 @@ @inproceedings{moses22enzyme keywords = {automatic differentiation, tasks, OpenMP, compiler, Julia, parallel, Enzyme, C++, RAJA, hybrid parallelization, MPI, distributed, LLVM}, location = {Dallas, Texas}, series = {SC '22} +doi = {10.1109/SC41404.2022.00065} } @inproceedings{lattner2004llvm, @@ -149,6 +153,7 @@ @article{tsitouras2011runge pages={770--775}, year={2011}, publisher={Elsevier} + doi={10.1016/j.camwa.2011.06.002} } @software{PyO3_Project_and_Contributors, From 284523045f081cedbc22ee4bc30f7596fd40ed56 Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Thu, 6 Nov 2025 17:53:12 +0000 Subject: [PATCH 13/16] fix bib --- paper/paper.bib | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/paper/paper.bib b/paper/paper.bib index 83e1dad7..981623dd 100644 --- a/paper/paper.bib +++ b/paper/paper.bib @@ -41,7 +41,7 @@ @article{shampine1997matlab number={1}, pages={1--22}, year={1997}, - publisher={SIAM} + publisher={SIAM}, doi = {10.1137/s1064827594276424} } @@ -97,7 +97,7 @@ @article{bank1985transient number={4}, pages={436--451}, year={1985}, - publisher={IEEE} + publisher={IEEE}, doi={10.1109/T-ED.1985.22232} } @@ -109,7 +109,7 @@ @article{hosea1996analysis number={1-2}, pages={21--37}, year={1996}, - publisher={Elsevier} + publisher={Elsevier}, doi={10.1016/0168-9274(95)00115-8} } @@ -131,7 +131,7 @@ @inproceedings{moses22enzyme numpages = {18}, keywords = {automatic differentiation, tasks, OpenMP, compiler, Julia, parallel, Enzyme, C++, RAJA, hybrid parallelization, MPI, distributed, LLVM}, location = {Dallas, Texas}, -series = {SC '22} +series = {SC '22}, doi = {10.1109/SC41404.2022.00065} } @@ -152,7 +152,7 @@ @article{tsitouras2011runge number={2}, pages={770--775}, year={2011}, - publisher={Elsevier} + publisher={Elsevier}, doi={10.1016/j.camwa.2011.06.002} } From 92761f5463dfcdf2057028c6203d6ebdac28c84d Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Thu, 6 Nov 2025 18:00:56 +0000 Subject: [PATCH 14/16] more dois --- paper/paper.bib | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/paper/paper.bib b/paper/paper.bib index 981623dd..4faecfa9 100644 --- a/paper/paper.bib +++ b/paper/paper.bib @@ -30,7 +30,8 @@ @article{virtanen2020scipy number={3}, pages={261--272}, year={2020}, - publisher={Nature Publishing Group US New York} + publisher={Nature Publishing Group US New York}, + doi={10.1038/s41592-019-0686-2} } @article{shampine1997matlab, @@ -76,6 +77,7 @@ @phdthesis{kidger2021on author={Patrick Kidger}, year={2021}, school={University of Oxford}, + doi={h10.48550/arXiv.2202.02435} } @article{byrne1975polyalgorithm, @@ -86,7 +88,8 @@ @article{byrne1975polyalgorithm number={1}, pages={71--96}, year={1975}, - publisher={ACM New York, NY, USA} + publisher={ACM New York, NY, USA}, + doi={10.1145/355626.355636} } @article{bank1985transient, @@ -117,7 +120,8 @@ @article{jorgensen2018family title={A family of ESDIRK integration methods}, author={J{\o}rgensen, John Bagterp and Kristensen, Morten Rode and Thomsen, Per Grove}, journal={arXiv preprint arXiv:1803.01613}, - year={2018} + year={2018}, + doi= {10.48550/arXiv.1803.01613} } @inproceedings{moses22enzyme, @@ -141,7 +145,8 @@ @inproceedings{lattner2004llvm booktitle={International symposium on code generation and optimization, 2004. CGO 2004.}, pages={75--86}, year={2004}, - organization={IEEE} + organization={IEEE}, + doi={10.1109/CGO.2004.1281665} } @article{tsitouras2011runge, From 67b6342f5aac1c64906155bdd20b1fc712daa45d Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Thu, 13 Nov 2025 10:34:12 +0000 Subject: [PATCH 15/16] add pydiffsol to summary --- paper/paper.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper/paper.md b/paper/paper.md index 67b5b08e..c2433bee 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -38,7 +38,7 @@ $$ where $y$ is the state of the system, $p$ are a set of parameters, $t$ is time, $f(t, y, p)$ is a function that describes how the state of the system changes over time and $M$ is an optional and possibly singular mass matrix. The solution to an ODE is a function $y(t)$ that satisfies the ODE and any initial conditions. -The equations (e.g. $f(t, y, p)$) can be provided by the user either using Rust code, or a custom Domain Specific Language (DSL) called `DiffSL`. `DiffSL` uses automatic differentiation using Enzyme [@moses22enzyme] to calculate the necessary gradients, and JIT compilation (using either `LLVM` [@lattner2004llvm] or `Cranelift` [@cranelift]) to generate efficient native code at runtime. The DSL is ideal for using `diffsol` from a higher-level language like Python or R while still maintaining similar performance to pure rust. +The equations (e.g. $f(t, y, p)$) can be provided by the user either using Rust code, or a custom Domain Specific Language (DSL) called `DiffSL`. `DiffSL` uses automatic differentiation using Enzyme [@moses22enzyme] to calculate the necessary gradients, and JIT compilation (using either `LLVM` [@lattner2004llvm] or `Cranelift` [@cranelift]) to generate efficient native code at runtime. The DSL is ideal for using `diffsol` from a higher-level language like Python or R while still maintaining similar performance to pure rust. Diffsol currently provides Python bindings through the [`pydiffsol`](https://github.com/alexallmont/pydiffsol) package, with further language bindings planned. ODE solvers require linear algebra containers (e.g. vectors, matrices), operators and linear solvers. `diffsol` allows users to choose both dense and sparse matrices and solvers from the `nalgebra` [@nalgebra] or `faer` [@faer] crates, and uses a trait-based approach to allow other linear algebra libraries to be added at a later date. @@ -52,7 +52,7 @@ ODE solvers written in lower-level languages like C, Fortran or Rust offer signi The following solvers are available in `diffsol`: -1. A variable order Backwards Difference Formulae (BDF) solver, suitable for stiff problems and singular mass matrices. The basic algorithm is derived in @byrne1975polyalgorithm, however this particular implementation follows that implemented in the Matlab routine ode15s [@shampine1997matlab] and the SciPy implementation [@virtanen2020scipy], which features the NDF formulas for improved stability +1. A variable order Backwards Difference Formulae (BDF) solver, suitable for stiff problems and singular mass matrices. The basic algorithm is derived in [@byrne1975polyalgorithm], however this particular implementation follows that implemented in the Matlab routine ode15s [@shampine1997matlab] and the SciPy implementation [@virtanen2020scipy], which features the NDF formulas for improved stability 2. A Singly Diagonally Implicit Runge-Kutta (SDIRK or ESDIRK) solver, suitable for moderately stiff problems and singular mass matrices. Two different butcher tableau are provided, TR-BDF2 [@bank1985transient, @hosea1996analysis] and ESDIRK34 [@jorgensen2018family], or users can supply their own. 3. A variable order Explicit Runge-Kutta (ERK) solver, suitable for non-stiff problems. One butcher tableau is provided, the 4th order TSIT45 [@tsitouras2011runge], or users can supply their own. From 87159a2a07de8c7ab392d61be54d09118cddd4f1 Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Thu, 13 Nov 2025 10:38:37 +0000 Subject: [PATCH 16/16] fix citation --- paper/paper.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper/paper.md b/paper/paper.md index c2433bee..ef6e7702 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -53,7 +53,7 @@ ODE solvers written in lower-level languages like C, Fortran or Rust offer signi The following solvers are available in `diffsol`: 1. A variable order Backwards Difference Formulae (BDF) solver, suitable for stiff problems and singular mass matrices. The basic algorithm is derived in [@byrne1975polyalgorithm], however this particular implementation follows that implemented in the Matlab routine ode15s [@shampine1997matlab] and the SciPy implementation [@virtanen2020scipy], which features the NDF formulas for improved stability -2. A Singly Diagonally Implicit Runge-Kutta (SDIRK or ESDIRK) solver, suitable for moderately stiff problems and singular mass matrices. Two different butcher tableau are provided, TR-BDF2 [@bank1985transient, @hosea1996analysis] and ESDIRK34 [@jorgensen2018family], or users can supply their own. +2. A Singly Diagonally Implicit Runge-Kutta (SDIRK or ESDIRK) solver, suitable for moderately stiff problems and singular mass matrices. Two different butcher tableau are provided, TR-BDF2 [@bank1985transient; @hosea1996analysis] and ESDIRK34 [@jorgensen2018family], or users can supply their own. 3. A variable order Explicit Runge-Kutta (ERK) solver, suitable for non-stiff problems. One butcher tableau is provided, the 4th order TSIT45 [@tsitouras2011runge], or users can supply their own. All solvers feature: