heyoka

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

MPL-2.0 License

Stars
190
Committers
2
heyoka - heyoka 5.0.0 Latest Release

Published by bluescarni 4 months ago

Variational equations 💫

With version 5.0.0, heyoka takes another big leap forward with built-in support for the variational equations - that is, the ability to compute not only the solution of an ODE system, but also its partial derivatives with respect to the initial conditions and/or parameters of the system.

The variational equations, which are automatically formulated by heyoka at any order via a process of efficient symbolic differentiation, enable a host of new applications, such as the solution of inversion problems (e.g., orbit determination), uncertainty propagation, Taylor maps and jet transport, the computation of chaos indicators, training of neural networks in NeuralODEs, etc.

A tutorial describing this new feature is available in the Python bindings.

Thermosphere models 🤖

Another big addition in this release is thermoNETs - a set of novel models for the calculation of the Earth's atmospheric density. These models, which have been recently unveiled at the ISSFD2024 conference, can be used to set up accurate and high-performance simulations of the LEO dynamical environment, accounting for the influence of air drag during orbital propagation. A tutorial describing this new feature is available in the Python bindings.

For more information, see also the arxiv preprint https://arxiv.org/html/2405.19384v1.

Support for LLVM 18

heyoka 5.0.0 adds support for the recently-released version 18 of LLVM.

The full changelog, as usual, is available here:

https://bluescarni.github.io/heyoka/changelog.html

heyoka - heyoka 4.0.3

Published by bluescarni 7 months ago

This is a quick release that fixes a couple of build issues, one on FreeBSD and the other affecting the unit tests when building with GCC 13.

NOTE: heyoka 4.x introduces several breaking changes with respect to the 3.x series. Please see the following link for a list of breaking changes and explanations on how to adapt your code to the new API:

https://bluescarni.github.io/heyoka/breaking_changes.html#bchanges-4-0-0

heyoka - heyoka 4.0.2

Published by bluescarni 8 months ago

This is a quick release that fixes a build issue on MinGW.

NOTE: heyoka 4.x introduces several breaking changes with respect to the 3.x series. Please see the following link for a list of breaking changes and explanations on how to adapt your code to the new API:

https://bluescarni.github.io/heyoka/breaking_changes.html#bchanges-4-0-0

heyoka - heyoka 4.0.1

Published by bluescarni 8 months ago

This is a quick release that fixes a build issue on PPC64.

NOTE: heyoka 4.x introduces several breaking changes with respect to the 3.x series. Please see the following link for a list of breaking changes and explanations on how to adapt your code to the new API:

https://bluescarni.github.io/heyoka/breaking_changes.html#bchanges-4-0-0

heyoka - heyoka 4.0.0

Published by bluescarni 8 months ago

Breaking changes

Version 4 of heyoka introduces several backwards-incompatible changes, most of which have been prompted by user feedback. The updated heyoka API should be more streamlined, easier to use and more difficult to misuse.

The detailed list of breaking changes is available at the following page, along with instructions on how to update your code for the API modifications:

https://bluescarni.github.io/heyoka/breaking_changes.html#bchanges-4-0-0

If you have questions, please do not hesitate to ask.

New compiled functions class

A new class that facilitates the creation and use of compiled functions, called cfunc, has been introduced. This class has been available for a while in the Python bindings, and it now makes its official debut in the C++ API. A tutorial illustrating the use of this class is available here:

https://bluescarni.github.io/heyoka/tut_cfunc.html#tut-cfunc

Support for Lagrangian and Hamiltonian mechanics

heyoka is now able to automatically generate (and solve) the equations of motion from user-supplied Lagrangians and Hamiltonians. The Python bindings provide a tutorial illustrating this new feature:

https://bluescarni.github.io/heyoka.py/notebooks/lagrangian.html#lagham-tut

Enhancements to the step callback API

It is now possible to pass a range of step callbacks as an optional argument to the propagate_*() functions. The callbacks will be automatically composed into a callback set and they will be executed at the end of each integration step.

spack availability

Thanks to work by @agseaton, heyoka is now available in the spack package manager. See the updated installation instructions:

https://bluescarni.github.io/heyoka/install.html#spack

Performance improvements

The substitution primitive subs() has been substantially sped up.

The full changelog, as usual, is available here:

https://bluescarni.github.io/heyoka/changelog.html

heyoka - heyoka 3.2.0

Published by bluescarni 11 months ago

This new release of heyoka comes packed with several new features and enhancements.

Support for single-precision computations

In addition to extended and arbitrary precision computations, heyoka now supports also single-precision computations via the float type. Single-precision computations can lead to substantial performance benefits, especially in batch mode and/or low-accuracy applications. See the single-precision tutorial for a usage example.

ELP2000 model

heyoka now includes an implementation of the ELP2000 lunar theory. It is thus now possible to formulate systems of differential equations with the time-dependent geocentric lunar position appearing in the right-hand side. See the tutorial for an introduction.

Low-precision vector math

When the fast_math option is active, heyoka now employs lower-precision vector implementations of elementary functions, which can lead to substantial speedups in low-accuracy applications. The speedup is particularly visible when using single precision in AI and ML applications.

As usual, the full changelog is available here:

https://bluescarni.github.io/heyoka/changelog.html

heyoka - heyoka 3.1.0

Published by bluescarni 12 months ago

This new release of heyoka comes packed with several new features and enhancements.

Neural networks

It is now possible to create feed-forward neural networks in the expression system, and use them in the definition of ODEs. See the machine learning section in the documentation of the Python bindings for more information and examples.

Complementary to the introduction of neural networks is the addition of the (leaky) ReLU and its derivative to the expression system.

New anomalies

The eccentric longitude F and the delta eccentric anomaly DE have been added to the expression system. These transcendental functions are used in celestial mechanics and astrodynamics to implement Lagrangian propagation and in the definition of equinoctial orbital elements.

Thanks to the introduction of the eccentric longitude F, the analytical ephemeris VSOP2013 should now be more numerically stable for orbits with low eccentricity/inclination.

Performance improvements

Several operations involving the manipulation and differentiation of large symbolic expressions are now substantially faster, often by more than an order of magnitude.

Fixes

  • Improve the behaviour of the in-memory cache by ensuring that global constants are always defined in a deterministic order in an LLVM module.
  • Improve the numerical stability of the Kepler solvers.
  • Fix compiler warning when building without SLEEF support.

As usual, the full changelog is available here:

https://bluescarni.github.io/heyoka/changelog.html

heyoka - heyoka 3.0.0

Published by bluescarni about 1 year ago

NOTE: despite the major version bump, there are no public API changes with respect to heyoka 2.0.0.

This is a maintenance release which fixes a few issue identified in heyoka 2.0.0. Because one of the issues involves wrong version compatibility settings in the CMake config-file package, the major version number has been precautionarily bumped from 2 to 3. However, there are no public API changes with respect to heyoka 2.0.0.

Another issue fixed in this release involves orbital elements singularities when using the VSOP2013 planetary theory at low precisions. The current fix is a temporary workaround, but the VSOP2013 planetary theory can still suffer from numerical instabilities at low eccentricities/inclinations. A better solution is in the works and it will be implemented in an upcoming heyoka version.

Finally, the conda-forge packages for LLVM 11-12 have been dropped in order to limit the size of the build matrix. The LLVM versions supported by heyoka on conda-forge are now 13 to 16.

The full changelog, as usual, is available here:

https://bluescarni.github.io/heyoka/changelog.html

heyoka - heyoka 2.0.0

Published by bluescarni about 1 year ago

NOTE: the major version number has been bumped from 1 to 2 because support for LLVM 10 has been dropped. However, there are no public API changes with respect to heyoka 1.0.0.

This new release of heyoka focuses on several LLVM-related improvements and fixes.

In-memory cache

heyoka now features an in-memory cache which avoids re-optimisation and re-compilation of code that was already optimised and compiled during program execution. See this tutorial for a detailed explanation and a couple of examples where this new feature leads to noticeable speedups.

Support for the SLP vectoriser

heyoka can now optionally take advantage of the LLVM SLP vectoriser. The vectoriser can be enabled via the boolean keyword argument kw::slp_vectorize (false by default), which can be passed to any heyoka function/class that uses JIT compilation (e.g., the Taylor adaptive integrators).

Although the SLP vectoriser can lead to noticeable speedups in the performance of JIT-compiled code, it is disabled by default because it can considerably increase the cost of JIT compilation.

Automatic vectorisation of math functions

On recent LLVM versions, heyoka has gained the ability to automatically vectorise scalar calls to math functions. This includes not only math functions implemented as LLVM builtins (e.g., sqrt, sin/cos, etc.), but also external math functions from the C++ math library.

This feature is automatically enabled on recent LLVM versions when SLP vectorisation is turned on and if heyoka was built with support for the SLEEF library.

LLVM 17 in, LLVM 10 out

This release drops support for LLVM 10 and enables support for the freshly-released LLVM 17.

New CR3BP model

An implementation of the circular restricted three-body problem has been added to the models module. The new model provides the non-dimensional equations of motion and the formula for the Jacobi constant.

Initial work on API docs

Initial work has started on detailed API docs. The WIP API reference is available here:

https://bluescarni.github.io/heyoka/api_reference.html

Fixes

  • A build issue in C++20 mode has been resolved.

As usual, the full changelog is available here:

https://bluescarni.github.io/heyoka/changelog.html

heyoka - heyoka 1.0.0

Published by bluescarni about 1 year ago

Version 1.0.0 of heyoka is here, and it brings several new features and important changes.

Semantic versioning

Starting from this release, heyoka adopts the semantic versioning numbering scheme. In particular:

  • the MAJOR version will be increased in case of backwards-incompatible changes in the public API,
  • the MINOR version will be increased in case of backwards-compatible additions to the public API,
  • the PATCH version will be increased in case of backwards-compatible bugfixes.

Note that, due to the lack of API docs at the present time, heyoka's public API is somewhat fuzzily defined by the C++ and Python tutorials.

Note also that ABI compatibility is guaranteed only across PATCH releases.

Overhaul of the expression system

The biggest user-facing change in this release is a comprehensive internal overhaul of the expression system, including:

  • the removal of several ad-hoc primitives with somewhat redundant functionality (e.g., square(), sqrt(), sum_sq(), etc.);
  • the implementation of several automated simplifications/normalisations, mostly inspired by the behaviour of SymPy;
  • the re-implementation of sums and products as multivariate functions.

Users are encouraged to read this tutorial in order to understand how to best take advantage of the revamped expression system.

New API to compute high-order derivatives

A new function called diff_tensors() is available to compute efficiently high-order derivative tensors. Please see this tutorial for an introduction to this new feature.

Improvements to step callbacks

Step callbacks can now optionally implement a pre_hook() member function that will be invoked once before the first step in a time-limited propagation is performed. This feature can be useful to implement an init/setup phase in the callback before the numerical integration starts. The tutorial has been updated to include this new feature.

Additionally, in ensemble propagations the step callback is now copied for each iteration of the ensemble, rather than being shared among all the iterations. This behaviour should reduce the risk of data races in multithreaded scenarios.

New model submodule

A new model submodule/namespace has been introduced, which includes functions to generate the dynamics for several commonly-used dynamical models (e.g., pendulum, N-body, etc.). The make_nbody_sys() helper has been replaced by an equivalent function in the model submodule. More models are planned to be added in the near future.

Support for LLVM 16

heyoka now can be built against the latest stable release of LLVM.

Miscellanea

  • Substitution of generic subexpressions has been implemented;
  • the screen output of expressions is now truncated for very large expressions;
  • workaround for an LLVM bug on ARM;
  • fix compilation on OSX when mixing recent libcxx versions with old Boost versions.

As usual, the full changelog is available here:

https://bluescarni.github.io/heyoka/changelog.html

heyoka - heyoka 0.21.0

Published by bluescarni over 1 year ago

This is an incremental release which features a few internal cleanups and introduces ABI versioning/tagging.

The full changelog, as usual, is available here:

https://bluescarni.github.io/heyoka/changelog.html

heyoka - heyoka 0.20.1

Published by bluescarni almost 2 years ago

This is a minor release that fixes the visibility setting on a couple of internal functions.

The full changelog, as usual, is available here:

https://bluescarni.github.io/heyoka/changelog.html

heyoka - heyoka 0.20.0

Published by bluescarni almost 2 years ago

This new heyoka release comes with a big new feature and several small fixes and additions.

Arbitrary-precision computations ➗

Taylor integrators shine in high-accuracy applications, and now, with heyoka, you can get as accurate as you want!

In addition to double and extended-precision computations, heyoka now also supports computations in arbitrary precision. In other words, you can perform numerical integrations with an arbitrarily high accuracy, limited in principle only by the available memory.

Arbitrary-precision computations require heyoka to be built with support for the mp++ multiprecision library (see the installation instructions for more details). A tutorial illustrating how to set up numerical integrations in arbitrary precision is available in the documentation.

LLVM improvements 💻

heyoka now supports the recently-released LLVM 15.

In addition, options have been added in the build system to force static linking to LLVM and to hide LLVM symbols when linking statically. These two options can be activated to prevent potential symbol collisions when using heyoka in conjunction with other libraries that might link to LLVM versions different from the one in use by heyoka. See the installation instructions for more details.

Fixes 🐞

  • prevent the accidental indirect inclusion of quadmath.h (this could cause build issues with clang);
  • prevent callbacks from changing the time coordinate of the integrator. This was never supported and could lead to crashes and/or hangs in the propagate_*() functions.

The full changelog, as usual, is available here:

https://bluescarni.github.io/heyoka/changelog.html

heyoka - heyoka 0.19.0

Published by bluescarni about 2 years ago

This new release focuses on cleanups, documentation and maintenance, as most of the development work for this release was focused on the Python bindings (https://github.com/bluescarni/heyoka.py).

The full changelog, as usual, is available here:

https://bluescarni.github.io/heyoka/changelog.html

heyoka - heyoka 0.18.0

Published by bluescarni over 2 years ago

This new version of heyoka comes with a big new feature and several fixes.

Automatic parallelisation 🚀

heyoka is now capable of automatically performing multithreaded fine-grained parallelisation within an individual integration step. Parallel mode is easily enabled, and it can lead to substantial speed-ups, especially for large ODE systems and/or extended precision computations.

A tutorial exploring this new feature is available here:

https://bluescarni.github.io/heyoka/tut_parallel_mode.html

Astrodynamics 🪐

  • It is now possible to construct (N+1)-body problems - that is, N-body problems expressed in the reference frame of one of the bodies (rather than in an inertial reference frame).
  • The Kepler solver now returns NaN in case of invalid input arguments (e.g., non-finite arguments, non-elliptic eccentricity) or if numerical root finding exceeds the maximum number of iterations.

Fixes & clean-ups 🐞

  • Several small issues in the implementation of propagate_grid() were identified and fixed.
  • Several compilation warnings occurring in debug mode when using recent clang versions were fixed.
  • Support for the recently-released LLVM 14.
  • heyoka now builds against LLVM 13/14 without deprecation warnings.

The full changelog, as usual, is available here:

https://bluescarni.github.io/heyoka/changelog.html

heyoka - heyoka 0.17.1

Published by bluescarni over 2 years ago

This is a minor release featuring:

  • two fixes for test failures on FreeBSD 🐞,
  • a change in behaviour for the propagate_*() functions: in presence of a stopping terminal event, the callback is now invoked and the continuous output is updated (whereas previously a stopping terminal event was essentially treated in the same way as an error condition, preventing both the execution of the callback and the update of the continuous output).

The full changelog, as usual, is available here:

https://bluescarni.github.io/heyoka/changelog.html

heyoka - heyoka 0.17.0

Published by bluescarni almost 3 years ago

This new version of heyoka comes with a big new feature, several quality-of-life improvements and a few fixes.

Ensemble propagations 🚀

The big new feature is support for ensemble propagations. In ensemble mode, multiple distinct instances of the same ODE system are integrated in parallel, typically using different sets of initial conditions and/or runtime parameters. Monte Carlo simulations and parameter searches are two typical examples of tasks in which ensemble mode is particularly useful.

The combination of ensemble mode with batch integrators can lead to substantial speedups (e.g., a floating-point throughput increase of 23x was observed on a modern desktop computer using 8 threads of execution).

Note that, at this time, ensemble mode is limited to using multithreading for parallelisation.

Quality of life improvements

  • Several functions in the batch integration API now also accept scalar time values in input, instead of just vectors. This change improves the usability of batch mode by reducing the amount of typing necessary to interact with batch integrators;
  • a function to compute the suggested SIMD size for the CPU in use was added;
  • it is now possible to access the internal representation of the integrator's time variable as a double-length float;
  • the LLVM version number against which heyoka was built is now exported in the CMake config-file package. This information is intended to be used by packages depending on heyoka to avoid inadvertently linking together different versions of LLVM.

Fixes 🐞

  • A couple of build failures were fixed;
  • a potential issue arising when certain data structures related to event detection are destroyed in the wrong order has been corrected.

The full changelog, as usual, is available here:

https://bluescarni.github.io/heyoka/changelog.html

heyoka - heyoka 0.16.0

Published by bluescarni almost 3 years ago

This is another big release for heyoka, featuring 2 major new features and substantial performance improvements.

Event detection support in batch mode ⏩

Event detection is now available in the batch mode Taylor integrator. As a result, the batch mode integrator has now feature parity with the scalar mode integrator.

The batch mode event detection API is very similar to scalar mode. A tutorial describing the new feature is available here:

https://bluescarni.github.io/heyoka/tut_batch_mode.html#event-detection

Continuous output 📈

Debuting in this release is support for continuous output for the propagate_for/until() functions of the scalar and batch integrators.

Continuous output allows to compute the value of the solution of the ODE system at any time within the integration time interval covered by propagate_for/until(). Tutorials are available here:

https://bluescarni.github.io/heyoka/tut_d_output.html#continuous-output

https://bluescarni.github.io/heyoka/tut_batch_mode.html#dense-continuous-output

This feature has been inspired by a similar feature available in the DifferentialEquations.jl package.

Performance improvements 🚀

As a result of various micro-optimisations, performance for large ODE systems in compact mode has improved by up to 15%.

Additionally, fast event exclusion checking is now implemented as a JIT-compiled function, which leads to a ~30% reduction in the event detection overhead.

Miscellanea ☑️

  • Support for LLVM 13.
  • Fix potential issue with data aliasing in corner cases.
  • Fix wrong counting of integration steps in case of interruption by a terminal event.

The full changelog, as usual, is available here:

https://bluescarni.github.io/heyoka/changelog.html

heyoka - heyoka 0.15.0

Published by bluescarni about 3 years ago

This is one of the biggest releases of heyoka to date, featuring various new capabilities, a major change in the expression system and several fixes.

Reference semantics for funcs

A fundamental change debuting in heyoka 0.15.0 is that function nodes in the expression system now use reference semantics, instead of value semantics. In practice, this means that copying non-trivial expressions does not result any more in a deep copy of the original object, but rather in a new reference to the original object. Deep copies of expressions can be performed via the newly-introduced copy() function.

This change is motivated by various use cases involving large symbolic expressions with a high degree of internal repetition (including, e.g., artificial neural networks), which can now be handled by the expression system orders of magnitude more efficiently (from the point of view of both CPU and memory utilisation).

This is technically a breaking change, although if you just use expressions in the definition of ODEs it is likely that no changes are needed in your code.

New features in the expression system 🖋️

  • It is now possible to compute the symbolic derivative of an expression with respect to a parameter.
  • Numerical constants can now be defined in a symbolic way. The symbolic π constant is now available in the expression system, using this new framework.
  • The two-argument inverse tangent function atan2() has been added to the expression system.

The VSOP2013 solution 🪐

An implementation of the VSOP2013 analytical solution for the motion of the planets of the Solar System has been added to the expression system. This means that it is now possible to formulate differential equations containing the positions/velocities of the planets of the Solar System as functions of time.

Improved support for PPC64 💻

Thanks to the generosity of OSU's Open Source Lab, who provided remote access to a PowerPC workstation, heyoka now features much better support for 64-bit PowerPC processors. In particular, heyoka is now able to take advantage of the hardware-accelerated quadruple-precision arithmetic capabilities of recent PowerPC processors.

Other changes ☑️

  • Performance improvements to event detection.
  • Various fixes and improvements to the build system.
  • Fix a corner-case issue in the implementation of the kepE() function.

Full changelog

As usual, the full changelog is available here:

https://bluescarni.github.io/heyoka/changelog.html

heyoka - heyoka 0.14.0

Published by bluescarni about 3 years ago

This new release of heyoka implements an important improvement in the automatic deduction of the cooldown value for terminal events, which should now be more reliable than before.

The full changelog, as usual, is available here:

https://bluescarni.github.io/heyoka/changelog.html

Package Rankings
Top 28.08% on Conda-forge.org
Badges
Extracted from project README
Build Status Build Status Code Coverage Anaconda-Server Badge