- Move all configs from tests/configs/ to tests/
- Rename configs to match test filenames (test_NAME.toml)
- Remove unused configs (earth_mars_simple, simple_root_transition, interplanetary_transfer)
- Combine earth_circular and mars_circular into test_orbital_period.toml
- Duplicate earth_circular.toml as test_energy.toml
- Remove invalid parent test case from test_invalid_parent_assignment.cpp
- Update all test files to reference new config paths
- Delete tests/configs/ directory
- Added orbital_mechanics module with orbital_elements_to_cartesian()
- Updated initialize_orbital_objects() to use orbital mechanics
- Added validate_initial_positions() for post-initialization checking
- Fixed test files to use global_position/global_velocity
- Updated config loader to support spacecraft altitude parameter
- Fixed orbital_mechanics.cpp velocity calculation bug (removed duplicate scaling)
- Updated Makefile to include orbital_mechanics.o in test build
- Renamed simulation.h OrbitalMetrics to OrbitalAnalysis to avoid conflict
- Added docs/parabolic_union_implementation.md for parabolic orbit support plan
Note: Test configs still need manual fix for orbit table TOML syntax
Merge spacecraft management into simulation module:
- Move Spacecraft struct from maneuver.h to spacecraft.h
- Add spacecraft array to SimulationState (spacecraft, craft_count, max_craft)
- Remove separate SpacecraftState struct and related functions
- Update create_simulation() to require max_craft parameter
- Move spacecraft update logic into update_simulation()
- Make load_spacecraft_config() internal helper, called by load_system_config()
- Update all test files to use new API with 3-parameter create_simulation()
- Handle max_craft=0 case gracefully (no spacecraft allocation)
Test results: 26/27 passing (1 pre-existing SOI test unrelated to changes)
Remove complex hysteresis logic and implement simple SOI-based
parent switching: bodies stay with current parent while within its SOI,
and switch to closest body whose SOI contains them when exiting.
This eliminates unnecessary N-body comparisons when inside current
parent's SOI, preventing unphysical transitions (e.g., Moon→Mars
while still in Earth's SOI).
Simplified logic:
- Within parent's SOI → STAY with current parent
- Outside parent's SOI → FIND new parent (closest body whose SOI contains us)
- If no SOI contains us → fall back to Sun (index 0)
This matches simple 2-body simulation model and makes the code
much clearer and more maintainable.
Note: SOI transition test temporarily expects hysteresis behavior
and will need to be updated in follow-up commit.
Modified find_dominant_body() to detect when bodies exit SOI by checking
distance against current parent's SOI radius. Applies different hysteresis:
- Inside SOI: 0.5x distance threshold prevents oscillations
- Outside SOI: switches to closest body without hysteresis
Added test requirement for Mars SOI exit detection.
Claude
- Create soi_transition.toml with Sun + Mars + SmallBody (3 bodies)
- Add test_soi_transition.cpp with 2 test cases:
* SOI transition from Sun to Mars (validates one-way transition)
* SOI radii calculation verification
- Use comet parameters (e=0.7, a=3.74e11) for Mars encounter
- Document hysteresis makes Mars -> Sun exit impossible
- Simpler than original 7-body test_comet_orbit.cpp
- All 3 SOI tests pass (12 assertions total)
Claude