Python library for ODE integration via Taylor's method and LLVM
MPL-2.0 License
heyoka.py 5.1.0 adds an implementation of SGP4, a widely-used analytical propagator for Earth-orbiting objects.
SGP4 uses two-line elements sets (TLEs) (available from websites such as CelesTrak and Space-Track) to predict the future or past states of Earth-orbiting objects via a simplified perturbation model. The positional accuracy of SGP4 is in the order of kilometres for propagations up to a few days from the TLE reference epoch.
heyoka.py's SGP4 implementation is fully differentiable up to arbitrary order, thus enabling applications such as state covariance propagation, state transition matrix computation, gradient-based optimisation, orbit determination, etc.
SGP4 is available either as a low-level function that that produces the analytical formulae of SGP4 in heyoka.py's expression system, or a as a fast high-level propagator class accelerated via multithreaded parallelisation and SIMD vectorisation, providing state-of-the-art propagation performance. For more details, see the tutorial:
https://bluescarni.github.io/heyoka.py/notebooks/sgp4_propagator.html
select()
📝Another new feature in this release is support for logical and relational operators, as well as the select()
primitive, in the heyoka.py expression system.
Relational operators allow to perform comparisons (such as "equal to", "less than", "greater than", etc.) during the evaluation of an expression (e.g., during a numerical integration), yielding a numerical value of 1
(true) or 0
(false). Logical operators allow to combine comparisons via logical AND/OR.
The select()
primitive can be used to select one of two expressions based on the result of a comparison, thus providing a primitive form of if/then/else
branching in the expression system. Note however that select()
will always evaluate both the true
and false
branches, and thus it is unsuitable for complicated flow control.
manylinux_2_28
🖥️The Linux binary wheels of heyoka.py are now built on top of the manylinux_2_28
images, instead of the manylinux2014
images. The manylinux2014
images have reached EOL at the end of June 2024.
The full changelog, as usual, is available here:
Published by bluescarni 4 months ago
This is a quick hotfix release for an issue where heyoka.py would wrongly throw an error on valid code.
Please see the release notes for version 5.0.0 to see what's new in heyoka.py:
https://github.com/bluescarni/heyoka.py/releases/tag/v5.0.0
As usual, the full changelog is available here:
Published by bluescarni 4 months ago
With version 5.0.0, heyoka.py 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.py 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.
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.
For more information, see also the arxiv preprint https://arxiv.org/html/2405.19384v1.
The full changelog, as usual, is available here:
Published by bluescarni 8 months ago
Version 4 of heyoka.py introduces several backwards-incompatible changes, most of which have been prompted by user feedback. The updated heyoka.py 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.py/breaking_changes.html#bchanges-4-0-0
If you have questions, please do not hesitate to ask.
The compiled function class cfunc
has gained the ability to parallelise batch evaluations via multithreading. The tutorial has been updated accordingly:
https://bluescarni.github.io/heyoka.py/notebooks/compiled_functions.html
heyoka.py is now able to automatically generate (and solve) the equations of motion from user-supplied Lagrangians and Hamiltonians. Here is a tutorial illustrating this new feature:
https://bluescarni.github.io/heyoka.py/notebooks/lagrangian.html#lagham-tut
It is now possible to pass a list 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.
The substitution primitive subs()
has been substantially sped up. The compilation time of compiled functions has also been improved.
A tutorial on gravity gradient stabilisation has been added:
https://bluescarni.github.io/heyoka.py/notebooks/gg_stab.html
The full changelog, as usual, is available here:
Published by bluescarni 11 months ago
This new release of heyoka.py comes packed with several new features and enhancements.
Thanks to great work by @Sceki and @darioizzo, two new examples have been added to the documentation. The first one explains how to interface pytorch and heyoka.py:
https://bluescarni.github.io/heyoka.py/notebooks/torch_and_heyoka.html
The second one presents an innovative, differentiable model for the Earth's atmospheric density implemented via a neural network:
https://bluescarni.github.io/heyoka.py/notebooks/differentiable_atmosphere.html
In addition to extended and arbitrary precision computations, heyoka.py now supports also single-precision computations via the NumPy float32
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.
heyoka.py 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.
When the fast_math
option is active, heyoka.py 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:
Published by bluescarni 11 months ago
This new release of heyoka.py comes packed with several new features and enhancements.
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 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.
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.
Several operations involving the manipulation and differentiation of large symbolic expressions are now substantially faster, often by more than an order of magnitude.
As usual, the full changelog is available here:
Published by bluescarni about 1 year ago
NOTE: despite the major version bump, there are no public API changes with respect to heyoka.py 2.0.0.
This is a maintenance release which brings heyoka.py in sync with version 3.0.0 of the heyoka C++ library. There are no API changes or new functionality with respect to heyoka.py 3.0.0 (apart from the fact that heyoka.py 3.0.0 inherits bugfixes from version 3.0.0 of the heyoka C++ library).
The full changelog, as usual, is available here:
https://bluescarni.github.io/heyoka.py/changelog.html
The changelog of the heyoka C++ library is available here:
Published by bluescarni about 1 year ago
NOTE: the major version number has been bumped from 1 to 2 because heyoka.py now requires version 2.0.0 of the heyoka library. However, there are no public API changes with respect to heyoka.py 1.0.0.
This new release of heyoka.py focuses on several LLVM-related improvements fixes.
heyoka.py 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.
heyoka.py can now optionally take advantage of the LLVM SLP vectoriser. The vectoriser can be enabled via the boolean keyword argument slp_vectorize
(False
by default), which can be passed to any heyoka.py 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.
On recent LLVM versions, heyoka.py 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 the heyoka library was built with support for the SLEEF library.
An implementation of the circular restricted three-body problem has been added to the model
submodule. The new model provides the non-dimensional equations of motion and the formula for the Jacobi constant.
As usual, the full changelog is available here:
Published by bluescarni about 1 year ago
Version 1.0.0 of heyoka.py is here, and it brings several new features and important changes.
Starting from this release, heyoka.py adopts the semantic versioning numbering scheme. In particular:
Note that, due to the lack of API docs at the present time, heyoka.py's public API is somewhat fuzzily defined by the C++ and Python tutorials.
The biggest user-facing change in this release is a comprehensive internal overhaul of the expression system, including:
square()
, sqrt()
, sum_sq()
, etc.);Users are encouraged to read this tutorial in order to understand how to best take advantage of the revamped expression system.
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.
Step callbacks can now optionally implement a pre_hook()
method 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 multi-threaded 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.
model
submoduleA new model
submodule 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.
As usual, the full changelog is available here:
Published by bluescarni over 1 year ago
This is a bugfix release that fixes building against NumPy 1.25.
Published by bluescarni over 1 year ago
This latest release of heyoka.py adds prebuilt pip
packages for linux. Additionally, time-dependent functions can now be compiled.
The full changelog, as usual, is available here:
Published by bluescarni over 1 year ago
Published by bluescarni over 1 year ago
Published by bluescarni over 1 year ago
Published by bluescarni over 1 year ago
Published by bluescarni over 1 year ago
Published by bluescarni over 1 year ago
Published by bluescarni over 1 year ago
Published by bluescarni almost 2 years ago
This new heyoka.py release comes with a big new feature and several small fixes and additions.
Taylor integrators shine in high-accuracy applications, and now, with heyoka.py, you can get as accurate as you want!
In addition to double and extended-precision computations, heyoka.py 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 the heyoka C++ library to be built with support for the mp++ multiprecision library (see the heyoka installation instructions for more details). A tutorial illustrating how to set up numerical integrations in arbitrary precision is available in the documentation.
real128
API.The full changelog, as usual, is available here:
Published by bluescarni about 2 years ago
This new version of heyoka.py comes with two big new features and a few fixes.
Extended-precision computations are now fully supported with an API identical to double-precision computations. A tutorial explaining this new feature is available here:
https://bluescarni.github.io/heyoka.py/notebooks/ext_precision.html
Note that, as a consequence of this new feature, heyoka.py is now more strict than it used to be with respect to type conversions, and this could result in TypeError
exceptions being raised in user code after upgrading. Please see the "Breaking Changes" section in the documentation for more details and solutions:
https://bluescarni.github.io/heyoka.py/breaking_changes.html#bchanges-0-19-0
It is now possible to compile just-in-time functions defined via the heyoka.py expression system. Compiled functions provide fast function evaluation capabilities for scalar and vector arguments. A tutorial describing this new feature is available here:
https://bluescarni.github.io/heyoka.py/notebooks/compiled_functions.html
The full changelog, as usual, is available here: