-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Pre-submission Checklist
- I have searched existing issues to ensure this feature hasn't already been requested
- I have checked the documentation to confirm this feature doesn't already exist
Description
I would like to see support for numerical orbit propagation around celestial bodies other than Earth, specifically:
- Lunar orbit propagation
- Martian orbit propagation
- Interplanetary trajectory propagation
The feature should support the following force models: gravity (point mass, spherical harmonic; third body perturbation); solar radiation pressure and atmospheric drag.
Use Case
How I Would Use It
-
Lunar orbit propagation: Propagate a spacecraft in low lunar orbit (LLO) with GRAIL-derived gravity (e.g., GRGM1200A), Earth and Sun as third-body perturbers, and SRP.
-
Mars orbit propagation: Propagate a Mars reconnaissance orbiter with GMM-3 gravity, Sun perturbations, SRP, and simplified Mars atmospheric drag.
-
Interplanetary cruise: Propagate a heliocentric trajectory with Sun as the central body and planetary perturbations, then switch central bodies at sphere-of-influence crossings.
Example API Usage (Conceptual)
import brahe as bh
# Lunar orbit example
lunar_config = bh.ForceModelConfig.for_body(
central_body=bh.CentralBody.Moon,
gravity=bh.GravityConfiguration.SphericalHarmonic(
model=bh.GravityModelType.GRGM1200A, # or GRAIL gravity
degree=50,
order=50,
),
third_body=bh.ThirdBodyConfiguration(
bodies=[bh.ThirdBody.Earth, bh.ThirdBody.Sun],
ephemeris_source=bh.EphemerisSource.DE440s,
),
srp=bh.SolarRadiationPressureConfiguration(
eclipse_model=bh.EclipseModel.Conical, # Moon as occulting body
...
),
drag=None, # Negligible lunar atmosphere
)
prop = bh.DNumericalOrbitPropagator.new(
epoch=epoch,
state=lunar_state_mci, # Moon-Centered Inertial
force_config=lunar_config,
...
)Proposed Solution
- Introduce a
CentralBodyAbstraction, add a new enum (or struct) to encapsulate body-specific physical constants and frame definitions: - Extend
ForceModelConfigwith Central Body - Modify
compute_dynamics()to Use Central Body - Generalize Body-Specific Components
- Add Lunar and Martian Gravity Models
- Add Body-Specific Reference Frames
Impact on Existing API
Minor changes to existing functions
Impact Details
Backward Compatibility
This feature can be implemented in a fully backward-compatible manner:
| Scenario | Impact |
|---|---|
Existing ForceModelConfig::default() |
✅ No change needed — defaults to CentralBody::Earth |
Existing ForceModelConfig::earth_gravity() |
✅ No change needed |
Existing ForceModelConfig::leo_default() |
✅ No change needed |
Existing ForceModelConfig::geo_default() |
✅ No change needed |
Existing DNumericalOrbitPropagator::new() |
✅ No signature change |
New API Additions (Non-Breaking)
| New Item | Description |
|---|---|
CentralBody enum |
New type for body selection |
ForceModelConfig.central_body field |
New field with default CentralBody::Earth |
ForceModelConfig::for_body() |
New constructor |
ForceModelConfig::lunar_default() |
New convenience constructor |
ForceModelConfig::mars_default() |
New convenience constructor |
accel_relativity(state, gm) |
Add gm parameter (or deprecate old signature) |
GravityModelType::GRGM1200A, etc. |
New gravity model variants |
Functions Requiring Internal Modification
These functions use hardcoded Earth constants and would need updates to read from CentralBody:
| File | Function/Location | Change Required |
|---|---|---|
dnumerical_orbit_propagator.rs:915 |
compute_dynamics() point-mass |
Use central_body.gm() |
dnumerical_orbit_propagator.rs:985 |
Exponential atmosphere altitude | Use central_body.radius() |
relativity.rs:48-49 |
accel_relativity() |
Add gm parameter |
solar_radiation_pressure.rs |
Eclipse functions | Use central_body.radius() |
frames/*.rs |
Frame transformations | Add body-specific rotation rates |
Python Bindings
The Python bindings (via PyO3) would need updates to expose:
CentralBodyenum- New
ForceModelConfigconstructors - New gravity model types
Contribution
- I can provide test data or validation cases
- I am willing to contribute to the implementation
- I can provide reference material (papers, algorithms, existing implementations)