Invariant Tori Example
This example demonstrates how to compute invariant tori in the Circular Restricted Three-Body Problem (CR3BP).
Computing invariant tori in the CR3BP
1"""Example script: computing the invariant torus for the Earth-Moon halo orbit.
2
3Run with
4 python examples/invariant_tori.py
5"""
6
7import os
8import sys
9
10sys.path.append(os.path.join(os.path.dirname(__file__), "..", "src"))
11
12from hiten import System
13from hiten import InvariantTori
14
15
16def main() -> None:
17 system = System.from_bodies("earth", "moon")
18 l_point = system.get_libration_point(1)
19
20 orbit = l_point.create_orbit('halo', amplitude_z=0.3, zenith='southern')
21 orbit.correct(max_attempts=25)
22 orbit.propagate(steps=1000)
23
24 torus = InvariantTori(orbit)
25 torus.compute(epsilon=1e-2, n_theta1=512, n_theta2=512)
26 torus.plot()
27
28if __name__ == "__main__":
29 main()