Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variational ODEs #177

Merged
merged 24 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ec3289b
Small simplification.
bluescarni Apr 30, 2024
15aaf33
Anothe small doc addition.
bluescarni May 23, 2024
4ff1874
Initial exposition of dfun.
bluescarni Jun 7, 2024
dfb48d0
Initial code for the exposition of variational ODEs.
bluescarni Jun 9, 2024
f61ba43
More var_ode_sys exposition, testing.
bluescarni Jun 9, 2024
47c61f2
Missing file.
bluescarni Jun 9, 2024
010039e
Testing for the variational integrators.
bluescarni Jun 9, 2024
b547d4c
Merge branch 'pr/more_tweaks' into pr/var_ode_sys
bluescarni Jun 10, 2024
e94a08e
Some testing for dfun().
bluescarni Jun 10, 2024
2b39559
Small doc tweak.
bluescarni Jun 10, 2024
88797e8
Expose the vorder property.
bluescarni Jun 10, 2024
659731d
Testing.
bluescarni Jun 10, 2024
874b6b7
Initial work on the new tutorial.
bluescarni Jun 10, 2024
8c0a02c
More docs/tutorials WIP.
bluescarni Jun 10, 2024
ca3ec07
Typos.
bluescarni Jun 10, 2024
9c7dce1
Finish up the first version of the variational ODEs tutorial.
bluescarni Jun 11, 2024
3ded297
sympy fixes for time changes.
bluescarni Jun 11, 2024
44114aa
Tutorial tweaks.
bluescarni Jun 11, 2024
273f02b
Update changelog, readme.
bluescarni Jun 11, 2024
a87b0be
Remove the now-outdated tutorial on variational equations.
bluescarni Jun 11, 2024
5300e72
Revert "Remove the now-outdated tutorial on variational equations."
bluescarni Jun 12, 2024
7c88f37
Add deprecation notice to the old variational equations tutorial.
bluescarni Jun 12, 2024
768ebbd
Disable linkcheck temporarily.
bluescarni Jun 13, 2024
a56eafe
A couple of small test additions.
bluescarni Jun 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ compilation via [LLVM](https://llvm.org/). Notable features include:
* accurate and reliable event detection,
* builtin support for analytical mechanics - bring your own Lagrangians/Hamiltonians
and let heyoka.py formulate and solve the equations of motion,
* builtin support for high-order variational equations - compute not only the solution,
but also its partial derivatives,
* builtin support for machine learning applications via neural network models,
* the ability to maintain machine precision accuracy over
tens of billions of timesteps,
Expand Down
1 change: 1 addition & 0 deletions doc/api_exsys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Attributes
:toctree: autosummary_generated

par
time

Enums
-----
Expand Down
24 changes: 24 additions & 0 deletions doc/api_var_ode_sys.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.. _api_var_ode_sys:

Variational ODE systems
=======================

.. currentmodule:: heyoka

Classes
-------

.. autosummary::
:toctree: autosummary_generated
:template: custom-class-template.rst

var_ode_sys

Enums
-----

.. autosummary::
:toctree: autosummary_generated
:template: custom-enum-template.rst

var_args
1 change: 1 addition & 0 deletions doc/basic_tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ Basic
notebooks/Non-autonomous systems.ipynb
notebooks/Dense output.ipynb
notebooks/Event detection
notebooks/var_ode_sys.ipynb
5 changes: 5 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ Changelog
New
~~~

- Add support for variational ODE systems and Taylor map computation
(`#177 <https://github.com/bluescarni/heyoka.py/pull/177>`__).
- Add thermonets: neural, differentiable, high-performance
models for the Earth's thermosphere density
(`#176 <https://github.com/bluescarni/heyoka.py/pull/176>`__).
- Add a vectorised implementation of ``diff()``
(`#173 <https://github.com/bluescarni/heyoka.py/pull/173>`__).

Expand Down
3 changes: 3 additions & 0 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ compilation via [LLVM](https://llvm.org/). Notable features include:
- accurate and reliable event detection,
- builtin support for analytical mechanics - bring your own Lagrangians/Hamiltonians
and let heyoka.py formulate and solve the equations of motion,
- builtin support for high-order variational equations - compute not only the solution,
but also its partial derivatives,
- builtin support for machine learning applications via neural network models,
- the ability to maintain machine precision accuracy over
tens of billions of timesteps,
Expand Down Expand Up @@ -107,6 +109,7 @@ examples_others

api_exsys
api_integrators
api_var_ode_sys
api_lagham
api_model
```
4 changes: 2 additions & 2 deletions doc/notebooks/Batch mode overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"It is important to emphasise that batch mode does not reduce\n",
"the CPU time required to integrate a system of ODEs. Rather, as a fine-grained\n",
"form of data parallelism, batch mode allows to integrate multiple ODE systems in parallel\n",
"at no additional cost, and it is thus most useful when the need arise\n",
"at (almost) no additional cost, and it is thus most useful when the need arise\n",
"to integrate the same ODE system with different initial conditions and parameters.\n",
"\n",
"Although batch mode can in principle be used with all floating-point types supported\n",
"Although batch mode can in principle be used with all the fundamental C++ floating-point types supported\n",
"by heyoka.py, in practice at this time no CPU provides SIMD instructions for extended-precision\n",
"datatypes. Thus, heyoka.py currently enables batch mode only for single and double precision\n",
"computations. Specifically, in this tutorial we will consider the application of batch mode to\n",
Expand Down
4 changes: 3 additions & 1 deletion doc/notebooks/Customising the adaptive integrator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@
"id": "national-investing",
"metadata": {},
"source": [
"(ta_compact_mode)=\n",
"\n",
"Compact mode\n",
"------------\n",
"\n",
Expand Down Expand Up @@ -290,7 +292,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
9 changes: 7 additions & 2 deletions doc/notebooks/The variational equations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
"id": "excited-uganda",
"metadata": {},
"source": [
"```{note}\n",
"\n",
"Starting with version 5.0.0, heyoka.py features builtin support for the formulation of the [variational equations](./var_ode_sys.ipynb). This tutorial is now deprecated and it will be removed in a future version.\n",
"\n",
"```\n",
"\n",
"The variational equations\n",
"=========================\n",
"\n",
"In this tutorial, we will show how it is possible to exploit heyoka.py's [expression system](<./The expression system.ipynb>) to implement first-order variational equations for a system of ODEs.\n",
"\n",
"\n",
"First, let's start with a brief recap on the variational equations. For simplicity, we will consider an autonomous ODE system in the variables $x$ and $y$ (the extension to more variables just complicates the notation):\n",
"\n",
"$$\n",
Expand Down Expand Up @@ -292,7 +297,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
4 changes: 4 additions & 0 deletions doc/notebooks/ensemble_mode.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"\n",
"# Ensemble propagations\n",
"\n",
"```{versionadded} 0.17.0\n",
"\n",
"```\n",
"\n",
"Starting with version 0.17.0, heyoka.py offers support for\n",
"*ensemble propagations*. In ensemble mode, multiple distinct\n",
"instances of the same ODE system are integrated in parallel,\n",
Expand Down
Loading
Loading