/heyoka

C++ library for ODE integration via Taylor's method and LLVM

Primary LanguageC++Mozilla Public License 2.0MPL-2.0

heyoka

Build Status Build Status Build Status language Code Coverage

Anaconda-Server Badge


Logo

Modern Taylor's method via just-in-time compilation
Explore the docs »

Report bug · Request feature

The heyókȟa [...] is a kind of sacred clown in the culture of the Sioux (Lakota and Dakota people) of the Great Plains of North America. The heyoka is a contrarian, jester, and satirist, who speaks, moves and reacts in an opposite fashion to the people around them.

heyoka is a C++ library for the integration of ordinary differential equations (ODEs) via Taylor's method. Notable features include:

  • support for both double-precision and extended-precision floating-point types (80-bit and 128-bit),
  • the ability to maintain machine precision accuracy over tens of billions of timesteps,
  • high-precision zero-cost dense output,
  • accurate and reliable event detection,
  • batch mode integration to harness the power of modern SIMD instruction sets,
  • a high-performance implementation of Taylor's method based on automatic differentiation techniques and aggressive just-in-time compilation via LLVM.

If you prefer using Python rather than C++, heyoka can be used from Python via heyoka.py, its Python bindings.

Quick example

As a simple example, here's how the ODE system of the pendulum is defined and numerically integrated in heyoka:

#include <iostream>

#include <heyoka/heyoka.hpp>

using namespace heyoka;

int main()
{
    // Create the symbolic variables x and v.
    auto [x, v] = make_vars("x", "v");

    // Create the integrator object
    // in double precision.
    auto ta = taylor_adaptive<double>{// Definition of the ODE system:
                                      // x' = v
                                      // v' = -9.8 * sin(x)
                                      {prime(x) = v, prime(v) = -9.8 * sin(x)},
                                      // Initial conditions
                                      // for x and v.
                                      {0.05, 0.025}};

    // Integrate for 10 time units.
    ta.propagate_for(10.);

    // Print the state vector.
    std::cout << "x(10) = " << ta.get_state()[0] << '\n';
    std::cout << "v(10) = " << ta.get_state()[1] << '\n';
}

Documentation

The full documentation can be found here.

Authors

  • Francesco Biscani (Max Planck Institute for Astronomy)
  • Dario Izzo (European Space Agency)

License

heyoka is released under the MPL-2.0 license.