You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.3 KiB
1.3 KiB
Refactor Orbital Elements Session (2026-01-04)
Changes Made
Refactored orbital elements calculation from test-specific to reusable code:
- Moved
OrbitalElementsstruct from test file tosrc/simulation.h - Moved
calculate_orbital_elements()function tosrc/simulation.cpp - Created
tests/test_comet_orbit.cppwith SOI transition tracking - Added
ParentChangetracking to detect when comet switches gravitational parent - Removed
tests/test_soi_transitions.cpp(not useful for detecting actual transitions) - Updated Makefile to include new test file
Commits
0e2f9ddRefactor orbital elements to reusable code and track SOI transitions
Results
4 files changed, +225/-1 (net +224 lines)
Orbital elements calculation is now reusable across the codebase. Test properly tracks parent index changes, though current configuration shows comet misses Mars's SOI by ~0.0004 AU (likely due to 60s time step granularity).
Outstanding Issue
Test fails to reproduce manual debugging results. Manual debugging showed parent_index changing to 2 (Mars) at sim->time ≈ 133914000s (~1550 days), but automated test detects no parent changes. Closest approach in test: 0.004200 AU, Mars SOI: ~0.00379 AU. Discrepancy may be due to time step granularity (60s), different initial conditions, or timing of SOI calculations. Requires further investigation.