Skip to content

ATaylorAerospace/geo_optimization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

111 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Geosat

πŸš€ GEO Optimization & Orbital Dynamics

License Stars Python MATLAB Contact A Taylor

A dual language library for GEO spacecraft propulsion optimisation and orbital mechanics. The same physics; Hohmann transfers, J2 secular perturbations, electric thruster trade space optimisation, is implemented in both Python and MATLAB so that results can be cross verified at every step of the mission design cycle.


πŸ“‹ Overview

This library bridges the gap between rapid research workflows (Python) and flight-software simulation environments (MATLAB/Simulink). Every physical equation is implemented identically in both languages, test-verified against published reference values, and documented with LaTeX mathematics.


✨ Why Dual Language?

Aerospace engineering workflows typically span two toolchains:

Phase Preferred Environment
πŸ”¬ Rapid research & algorithm development Python (NumPy, SciPy, Astropy)
πŸ›°οΈ Flight-software simulation & heritage tools MATLAB / Simulink
βœ… Verification & cross-check Both

Maintaining a single source of truth across both languages means:

  • πŸ” Results produced in Python can be independently validated in MATLAB before they appear in a flight-software simulation
  • πŸ“ MATLAB Simulink models can import the same thruster parameters that were optimised in Python
  • 🀝 Engineers can work in whichever language they know without losing access to the validated physics kernel

πŸ—‚οΈ Repository Layout

geo_optimization/
β”‚
β”œβ”€β”€ 🐍 python/                          Python package
β”‚   β”œβ”€β”€ pyproject.toml                  PEP 517/518 build configuration
β”‚   └── src/geo_opt/
β”‚       β”œβ”€β”€ __init__.py                Package root (version, metadata)
β”‚       β”œβ”€β”€ constants.py                Physical & orbital constants (astropy.units)
β”‚       β”œβ”€β”€ dynamics/
β”‚       β”‚   β”œβ”€β”€ __init__.py            Convenience re-exports for short imports
β”‚       β”‚   β”œβ”€β”€ keplerian.py            Vis-viva, circular velocity, Hohmann transfer
β”‚       β”‚   └── perturbations.py        J2 RAAN & Ο‰ drift, station-keeping budget
β”‚       β”œβ”€β”€ propulsion/
β”‚       β”‚   β”œβ”€β”€ __init__.py            Convenience re-exports for short imports
β”‚       β”‚   β”œβ”€β”€ thruster.py             Generic rocket eqn + Pydantic config
β”‚       β”‚   β”œβ”€β”€ het.py                  Hall-Effect Thruster model
β”‚       β”‚   └── ion.py                  Gridded Ion Thruster model
β”‚       └── optimization/
β”‚           └── solvers.py              Grid-search & SciPy L-BFGS-B solvers
β”‚
β”œβ”€β”€ πŸ”Ά matlab/                          MATLAB package (+geo_opt namespace)
β”‚   β”œβ”€β”€ startup.m                       Adds library paths β€” run once per session
β”‚   β”œβ”€β”€ +geo_opt/
β”‚   β”‚   β”œβ”€β”€ constants.m                 Returns authoritative constant struct
β”‚   β”‚   β”œβ”€β”€ +dynamics/
β”‚   β”‚   β”‚   β”œβ”€β”€ circular_velocity.m
β”‚   β”‚   β”‚   β”œβ”€β”€ vis_viva.m
β”‚   β”‚   β”‚   β”œβ”€β”€ hohmann_transfer.m
β”‚   β”‚   β”‚   β”œβ”€β”€ orbital_period.m
β”‚   β”‚   β”‚   β”œβ”€β”€ j2_raan_drift.m
β”‚   β”‚   β”‚   └── j2_argperigee_drift.m
β”‚   β”‚   β”œβ”€β”€ +propulsion/
β”‚   β”‚   β”‚   β”œβ”€β”€ calculate_thrust.m
β”‚   β”‚   β”‚   β”œβ”€β”€ estimate_power.m
β”‚   β”‚   β”‚   β”œβ”€β”€ thrust_to_power_ratio.m
β”‚   β”‚   β”‚   β”œβ”€β”€ tsiolkovsky_dv.m
β”‚   β”‚   β”‚   β”œβ”€β”€ het_performance.m
β”‚   β”‚   β”‚   └── ion_performance.m
β”‚   β”‚   └── +optimization/
β”‚   β”‚       β”œβ”€β”€ grid_search.m           Exhaustive mesh optimiser
β”‚   β”‚       └── fmincon_optimizer.m     fmincon continuous solver
β”‚   └── tests/
β”‚       β”œβ”€β”€ test_dynamics.m
β”‚       β”œβ”€β”€ test_propulsion.m
β”‚       └── test_optimization.m
β”‚
β”œβ”€β”€ πŸ“„ .gitignore
β”œβ”€β”€ πŸ“„ LICENSE
└── πŸ“„ README.md

πŸš€ Quick Start β€” Python

# Install from the python/ subdirectory
pip install -e "python/[dev]"

# Run all tests
cd python && pytest
from astropy import units as u
from geo_opt.constants import R_LEO, R_GEO

# ✨ Convenience imports β€” short form (recommended)
from geo_opt.dynamics import hohmann_transfer
from geo_opt.propulsion import ThrusterConfig, HETModel

# πŸ“¦ Fully qualified imports also work
# from geo_opt.dynamics.keplerian import hohmann_transfer
# from geo_opt.propulsion.thruster import ThrusterConfig
# from geo_opt.propulsion.het import HETModel

from geo_opt.optimization.solvers import grid_search_optimizer

# --- πŸ›Έ Hohmann Transfer: LEO β†’ GEO ---
result = hohmann_transfer(R_LEO, R_GEO)
print(f"Total Ξ”V = {result['dv_total'].to('km/s'):.4f}")
# Total Ξ”V = 3.8933 km / s

# --- ⚑ HET Performance ---
cfg = ThrusterConfig(name="SPT-100", isp_s=1600, efficiency=0.50,
                     mass_flow_kg_s=5e-6)
het = HETModel(cfg)
perf = het.performance()
print(f"Thrust = {perf['thrust_mN']:.3f} | Power = {perf['input_power_W']:.1f}")

# --- 🎯 Thruster Optimisation ---
opt = grid_search_optimizer(isp_range=(1000, 4000), efficiency=0.55)
print(f"Optimal F/P = {opt.thrust_to_power.to('mN/W'):.4f}")

πŸ”Ά Quick Start β€” MATLAB

% From the MATLAB command window, run startup once:
run('matlab/startup.m')

% πŸ›Έ Hohmann Transfer: LEO β†’ GEO
C      = geo_opt.constants();
result = geo_opt.dynamics.hohmann_transfer(C.R_LEO, C.R_GEO);
fprintf('Total dV = %.4f km/s\n', result.dv_total/1e3);
% Total dV = 3.8933 km/s

% ⚑ HET Performance
perf = geo_opt.propulsion.het_performance(1600, 5e-6, 0.50);
fprintf('Thrust = %.3f mN | Power = %.1f W\n', perf.thrust_mN, perf.power_W);

% 🎯 Thruster Optimisation
opt = geo_opt.optimization.grid_search([1000 4000], [5e-5 1e-3], 0.55);
fprintf('Optimal F/P = %.4f mN/W\n', opt.thrust_to_power * 1e3);

% βœ… Run tests
results = runtests('tests/test_dynamics');
disp(table(results))

πŸ”§ Physical Models

🌍 Orbital Dynamics

Model Equation
Circular velocity $v_c = \sqrt{\mu/r}$
Vis-viva $v = \sqrt{\mu(2/r - 1/a)}$
Hohmann Ξ”V₁ $\Delta v_1 = \sqrt{\mu/r_1}\left(\sqrt{2r_2/(r_1+r_2)}-1\right)$
Hohmann Ξ”Vβ‚‚ $\Delta v_2 = \sqrt{\mu/r_2}\left(1-\sqrt{2r_1/(r_1+r_2)}\right)$
J2 RAAN drift $\dot{\Omega} = -\tfrac{3}{2}n J_2(R_\oplus/p)^2\cos i$
J2 Ο‰ drift $\dot{\omega} = \tfrac{3}{4}n J_2(R_\oplus/p)^2(5\cos^2 i - 1)$

⚑ Propulsion

Model Equation
Thrust $F = \dot{m},I_{sp},g_0$
Input power $P_{in} = \tfrac{1}{2}\dot{m}v_e^2/\eta$
Thrust-to-power $F/P = 2\eta/(I_{sp},g_0)$
Rocket equation $\Delta v = I_{sp},g_0,\ln(m_0/m_f)$

πŸ›°οΈ Thruster Performance Envelopes

Type $I_{sp}$ range (s) Efficiency Application
⚑ Hall-Effect (HET) 1 200 – 3 500 45 – 65 % GEO station-keeping, orbit raising
πŸ”¬ Gridded Ion 2 500 – 10 000 55 – 80 % Deep-space, high-Ξ”V GEO

πŸ“Š Physical Constants

Symbol Value Unit Source
$g_0$ 9.80665 m s⁻² ISO 80000-3
$\mu_\oplus$ 3.986 004 418 Γ— 10¹⁴ mΒ³ s⁻² WGS-84
$R_\oplus$ 6 378 137 m WGS-84
$J_2$ 1.082 626 68 Γ— 10⁻³ β€” IERS 2010
$r_{GEO}$ 42 164 137 m derived

βœ… Running the Tests

🐍 Python

cd python
pip install -e ".[dev]"
pytest -v

πŸ”Ά MATLAB

run('matlab/startup.m')
runtests('matlab/tests/test_dynamics')
runtests('matlab/tests/test_propulsion')
runtests('matlab/tests/test_optimization')

πŸ› οΈ Technical Specifications

βš™οΈ Optimization Parameters

  • βœ… Specific Impulse Range: 1 000 – 10 000 seconds
  • βœ… Mass Flow Rate Range: 0.00005 – 0.001 kg/s
  • βœ… Customisable efficiency parameters
  • βœ… Real-time thrust and power calculations
  • βœ… Multi-objective optimisation support
  • βœ… Gravity-assist multiplier support

πŸ”¬ Validation

  • βœ… All reference values anchored to Vallado (2013) & Curtis (2020)
  • βœ… Python tests use astropy.units for unit-safe comparisons
  • βœ… MATLAB tests use functiontests with RelTol/AbsTol tolerances
  • βœ… Cross-language parity verified: LEOβ†’GEO Ξ”V = 3.893 km/s in both
  • βœ… Pydantic ThrusterConfig enforces physical bounds (Isp, efficiency, mass flow)
  • βœ… Consistent input guards across all propulsion functions (positive Isp, positive mass flow, 0 < Ξ· ≀ 1)

πŸ“– Citation

@misc{ATaylor_GEOOptimization_2026,
  author  = {A. Taylor},
  title   = {GEO Optimization \& Orbital Dynamics β€” Dual-Language Library},
  year    = {2026},
  url     = {https://github.com/ATaylorAerospace/geo_optimization}
}

πŸ“¬ Contact

Have questions, ideas, or want to collaborate? Reach out to A Taylor directly:

Contact A Taylor

About

Maximizing outlet thrust in a geostationary orbit (GEO) with minimal voltage

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors