Recent Commits
Commit | Author | Details | Committed | ||||
---|---|---|---|---|---|---|---|
6fffbe0e3ffa | phirling | Increase default integrator precision for smoother maps | Apr 14 2024 | ||||
1969fea8bd3f | phirling | fixed pyproject.toml missing subpackages | Apr 14 2024 | ||||
a79f2089e3a9 | phirling | Fixed circular import error & cleaned script 4 | Jul 16 2023 | ||||
835ab9466d23 | phirling | Small doc changes | Jun 7 2023 | ||||
6efd572db67d | phirling | Remove empty notebook | May 29 2023 | ||||
ba87731203bd | phirling | factorize solver | May 29 2023 | ||||
9c8b88a7cecf | phirling | Factorize package & change col & tomo constructors | May 29 2023 | ||||
eafdc9e83ebf | phirling | Rename & update readme | May 29 2023 | ||||
7d804cddd1c6 | phirling | Merge remote-tracking branch 'origin/main' | May 29 2023 | ||||
5391a7534d8b | phirling | Example 4 first part + small changes | May 29 2023 | ||||
35db7085a4c0 | phirling/GitHub | Create .gitattributes to ignore ipynb | May 28 2023 | ||||
85ea917aaef8 | phirling | Reorganize examples | Apr 25 2023 | ||||
83202916bf07 | phirling | Notebook 3, first part | Apr 25 2023 | ||||
50512d715350 | phirling | First example notebooks | Apr 25 2023 | ||||
e9cf25fe3574 | phirling | finalized dense output,log example cleanup, document | Nov 8 2022 |
README.md
PoincaréPy - Visualize Surfaces of Section Interactively
PoincarePy is a Python module to compute surfaces of section (or Poincaré maps) of 2D potentials and explore them interactively. The user can define a physical system by using and combining a set of predefined potentials, or by implementing new ones, which is made very simple.
Installation
- Requirements
- Numpy
- Matplotlib
- SciPy
- tqdm (Optional)
The install uses setuptools >=3.7. To install the package, simply clone the repo and run python3 -m pip install [path/to/repo] (preferably inside a virtual environment)
User Guide
Documentation & Tutorial
A general introduction as well as the full API documentation of the package can be found here. To help you get started, a tutorial series of 4 notebooks can be found in tutorial_notebooks and will guide you through the main features of the package. A minimal guide is provided below.
Minimal Guide
A typical workflow using poincarepy is:
- Create a potential. This can be one of the predefined potentials or a new custom one, as well as combinations of the latter. For a choice of parameters, it is useful to viszalize the resulting potential, e.g. in a notebook, in order to get an intuition about the allowed energies and the scales of the dynamical variables. For example, when creating a logarithmic potential, this could look like
python import matplotlib.pyplot as plt import poincarepy logpot = poincarepy.potentials.LogarithmicPotential() logpot.plot_x(-10,10) plt.show()
- Create a PoincareMapper object using the potential created above. This class deals with the computational part, and the other parameters are e.g. the maximum integration time (check the class source). With this object in hand, we can integrate orbits, generate Poincaré Maps, find periodic orbits, etc.
- Generate a set of Poincaré sections in a range of energies. This is where step 1 is important, as its necessary to use an energy range that is compatible with the potential. Also, the PoincareMapper.section method will automatically find the limits of the zero-velocity-curve using a root-finding algorithm, but it still requires some bounds on those limits, even if very rough. Again, plotting the potential first is useful for this.
- Create a Tomography object with the generated data. Upon creation, the object will open a figure that allows interactive exploration through the energy levels.
- Key Bindings
- Up/Down: Navigate through the energy levels
- z: Enable the single-orbit redrawing mode. Upon clicking on a point in phase space, a new orbit and its Poincaré Map are computed and displayed
- t: Enable the rectangle selection-redrawing mode. Same as above but a specified $N_{redraw}$ number of orbits inside a selected region are calculated.