Skip to content

ATaylorAerospace/HohmannHET

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

142 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

hohmanhet

๐Ÿš€ Hohmann Transfer with Hall Effect Thrusters (HohmannHET)

License CI Stars Language Contact

๐Ÿ“‹ Overview

HohmannHET is a library for low-thrust orbital transfers combining Keplerian Hohmann mechanics, high fidelity Hall Effect Thruster (HET) propulsion models, and mission optimization solvers.

The library delivers identical numerical results across Python, C++20, and MATLAB to within a floating point tolerance of 1e-6, making it suitable for cross environment verification, flight software prototyping, and academic research.

Author: A Taylor | Reference: Vallado / Curtis


โœจ Key Features

๐ŸŽฏ Tri-Language Core Parity

  • Identical dynamics, propulsion, and optimization modules in Python, C++, and MATLAB
  • Cross-language delta-V and TOF agreement to 1e-6 (km/s / s)
  • Shared physical constants: mu = 398600.4418 km^3/s^2, R_E = 6378.137 km

๐Ÿ”ง Three Physics Modules

  • dynamics: Keplerian Hohmann logic, impulsive maneuvers, circular velocity, orbital period
  • propulsion: High-fidelity HET models: anode efficiency, beam voltage, exhaust velocity, Tsiolkovsky mass budget
  • optimization: Golden-section solver for minimum-propellant / minimum-TOF mission design

๐Ÿงฎ Mathematical Transparency

  • Every physics equation documented in LaTeX (Python docstrings / C++ Doxygen / MATLAB help blocks)
  • References: Vallado "Fundamentals of Astrodynamics and Applications," Curtis "Orbital Mechanics for Engineering Students," Goebel & Katz "Fundamentals of Electric Propulsion"

๐Ÿงช Comprehensive Testing & CI

  • Python: pytest suite with astropy.units quantity checks and PEP 561 inline type support (py.typed)
  • MATLAB: matlab.unittest class-based tests with arguments validation
  • C++: GoogleTest (gtest/gmock) with parameterized scenarios
  • All suites validate against LEO-to-GEO benchmark values (Vallado Table 6-1)
  • CI: GitHub Actions runs Python (3.10 / 3.11 / 3.12) and C++ test suites on every push and PR

๐Ÿ—๏ธ Repository Structure

HohmannHET/
โ”œโ”€โ”€ .github/
โ”‚   โ””โ”€โ”€ workflows/
โ”‚       โ””โ”€โ”€ ci.yml                  # GitHub Actions CI for Python + C++
โ”œโ”€โ”€ python/
โ”‚   โ”œโ”€โ”€ pyproject.toml              # Hatch build config, astropy dependency
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ””โ”€โ”€ hohmann_het/
โ”‚   โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚       โ”œโ”€โ”€ dynamics.py         # Hohmann transfer, circular velocity, TOF
โ”‚   โ”‚       โ”œโ”€โ”€ propulsion.py       # HET operating point, Tsiolkovsky equation
โ”‚   โ”‚       โ”œโ”€โ”€ optimization.py     # Golden-section Isp optimizer
โ”‚   โ”‚       โ””โ”€โ”€ py.typed            # PEP 561 marker for inline type support
โ”‚   โ””โ”€โ”€ tests/
โ”‚       โ”œโ”€โ”€ test_dynamics.py
โ”‚       โ”œโ”€โ”€ test_propulsion.py
โ”‚       โ””โ”€โ”€ test_optimization.py
โ”‚
โ”œโ”€โ”€ matlab/
โ”‚   โ”œโ”€โ”€ +hohmann_het/
โ”‚   โ”‚   โ”œโ”€โ”€ Dynamics.m              # Static-method class with arguments blocks
โ”‚   โ”‚   โ”œโ”€โ”€ Propulsion.m
โ”‚   โ”‚   โ””โ”€โ”€ Optimization.m
โ”‚   โ””โ”€โ”€ tests/
โ”‚       โ”œโ”€โ”€ TestDynamics.m          # matlab.unittest TestCase
โ”‚       โ”œโ”€โ”€ TestPropulsion.m
โ”‚       โ””โ”€โ”€ TestOptimization.m
โ”‚
โ”œโ”€โ”€ cpp/
โ”‚   โ”œโ”€โ”€ CMakeLists.txt              # C++20, header-only library + GTest suite
โ”‚   โ”œโ”€โ”€ include/
โ”‚   โ”‚   โ””โ”€โ”€ hohmann_het/
โ”‚   โ”‚       โ”œโ”€โ”€ dynamics.hpp        # Doxygen-annotated header-only implementation
โ”‚   โ”‚       โ”œโ”€โ”€ propulsion.hpp
โ”‚   โ”‚       โ””โ”€โ”€ optimization.hpp
โ”‚   โ””โ”€โ”€ tests/
โ”‚       โ”œโ”€โ”€ CMakeLists.txt
โ”‚       โ”œโ”€โ”€ test_dynamics.cpp
โ”‚       โ”œโ”€โ”€ test_propulsion.cpp
โ”‚       โ””โ”€โ”€ test_optimization.cpp
โ”‚
โ”œโ”€โ”€ .gitignore                      # Python / C++ / MATLAB / IDE ignore rules
โ”œโ”€โ”€ CONTRIBUTING.md                 # Contribution guidelines and parity rules
โ”œโ”€โ”€ LICENSE                         # Apache 2.0
โ””โ”€โ”€ README.md

๐Ÿ› ๏ธ Technical Specifications

Physical Constants

Parameter Value Unit
Earth's Gravitational Parameter (mu) 398,600.4418 km^3/s^2
Earth's Equatorial Radius 6,378.137 km
Standard Gravity (g0) 9.80665 m/s^2
Xenon Atom Mass 2.180174e-25 kg
Cross-language Precision 1e-6 -

Supported Transfer Scenarios

  • โœ… Low Earth Orbit (LEO) to Geostationary Orbit (GEO)
  • โœ… Reverse transfers (GEO to LEO)
  • โœ… Custom altitude transfers
  • โœ… Same-altitude validation (zero delta-V)
  • โœ… Extreme altitude differences (up to 100,000 km)
  • โœ… HET propellant budget via Tsiolkovsky rocket equation
  • โœ… Isp optimization: minimum-propellant / minimum-burn-time trade-off

๐Ÿš€ Quick Start

Python

Install (development mode):

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

Run the test suite:

pytest tests/ -v

Usage example:

import astropy.units as u
from hohmann_het import compute_hohmann, compute_het_state, optimize_isp

# Hohmann transfer: LEO 400 km -> GEO 35786 km
transfer = compute_hohmann(400.0 * u.km, 35786.0 * u.km)
print(f"Total dv  : {transfer.total_dv:.4f}")
print(f"TOF       : {transfer.tof_hours:.3f}")

# HET operating point (SPT-100 class)
het = compute_het_state(300.0, 1350.0, 0.50)
print(f"Isp       : {het.isp:.1f}")
print(f"Thrust    : {het.thrust:.4f}")

# Optimize Isp for 1000 kg spacecraft, 5 kW thruster
result = optimize_isp(1000.0 * u.kg, transfer.total_dv, 5000.0 * u.W, 0.55)
print(f"Optimal Isp : {result.optimal_isp:.1f}")
print(f"Propellant  : {result.propellant_mass:.2f}")

MATLAB

Add the matlab/ directory to your MATLAB path, then call:

addpath(genpath('matlab'))

% Hohmann transfer
result = hohmann_het.Dynamics.compute_hohmann(400, 35786);
fprintf('Total dv = %.4f km/s\n', result.total_dv);
fprintf('TOF      = %.3f h\n',    result.tof_hours);

% HET operating point
state = hohmann_het.Propulsion.compute_het_state(300, 1350, 0.50);
fprintf('Isp      = %.1f s\n', state.isp);

% Optimize Isp
opt = hohmann_het.Optimization.min_propellant_transfer(400, 35786, 1000, 5000, 0.55);
fprintf('Opt Isp  = %.1f s\n', opt.optimal_isp);

Run MATLAB tests:

cd matlab/tests
results = runtests({'TestDynamics','TestPropulsion','TestOptimization'});
table(results)

C++ (CMake)

Requirements: CMake >= 3.20, C++20-capable compiler, internet access (GoogleTest fetched automatically).

Build:

cd cpp
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build

Run tests:

cd build
ctest --output-on-failure

Or run individual test binaries:

./build/tests/test_dynamics
./build/tests/test_propulsion
./build/tests/test_optimization

Use as a CMake dependency:

# In your CMakeLists.txt
add_subdirectory(path/to/hohmann_het/cpp)
target_link_libraries(my_target PRIVATE hohmann_het)

Usage example:

#include "hohmann_het/dynamics.hpp"
#include "hohmann_het/propulsion.hpp"
#include "hohmann_het/optimization.hpp"

using namespace hohmann_het;

auto transfer = compute_hohmann(400.0, 35786.0);
auto het      = compute_het_state(300.0, 1350.0, 0.50);
auto opt      = min_propellant_transfer(400.0, 35786.0, 1000.0, 5000.0, 0.55);

๐Ÿ“Š LEO-to-GEO Benchmark

Reference values (Vallado Table 6-1), verified across all three languages:

Quantity Value Unit
Departure burn (dv1) ~2.40 km/s
Arrival burn (dv2) ~1.46 km/s
Total delta-V ~3.86 km/s
Transfer time ~5.29 hours

๐Ÿ“‹ Citations

@misc{ATaylor_HohmannHET_2026,
  author = {A. Taylor},
  title  = {HohmannHET: Low-Thrust Orbital Transfer Library},
  year   = {2026},
  url    = {https://github.com/ATaylorAerospace/HohmannHET}
}

๐Ÿค Contributing

Contributions are welcome! Please read CONTRIBUTING.md before submitting a pull request. The most important rule: every physics function must be implemented identically across all three languages (Python, C++, MATLAB) with numerical agreement to 1e-6.


๐Ÿ“ฌ Contact

Contact A Taylor

About

Hohmann transfer orbit modeling with Hall-Effect thruster integration, implemented in Python, C++ and MATLAB with 3D visualization and validated delta-V calculations for LEO to GEO missions

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors