Poincare Map Example
This example demonstrates how to compute Poincare maps in the Circular Restricted Three-Body Problem (CR3BP).
Computing Poincare maps in the CR3BP
1"""Example script: generating and displaying a Poincare map for the Earth-Moon hiten.system.
2
3python examples/poincare_map.py
4"""
5
6import os
7import sys
8
9sys.path.append(os.path.join(os.path.dirname(__file__), "..", "src"))
10
11from hiten.system import System
12from hiten.utils.log_config import logger
13
14
15def main() -> None:
16 """Generate and interactively display a Poincare map."""
17
18 system = System.from_bodies("earth", "moon")
19
20 l_point = system.get_libration_point(1)
21 logger.info("Generating Poincare map for L%s of the %s-%s system...", 1, "Earth", "Moon")
22 cm = l_point.get_center_manifold(degree=6)
23 cm.compute()
24
25 pm = cm.poincare_map(energy=0.7)
26 overrides = {
27 "n_seeds": 20,
28 "n_iter": 20,
29 "seed_strategy": "axis_aligned",
30 "n_workers": 8
31 }
32 pm.compute(section_coord="p3", overrides=overrides)
33
34 pm.plot(axes=("p2", "q3"))
35
36
37if __name__ == "__main__":
38 main()