Sundials/ML: Connecting OCaml to the Sundials Numeric Solvers

12/31/2018
by   Timothy Bourke, et al.
0

This paper describes the design and implementation of a comprehensive OCaml interface to the Sundials library of numeric solvers for ordinary differential equations, differential algebraic equations, and non-linear equations. The interface provides a convenient and memory-safe alternative to using Sundials directly from C and facilitates application development by integrating with higher-level language features, like garbage-collected memory management, algebraic data types, and exceptions. Our benchmark results suggest that the interface overhead is acceptable: the standard examples are rarely twice as slow in OCaml than in C, and often less than 50 interfacing with Sundials are to efficiently and safely share data structures between OCaml and C, to support multiple implementations of vector operations and linear solvers through a common interface, and to manage calls and error signalling to and from OCaml. We explain how we overcame these difficulties using a combination of standard techniques such as phantom types and polymorphic variants, and carefully crafted data representations.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/26/2022

DelayDiffEq: Generating Delay Differential Equation Solvers via Recursive Embedding of Ordinary Differential Equation Solvers

Traditional solvers for delay differential equations (DDEs) are designed...
research
07/14/2016

Composing Scalable Nonlinear Algebraic Solvers

Most efficient linear solvers use composable algorithmic components, wit...
research
11/19/2020

Enabling New Flexibility in the SUNDIALS Suite of Nonlinear and Differential/Algebraic Equation Solvers

In recent years, the SUite of Nonlinear and DIfferential/ALgebraic equat...
research
11/14/2018

AMGCL: an Efficient, Flexible, and Extensible Algebraic Multigrid Implementation

The paper presents AMGCL – an opensource C++ library implementing the al...
research
10/20/2021

Pick-and-Mix Information Operators for Probabilistic ODE Solvers

Probabilistic numerical solvers for ordinary differential equations comp...
research
11/15/2019

Delta-stepping SSSP: from Vertices and Edges to GraphBLAS Implementations

GraphBLAS is an interface for implementing graph algorithms. Algorithms ...
research
06/15/2017

Computational Anatomy in Theano

To model deformation of anatomical shapes, non-linear statistics are req...

Please sign up or login with your details

Forgot password? Click here to reset