Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion rocketpy/simulation/flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,8 +1187,10 @@ def __handle_impact_event(self, phase, phase_index, node_index):
]
if len(valid_t_root) > 1: # pragma: no cover
raise ValueError("Multiple roots found when solving for impact time.")
# Fall back to t1 when noise places the crossing at the step boundary.
t_root_local = valid_t_root[0] if valid_t_root else t1
# Determine impact state at t_root
self.t = self.t_final = valid_t_root[0] + self.solution[-2][0]
self.t = self.t_final = t_root_local + self.solution[-2][0]
interpolator = phase.solver.dense_output()
self.y_sol = self.impact_state = interpolator(self.t)
# Roll back solution
Expand Down