Record implementation decisions for patched conics
Decisions made:
1. Hysteresis: Adaptive approach (Option B) - prevents oscillation while enabling round-trips
2. Integration timing: Current approach (Option A) - defer half-step optimization to future TODO
3. Test priorities: Create all 3 test cases first - expect failures for unimplemented features
4. Adaptive timesteps: Deferred to later work - focus on SOI transitions first
Updated plan with:
- Decisions Made section documenting all 4 choices
- Updated implementation phases with decisions
- Updated timeline and success criteria
- Marked Phase 5 as deferred
- Ready to begin Phase 1 implementation
**Context:** The 0.5x hysteresis factor prevents oscillation but creates one-way barriers.
## Decisions Made
**Options:**
- **Option A:** Remove hysteresis entirely
- Pros: Simple, enables all transitions
- Cons: May cause oscillation at SOI boundaries
### Decision 1: Hysteresis Strategy ✅
**Chosen:** Option B - Adaptive hysteresis approach
- **Option B:** Adaptive hysteresis (recommended)
- Pros: Prevents oscillation while enabling round-trips
- Cons: More complex logic
**Rationale:**
- Prevents oscillation while enabling round-trips
- Maintains stability during normal operation
- Allows free switching when outside current SOI
- Best balance between stability and flexibility
**Recommendation:** Option B - keep stability while enabling your use case
**Decision needed:** Which approach should we implement?
**Implementation:** Will use adaptive hysteresis in Phase 2 (lines 70-75 in simulation.cpp)
---
### Question 2: Integration Timing
**Context:** Transition happens before integration in the same timestep, using coordinates from the end of the previous timestep. This may cause velocity discontinuities.
**Options:**
- **Option A:** Keep current approach (transition at start of timestep)
- Pros: Simple, works for most cases
- Cons: May have slight velocity discontinuities
### Decision 2: Integration Timing ✅
**Chosen:** Option A - Keep current approach (transition at start of timestep)
- **Option B:** Transition in middle of timestep (half-step approach)
- Pros: Better accuracy, smoother transitions
- Cons: More complex, requires half-step RK4
**Rationale:**
- Simple, works for most cases
- Start with proven approach
- Defer optimization to future work
- **Option C:** Transition after integration, then integrate again
- Pros: Ensures continuity
- Cons: Doubles computation, complex
**Recommendation:** Start with Option A, move to Option B if needed
**Decision needed:** Should we implement half-step transitions for better accuracy?
**TODO:** Consider half-step transitions (Option B) if velocity discontinuities become problematic
---
### Question 3: Test Priorities
**Context:** We have three test scenarios to validate patched conics.
**Options:**
- **Option A:** Start with "Satellite Rendezvous" (Earth→Moon→Earth)
- Pros: Simpler, 2-body transition, quick to implement
- Cons: Doesn't test root body transitions
- **Option B:** Start with "Interplanetary Transfer" (Earth→Sun→Mars)
- Pros: Tests root body transitions, realistic scenario
- Cons: More complex, longer simulation time
### Decision 3: Test Priorities ✅
**Chosen:** Option C - Implement all three test cases first
- **Option C:** Implement all three in parallel
- Pros: Comprehensive coverage
- Cons: More work upfront
**Rationale:**
- Create all test configurations upfront
- Expect failures for unimplemented features
- Use tests as validation throughout implementation
- Comprehensive coverage from the start
**Recommendation:** Option A first, then Option B, then Option C
**Implementation:**
1. Create all three test configs (Phase 4)
2. Run tests to establish baseline failures
3. Implement features to make tests pass
4. Re-run tests after each phase
**Decision needed:** Which test scenario should we start with?
**Test scenarios:**
- Satellite Rendezvous (Earth→Moon→Earth)
- Interplanetary Transfer (Earth→Sun→Mars)
- Moon Capture (Sun→Jupiter→Ganymede→Sun)
---
### Question 4: Adaptive Timesteps Priority
**Context:** Fixed 60s timestep may be suboptimal for different orbital phases.
**Options:**
- **Option A:** Implement adaptive timesteps now
- Pros: Better accuracy and performance from the start
- Cons: Adds complexity, may delay other features
### Decision 4: Adaptive Timesteps Priority ✅
**Chosen:** Option B - Defer to later work
- **Option B:** Use fixed timesteps for now, optimize later
- Pros: Simpler implementation, focus on transitions first
- Cons: May need to revisit later
**Rationale:**
- Focus on SOI transitions first
- Fixed 60s timestep works adequately for testing
- Optimize performance and accuracy after core features complete
**Recommendation:** Option B - get transitions working first, then optimize
**Decision needed:** Is adaptive timestepping critical for your use case?
**TODO:** Implement adaptive timesteps in future update (Phase 5)
- Will address: Too coarse for fast orbits, too slow for deep space