Source-linked AI summary

Odeint - Solving ordinary differential equations in C++

Karsten Ahnert, Mario Mulansky

arXiv:1110.3397v1cs.MSnlin.CDphysics.comp-ph

TL;DR

ODEs are widely used, but their solutions generally require numerical methods. The paper presents odeint, a generic C++ library for ODE initial value problems, designed for flexible containers and operations, broad solver support, and high performance across standard and GPU-based computing.

  • Problem

    Analytic ODE solutions are rare, so scientists need numerical methods for solving initial value problems across diverse applications.

  • Method

    odeint uses generic and functional programming with C++ templates, defining interchangeable state containers, numerical operations, algebras, and stepper concepts.

  • Results

    odeint provides a high-level C++ library whose container independence and performance make it feasible for uses ranging from education to high-performance computing.

  • Takeaways & Limitations

    The library supports diverse state representations and computational settings, including SIMD, arbitrary precision, and GPU-resident vectors or arrays.

Abstract

from arXiv · show

Many physical, biological or chemical systems are modeled by ordinary differential equations (ODEs) and finding their solution is an every-day-task for many scientists. Here, we introduce a new C++ library dedicated to find numerical solutions of initial value problems of ODEs: odeint (www.odeint.com). odeint is implemented in a highly generic way and provides extensive interoperability at top performance. For example, due to it's modular design it can be easily parallized with OpenMP and even runs on CUDA GPUs. Despite that, it provides a convenient interface that allows for a simple and easy usage.

I. INTRODUCTION

ODEs underpin many scientific applications, but analytic solutions are rare, making numerical methods essential. The paper introduces odeint, a C++ library for solving ODE initial value problems.

  • ODEs model systems across mechanics, biology, statistical physics, molecular dynamics, nonlinear science, and PDE simulations.
  • Analytic solutions are rare, so numerical methods—especially explicit Runge-Kutta and implicit solvers—are widely used.Implicit solvers are important for stiff problems with multiple independent-variable scales.
  • An ODE initial value problem seeks a solution from an initial value, with iterative methods generating successive states from previously calculated values.
  • The paper introduces odeint, a C++ library for solving initial value problems of ordinary differential equations.It is positioned alongside libraries and routines such as GSL, Numerical Recipes, Apache.Math, MATLAB ode* functions, and scipy.integrate.odeint.

II. REQUIREMENTS

odeint is designed as a modern, fast, and generic C++ library for ODE initial value problems. Its requirements emphasize flexible state containers, customizable operations, performance, and broad solver support.

  • odeint aims to provide a modern and fast C++ library for solving initial value problems of ODEs.
  • Container independence: Users can choose common or exotic state types, including vectors, fixed arrays, complex arrays, matrices, complex networks, and GPU-resident data.
  • Operation independence: Numerical operations can be customized to support SIMD operations and arbitrary-precision types.
  • High performance: Performance should be at least comparable to standard ODE software such as GSL and Numerical Recipes.
  • Generality: The generic design should accommodate explicit Runge-Kutta, implicit, stiff-system, symplectic, and multistep solvers with step-size control and supported dense output.

III. LIBRARY STRUCTURE AND DESIGN

odeint uses generic, modular C++ design to separate steppers, integration, algebraic operations, and utilities while supporting adaptable numerical methods and state representations.

  • Design principles: Generic programming and C++ templates enable compile-time polymorphism, allowing compiler optimizations for fast runtime code.The design also uses functional programming and template-system features.
  • Library organization: The header-only library separates steppers, integrate functions, algebras, and utility functions into four basic parts.Integrate functions use steppers to compute numerical solutions, while algebras perform basic operations and utilities handle tasks such as resizing and copying.
  • Stepper concepts: The Stepper concept defines solver interfaces for in-place or out-of-place updates, state and time types, derivative representation, and stepper order.An ODE is supplied as a template parameter, commonly through a function or functor with signature ode(x, dxdt, t).
  • Stepper concepts: ErrorStepper and ControlledStepper concepts support per-step error estimation and adaptive step-size control.Controlled stepping can update time, adapt dt, and replace the state after a successful trial.
  • Stepper concepts: The framework includes standard steppers and is designed to accommodate explicit, implicit, stiff, symplectic, and multistep solvers.The paper notes that additional schemes were planned for future versions.
  • Integration interface: Integrate functions provide constant-step and adaptive numerical integration while exploiting capabilities such as dense output.Observers can access the current numerical state for output or statistical analysis.
  • Interoperability and performance: Container and operation independence allow user-selected states and numerical operations, including complex types, SIMD, arbitrary precision, matrices, networks, and GPU arrays.Algebras also support parallel parameter studies, coupled lattices, discretized PDEs, and other specialized state types when appropriately implemented.

IV. CONCLUSION

The paper introduces odeint as a high-level C++ library for solving ODEs. Its performance and container independence support applications ranging from education to high-performance computing.

  • Conclusion: odeint is a high-level C++ library for solving ordinary differential equations.The library is intended for numerical solution of initial value problems.
  • Conclusion: Performance and container independence are presented as odeint’s main advantages over existing solutions.The conclusion connects these properties to a broad range of use cases.
  • Conclusion: The implementation uses template metaprogramming, expression templates, and functional programming, including new explicit Runge-Kutta and arbitrary-order Taylor steppers.The Taylor stepper evaluates derivatives with expression templates and automatic differentiation.
  • Conclusion: Future work includes expanding existing stepper implementations and using odeint as a research playground for numerical ODE solution.The paper describes continued extension as a planned direction.
Loading 1110.3397v1…