Orbit Family Example

This example demonstrates how to compute families of periodic orbits in the Circular Restricted Three-Body Problem (CR3BP).

Computing orbit families in the CR3BP
 1"""Example script: continuation-based generation of a Halo-orbit halo_family.
 2
 3Run with
 4    python examples/orbit_family.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.algorithms.continuation.options import OrbitContinuationOptions
14from hiten.algorithms.types.states import SynodicState
15from hiten.system.family import OrbitFamily
16
17
18def main() -> None:
19    """Generate and save a small Halo halo_family around the Earth-Moon L1 point.
20    
21    This example demonstrates how to use the ContinuationPipeline predictor to
22    generate a halo_family of Halo orbits around the Earth-Moon L1 point.
23    """
24    system = System.from_bodies("earth", "moon")
25    l1 = system.get_libration_point(1)
26    
27    halo_seed = l1.create_orbit('halo', amplitude_z= 0.2, zenith='southern')
28    halo_seed.correct()
29    halo_seed.propagate()
30
31    options = OrbitContinuationOptions(
32            target=(
33                [halo_seed.initial_state[SynodicState.Z], halo_seed.initial_state[SynodicState.Y]],
34                [halo_seed.initial_state[SynodicState.Z] + 2.0, halo_seed.initial_state[SynodicState.Y]-1.0]),
35            step=(
36                (1 - halo_seed.initial_state[SynodicState.Z]) / (100 - 1),
37                (1 - halo_seed.initial_state[SynodicState.Y]) / (100 - 1),
38            ),
39            max_members=100,
40            max_retries_per_step=50,
41            step_min=1e-10,
42            step_max=1.0,
43            shrink_policy=None,
44            extra_params=halo_seed.correction_options,
45        )
46
47    result = halo_seed.generate(options)
48
49    print(result)
50
51    family = OrbitFamily.from_result(result)
52    family.propagate()
53    family.plot()
54
55if __name__ == "__main__":
56    main()