BUG: rocket with a late-starting thrust curve never leaves the rail (#411)#1085
Open
wuisabel-gif wants to merge 2 commits into
Open
BUG: rocket with a late-starting thrust curve never leaves the rail (#411)#1085wuisabel-gif wants to merge 2 commits into
wuisabel-gif wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request type
Checklist
ruff check,ruff format --check; pylint 10/10 on the touched file)tests/unit/simulation/test_flight.py, 56 passed)CHANGELOG.mdupdatedCurrent behavior
Fixes #411. A motor whose thrust curve starts at
t > 0(e.g.burn_time=(8, 20)) never lifts the rocket off the rail — the flight stays at(0, 0, 0)without_of_rail_time == 0.Root cause (as the issue originally guessed): the rail phase's only time nodes are
[t=0, max_time]. With no thrust att=0the rocket is stationary, so LSODA — whosemax_stepdefaults toinf— takes one huge step that jumps clean over the burn. The thrust is never sampled and the rocket never accelerates. A normal motor accelerates att=0, forcing small steps, so it only bites for late-starting curves.Minimal repro (same rocket and total impulse, only the start time differs):
New behavior
__setup_phase_time_nodesnow forces a solver time node at the motor's ignition and burn-out wheneverburn_start_time > 0, so the burn is always sampled. With the fix the delayed case flies identically to thet=0case, just shifted:The change is guarded to
burn_start_time > 0, so ordinary motors (which ignite att=0) hit none of the new code and are byte-for-byte unaffected — confirmed by the unchangedt=0result above and the existing flight tests staying green.Breaking change
Additional information
Adds
test_flight_with_delayed_burn_leaves_railintests/integration/simulation/test_flight.py; it asserts aburn_time=(8, 20)rocket leaves the rail after ignition and reaches altitude. It fails ondevelopand passes with this change.Closes #411