An integrated differentiable trajectory optimization and economic analysis platform for LEO-Moon missions.
The Lunar Horizon Optimizer is a comprehensive platform that enables real-world lunar mission design and analysis. From basic Earth-Moon transfers to complex economic modeling of lunar resource utilization, this tool supports the full spectrum of space mission engineering challenges.
Core Technologies:
- High-fidelity orbital mechanics using PyKEP 2.6
- Global optimization with PyGMO 2.19.6 (NSGA-II)
- Differentiable programming with JAX 0.5.3 + Diffrax 0.7.0
- Economic analysis with ISRU modeling and sensitivity analysis
- Interactive visualization with Plotly 6.1.1+ dashboards and enhanced 3D landing trajectories
- Static image export with Kaleido 0.2.1+ for PDFs and high-resolution images
- Extensible plugin architecture for custom components
Applications: Mission architecture trade studies, lunar mining business cases, real-time trajectory optimization, constellation design, investment analysis, and policy planning.
Tasks Completed: 10/10
π Project is FEATURE-COMPLETE! All core tasks have been successfully implemented.
- Production Tests: 243/243 passing (100% success rate)
- Core Modules: 161/161 tests passing across 11 key modules
- CLI Tests: All 10 scenarios tested and working
- No Mocking Policy: 100% real implementations (PyKEP, PyGMO, JAX)
- Pipeline Status: Clean with only 2 acceptable complexity warnings
- π Differentiable Optimization: JAX-based gradient optimization
- π° Economic Analysis: NPV, IRR, ROI calculations with ISRU benefits
- β‘ Global Optimization: Multi-objective optimization with Pareto front analysis
- π Interactive Visualization: Enhanced 3D landing trajectories with rocket exhaust visualization
- π Cost Modeling: Wright's law learning curves and environmental costs
- πΈ Trajectory Generation: Lambert solvers, N-body integration, transfer window analysis, powered descent modeling
- π― 3D Landing Visualization: Advanced powered descent visualization with optimized camera positioning
- β Powered Descent Module: JAX/Diffrax-based lunar landing trajectory modeling
- β Continuous Thrust: Moon-centered inertial frame with optimal braking control
- β Gradient-Compatible: Full JAX integration for differentiable optimization
- β 100% Test Success: 243/243 production tests passing with real implementations
- β No Mocking Policy: All tests use real PyKEP/PyGMO/JAX/Diffrax implementations
- β Modern CLI Complete: Comprehensive Click-based interface with rich progress tracking
- β Production Ready: Clean pipeline with comprehensive error handling
- β Differentiable Optimization: JAX-based gradient optimization with real calculations
- β Economic Analysis: NPV, IRR, ROI with ISRU modeling and sensitivity analysis
- β Global Optimization: Multi-objective PyGMO NSGA-II with Pareto front analysis
- β Wright's Law Integration: Launch cost learning curves and environmental costs
- β Interactive Visualization: 3D trajectory plots and economic dashboards
- β Extensible Architecture: Plugin system for custom components and extensions
Codebase Scale: 150 Python files, 326 classes, 340 functions
π Lunar Horizon Optimizer/
βββ π src/ # Source code (main implementation)
β βββ config/ # Mission configuration management
β βββ trajectory/ # Orbital mechanics & PyKEP integration
β βββ optimization/ # PyGMO global optimization & JAX differentiable
β βββ economics/ # Economic analysis & ISRU modeling
β βββ visualization/ # Interactive dashboards & plotting
β βββ extensibility/ # Plugin system & extension framework
β βββ utils/ # Utility functions & performance optimizations
βββ π docs/ # Complete documentation suite
β βββ USER_GUIDE.md # Getting started guide
β βββ INDEX.md # Documentation index
β βββ PROJECT_STATUS.md # Implementation status
β βββ archive/ # Historical documentation
βββ π tests/ # Comprehensive test suite (415 tests)
βββ π scenarios/ # Mission configuration examples
βββ π examples/ # Usage examples and demos
βββ π scripts/ # Development and utility scripts
β βββ utilities/ # Maintenance scripts
βββ π results/ # Analysis outputs (gitignored)
βββ π archive/ # Historical project files
# Create conda environment
conda create -n py312 python=3.12 -y
conda activate py312
# Install dependencies
conda install -c conda-forge pykep pygmo astropy spiceypy -y
pip install -r requirements.txt# Make CLI executable
chmod +x lunar_opt.py
# Validate environment
./lunar_opt.py validate
# List available scenarios
./lunar_opt.py run list
# Run basic lunar cargo mission
./lunar_opt.py run scenario 01_basic_transfer
# Run comprehensive ISRU economics analysis
./lunar_opt.py run scenario 06_isru_economics --risk --export-pdf
# Run powered descent with 3D visualization
./lunar_opt.py run scenario 13_powered_descent_quick --include-descent --3d-viz
# Get detailed help
./lunar_opt.py --help
./lunar_opt.py run scenario --help# Run production test suite
make test
# Run optimization with learning curves
python src/cli.py analyze --config examples/config_after_upgrade.json \
--learning-rate 0.88 --carbon-price 75.0
# Run cost comparison demo
python examples/cost_comparison_demo.py# Quick 30-second test
python run_analysis_examples.py quick
# Production 3-4 minute analysis
python run_analysis_examples.py production
# See all options
python run_analysis_examples.py# Environment setup
conda activate py312
# Quick test (30 seconds)
python src/cli.py analyze --config scenarios/01_basic_transfer.json \
--output quick_test --population-size 8 --generations 5 --no-sensitivity
# Production analysis (3-4 minutes)
python src/cli.py analyze --config scenarios/01_basic_transfer.json \
--output production_test --population-size 52 --generations 30
# Expected results: Delta-V ~22,446 m/s, NPV ~$374M- π CLI Help Reference: Complete command reference and examples
- π CLI User Guide: Comprehensive usage guide with tutorials
- π― CLI Overview: Feature overview and quick start guide
- β±οΈ Progress Tracking Guide: How to run analyses and track progress
- π― Use Cases & Scenarios: Real-world applications and problem scenarios
- π Analysis Examples: Executable script for testing different analysis types
- π Complete Capabilities: Comprehensive API reference
- π° Cost Model Upgrade: Wright's law and environmental costs
- π§ͺ Testing Guide: Test suite documentation and coverage
- π§ Development Guide: Project working rules and standards
- π Final Implementation Status: Production-ready real optimizer
- π« Real Optimizer Only: No mocks policy documentation
- π Project Audit: Repository structure analysis
- π οΈ Cleanup Report: Recent organizational improvements
make help # Show all available commands
make pipeline # Run complete development pipeline
make test # Run production test suite (243 tests, 100% pass rate)
make coverage # Generate coverage report
make lint # Run code quality checks- β NO MOCKING RULE: All tests use real PyKEP, PyGMO, JAX implementations
- β 100% Test Pass Rate: 243/243 production tests passing (415 total tests)
- β Clean Pipeline: 0 linting errors, formatted code
- β Type Safety: Comprehensive type hints and MyPy validation
- Follow the development guide
- Review documentation index for project overview
- Ensure all tests pass with
make test - Run quality checks with
make pipeline - Commit with descriptive messages
See docs/INDEX.md for complete documentation navigation including:
- User guides and getting started
- API reference and technical documentation
- Task implementation details
- Testing guidelines and status
This project is part of the Lunar Horizon Optimizer development.
Last updated: 2025-07-13