Skip to main content

orbit-gen

Periodic orbit family generation and continuation in the Circular Restricted Three-Body Problem (CR3BP).

Overview

orbit-gen generates families of periodic orbits in the CR3BP using single-shooting differential correction and pseudo-arclength continuation. It currently supports various families in the Earth-Moon and Sun-Earth systems.

Installation

pip install orbit-gen

Requires Python 3.11+.

Usage

From a config file

# orbit_config.yaml
system: SE                      # "EM" (Earth-Moon) or "SE" (Sun-Earth)
preset: SE_L2_Northern_Halo

max_iter: 1000                  # Maximum Newton iterations for a single differential correct attempt
eps: 1.0e-6                     # Differential-correction convergence tolerance on residual norm
step: 0.01                      # Pseudo-arclength continuation step size in canonical units
max_solutions: 20               # Maximum number of orbits to generate
max_period_days: 1000.0         # Maximum full orbit period in days

output_dir: results
show_plots: true                # Optional; for user use only
from orbit_gen import Family, RunConfig

cfg = RunConfig.from_yaml("orbit_config.yaml")
fam = Family(cfg)

fam.save()
if cfg.show_plots:
    fam.plot()

Note: constructing Family(cfg) runs the continuation, but does not save or plot results on its own — call .save() / .plot() explicitly, as shown above.

Programmatically; without a config file

from orbit_gen import Family, RunConfig
from orbit_gen.setup.system_config import SE_SYSTEM
from orbit_gen.setup.presets import PRESETS

cfg = RunConfig(system=SE_SYSTEM, ic=PRESETS["SE_L2_Northern_Halo"])
fam = Family(cfg)
fam.save()

Available preset keys (see orbit_gen.setup.presets.PRESETS): EM_L2_Northern_Halo, EM_DRO_1, EM_DRO_2, EM_L1, EM_Butterfly, EM_Unnamed_1, SE_L2_Northern_Halo, SE_L1_Vertical, SE_L2_Lyapunov, SE_L2_Small_Lyapunov, SE_L2_Large_Lyapunov, SE_L2_Southern_Halo, SE_Butterfly, SE_Dragonfly.

Supported Systems

Key System
EM Earth-Moon
SE Sun-Earth

Output

fam.save() writes a .npz file (named after the preset, in cfg.output_dir) containing initial states, periods, and mu_star for all converged orbits:

import numpy as np
data = np.load("results/SE_L2_Northern_Halo.npz")
data["states"]              # (N, 6) containing initial [x, y, z, vx, vy, vz] in canonical units for each orbit
data["periods"]             # (N,) containing full period in canonical units for each orbit
data["mu_star"]             # System mass ratio

Contributing

Clone or download the repository and run

uv sync

to install the package in editable mode plus dev dependencies. Run the test suite with:

uv run pytest

The repo includes a driver script, scripts/crtbpModel.py, which reads orbit_config.yaml from the project root, runs continuation, saves results, and shows plots.

An example configuration file (orbit_config.example.yaml), is included in the repository, and orbit_config.yaml can be created and used by running:

cp orbit_config.example.yaml orbit_config.yaml   # edit as needed
uv run python scripts/crtbpModel.py

License

MIT — see LICENSE.

Credits and Acknowledgements

Created by Jayden Ripic

The differential correction and continuation algorithms were adapted from SIOSlab/starlift, written by Grace Genszler

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orbit_gen-0.1.1.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orbit_gen-0.1.1-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file orbit_gen-0.1.1.tar.gz.

File metadata

  • Download URL: orbit_gen-0.1.1.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for orbit_gen-0.1.1.tar.gz
Algorithm Hash digest
SHA256 df7d6ae09d904bd64553e14ca356a501891c0f7f78d0daa7789a77c75e3982ad
MD5 a5e624371e4af6f18abdfc0a47ab87b0
BLAKE2b-256 558a422d80dd4d8b43b29b2f245897761dac6f622b89a36bbfcac4ea71c07da7

See more details on using hashes here.

Provenance

The following attestation bundles were made for orbit_gen-0.1.1.tar.gz:

Publisher: release.yml on jmripic/orbit-gen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file orbit_gen-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: orbit_gen-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for orbit_gen-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e86e0e654f1a2004fd85464330a3ce8219d3600dd0bfdc3854f77df2813d1b3e
MD5 db2978fde13d2f357c64bc1cacfdb9c8
BLAKE2b-256 27412b247d02ad8781bdd4633c70402d2f564a29f43780b2129edbbb266905ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for orbit_gen-0.1.1-py3-none-any.whl:

Publisher: release.yml on jmripic/orbit-gen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page