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.12+.

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

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.

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.0.tar.gz (12.9 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.0-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: orbit_gen-0.1.0.tar.gz
  • Upload date:
  • Size: 12.9 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.0.tar.gz
Algorithm Hash digest
SHA256 4e24720ed0dcf7dd18d6ef8ffc0dea2130dbbad11a1a8a8992ef2f2d294783e7
MD5 567ab0aff8ecb79ba58609001737ce4a
BLAKE2b-256 036a966c67f3dfd8e93740fdefe3afac545593659c1add8712d098731c048218

See more details on using hashes here.

Provenance

The following attestation bundles were made for orbit_gen-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: orbit_gen-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96e57cf17adf2e375c6977e2d6abf47bb533d08e4d3ba2a84a8e4e7b7a75b0c4
MD5 5463637550465a789922177b7f5af89d
BLAKE2b-256 8ba837b1776aacfd4004273a9ae539000262af7dad61618f4020f239b880510c

See more details on using hashes here.

Provenance

The following attestation bundles were made for orbit_gen-0.1.0-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

0.1.1

2 files

This release

0.1.0 This release

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