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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df7d6ae09d904bd64553e14ca356a501891c0f7f78d0daa7789a77c75e3982ad
|
|
| MD5 |
a5e624371e4af6f18abdfc0a47ab87b0
|
|
| BLAKE2b-256 |
558a422d80dd4d8b43b29b2f245897761dac6f622b89a36bbfcac4ea71c07da7
|
Provenance
The following attestation bundles were made for orbit_gen-0.1.1.tar.gz:
Publisher:
release.yml on jmripic/orbit-gen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
orbit_gen-0.1.1.tar.gz -
Subject digest:
df7d6ae09d904bd64553e14ca356a501891c0f7f78d0daa7789a77c75e3982ad - Sigstore transparency entry: 2520116347
- Sigstore integration time:
-
Permalink:
jmripic/orbit-gen@3f9a32e5a86a61ca030d5816f4b319647ccd3606 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/jmripic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3f9a32e5a86a61ca030d5816f4b319647ccd3606 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e86e0e654f1a2004fd85464330a3ce8219d3600dd0bfdc3854f77df2813d1b3e
|
|
| MD5 |
db2978fde13d2f357c64bc1cacfdb9c8
|
|
| BLAKE2b-256 |
27412b247d02ad8781bdd4633c70402d2f564a29f43780b2129edbbb266905ce
|
Provenance
The following attestation bundles were made for orbit_gen-0.1.1-py3-none-any.whl:
Publisher:
release.yml on jmripic/orbit-gen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
orbit_gen-0.1.1-py3-none-any.whl -
Subject digest:
e86e0e654f1a2004fd85464330a3ce8219d3600dd0bfdc3854f77df2813d1b3e - Sigstore transparency entry: 2520116524
- Sigstore integration time:
-
Permalink:
jmripic/orbit-gen@3f9a32e5a86a61ca030d5816f4b319647ccd3606 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/jmripic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3f9a32e5a86a61ca030d5816f4b319647ccd3606 -
Trigger Event:
push
-
Statement type: