- Function was never called anywhere in the codebase
- Functionality now handled by propagate_orbital_elements() with proper Newton-Raphson iteration
- Removes dead code and simplifies the API
- Switch spacecraft and bodies from RK4 to analytical propagation using propagate_orbital_elements()
- Fixed three bugs in hyperbolic orbit propagation (formula errors and insufficient Newton-Raphson iterations)
- Add orbital element reconstruction after burns and SOI transitions
- Zero energy drift for circular, elliptical, parabolic, and hyperbolic orbits
- All 132 tests passing (240,294 assertions)
Moved configs to flatten directory structure:
- test_extreme_orientation_mixed.toml
- test_extreme_timescales.toml
- test_hybrid_burns.toml
- test_hybrid_energy_conservation.toml
Updated corresponding test files to use new paths:
- test_extreme_orientation_mixed.cpp
- test_extreme_timescales.cpp
- test_hybrid_burns.cpp
- test_hybrid_energy_conservation.cpp
All 240,294 assertions passing in 132 test cases
- Combined test_cartesian_to_elements_extreme.cpp (263 lines) and
test_cartesian_to_elements_quadrature.cpp (264 lines) into
test_cartesian_to_elements_advanced.cpp (508 lines, -19 lines saved)
- All 30 test cases preserved (16 from extreme + 14 from quadrature)
- No config files to merge (tests use hardcoded values)
- Added helper functions: find_maneuver_by_name() and execute_maneuver_by_name()
- Modified Hohmann transfer test to use maneuver system via execute_maneuver()
- Modified large burns test to use maneuver system
- Modified energy conservation test to use maneuver system (prograde burn)
- Modified round-trip conversion test to use maneuver system
- Modified multiple burn sequences to use maneuver system for Hohmann transfer
- Tests now properly validate maneuver trigger and execution workflow
- All tests pass (96 assertions in 7 test cases)
- Tests energy comparison between analytical and numerical propagation
- Validates analytical propagation maintains zero energy drift
- Verifies numerical propagation has controlled, expected energy drift
- Tests energy comparison for circular, elliptical, high eccentricity, inclined, fast, and slow orbits
- Tests pre/post burn energy validation (ΔE = v·Δv + 0.5Δv²)
- Tests long-term energy drift comparison (10 orbits)
- Tests energy accuracy across all orbit types
- Validates analytical propagation is more energy-stable than numerical
- Tests fast orbits (LEO, Mercury-like) for numerical precision
- Tests slow orbits (Jupiter-like) for mean anomaly accumulation
- Tests low altitude and super-synchronous orbits
- Validates geosynchronous orbit period accuracy
- Tests period consistency across different true anomalies
- Validates energy conservation across all timescales
- Add solve_barker_equation() function using cubic formula: D + D³/3 = M
- Integrate Barker's equation into propagate_orbital_elements() for parabolic orbits
- Add comprehensive test suite (11 tests, 239 assertions) following TDD
- Use cbrt() for cube root (handles negative numbers properly)
- Parabolic propagation now uses exact analytical solution instead of iterative solver
- All 93 tests passing (239,872 assertions)
- Add 16 minimal comments documenting formulas in orbital_mechanics.cpp
- Fix parabolic test to use orbital_elements_to_cartesian() instead of manual velocity
- Tighten parabolic test tolerance from 1e10 to 1e3 (7 orders of magnitude)
- Reduce parabolic test error from 6.5% to machine precision
- Add near-parabolic detection for |1-e| < 0.01
- Use cosine/sine formulation with atan2() to preserve quadrant
- Avoid catastrophic cancellation in sqrt((1+e)/(1-e)) factor
- Clamp values to [-1,1] to handle precision issues
- Maintain original formula for well-behaved orbits
- Add PARABOLIC_TOLERANCE = 1e-3 constant for consistent detection
- Replace inconsistent thresholds (0.005, 0.98, 1.02) across 5 files
- Refactor orbital_elements_to_cartesian() to use semi-latus rectum as primary parameter
- Eliminate 3 separate code branches with unified formulas for all orbit types
- Improve numerical stability for parabolic and near-parabolic orbits
- Reduce code complexity: -23 lines net
- Convert 64 test assertions from Approx() to WithinAbs() in 2 new test files
- Add WithinAbs() testing guidelines to AGENTS.md
- Fix cartesian_to_orbital_elements(): eccentricity vector calculation,
true anomaly normalization, parabolic semi-latus rectum handling
- Add 2 new test files for edge cases and quadrature points
New modular API:
- solve_kepler_elliptical(M, e): Newton-Raphson for E - e·sin(E) = M
- solve_kepler_hyperbolic(M, e): Solver for H - e·sinh(H) = M
- eccentric_to_true_anomaly(E, e): Convert eccentric to true anomaly
- hyperbolic_to_true_anomaly(H, e): Convert hyperbolic to true anomaly
- mean_anomaly_to_true_anomaly(M, e): Unified wrapper (dispatches based on e)
Changes:
- Renamed solve_kepler_equation() → solve_kepler_elliptical() for clarity
- Extracted KEPLER_TOLERANCE and KEPLER_MAX_ITERATIONS constants
- Separated hyperbolic solver logic from combined function
- Fixed test_newton_raphson_convergence to verify Kepler's equation
(instead of incorrectly expecting E ≈ M for small e)
- Added TODO comment for future cartesian_to_orbital_elements refactoring
New validation function validate_true_anomaly_ranges() checks that
hyperbolic orbits (e > 1) have true anomalies within physically valid
range: |ν| < arccos(-1/e)
This prevents configs from specifying starting positions that would
cause negative radius values (1 + e·cos(ν) ≤ 0).
Config changes:
- 'Slightly_Hyperbolic': e=1.05, a=-1.3e8 (perigee at 6.5e6 m)
- 'Near_Parabolic': e=0.99, a=7.0e8 (perigee at 7e6 m)
Test changes:
- Added check for hyperbolic orbit anomaly limits (|ν| < arccos(-1/e))
- Skip testing ν=π and 3π/2 when they exceed valid range for e>1
Bug: r_dot_e was incorrectly divided by mu instead of r_mag*e_mag,
causing cos_nu values of ~7.5e6 (far outside [-1,1]) which made acos() return NaN.
Fix: Calculate cos_nu correctly as r_dot_e/(r_mag*e_mag) and clamp
to [-1, 1] to handle floating-point precision errors.
This fixes all cartesian <-> orbital elements round-trip conversion tests.
Added 6 test files for Newton-Raphson solver and analytical propagation:
- test_cartesian_to_elements_basic.cpp: Tests state vector ↔ orbital elements conversion
- test_newton_raphson_convergence.cpp: Tests Newton-Raphson solver convergence behavior
- test_analytical_propagation_apsides.cpp: Tests propagation through orbital apsides
- test_analytical_propagation_timesteps.cpp: Tests propagation with various timesteps
- test_extreme_eccentricity.cpp: Tests near-parabolic and hyperbolic orbits
- test_precision_boundaries.cpp: Tests exact boundary value handling
Implemented core orbital mechanics functions:
- solve_kepler_equation(): Newton-Raphson solver with 1e-10 tolerance
- get_initial_trial_value(): Series expansion initial guess
- cartesian_to_orbital_elements(): State vectors to orbital elements conversion
- propagate_orbital_elements(): Analytical propagation using Kepler's equation
Updated test plan document with current progress and remaining tests.
Test status: 66 passed, 14 failed (out of 80 test cases)
- Failing tests are expected: implementation needs debugging
- Config validation issues fixed by adjusting orbital parameters