Skip to content

BUG: rocket with a late-starting thrust curve never leaves the rail (#411)#1085

Open
wuisabel-gif wants to merge 2 commits into
RocketPy-Team:developfrom
wuisabel-gif:bug/rail-takeoff-delayed-thrust
Open

BUG: rocket with a late-starting thrust curve never leaves the rail (#411)#1085
wuisabel-gif wants to merge 2 commits into
RocketPy-Team:developfrom
wuisabel-gif:bug/rail-takeoff-delayed-thrust

Conversation

@wuisabel-gif

Copy link
Copy Markdown

Pull request type

  • Code changes (bugfix, features)

Checklist

  • Tests for the changes have been added (regression test fails without the fix, passes with it)
  • Lint passes locally (ruff check, ruff format --check; pylint 10/10 on the touched file)
  • Affected flight tests pass locally (tests/unit/simulation/test_flight.py, 56 passed)
  • CHANGELOG.md updated

Current 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) with out_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 at t=0 the rocket is stationary, so LSODA — whose max_step defaults to inf — takes one huge step that jumps clean over the burn. The thrust is never sampled and the rocket never accelerates. A normal motor accelerates at t=0, forcing small steps, so it only bites for late-starting curves.

Minimal repro (same rocket and total impulse, only the start time differs):

[thrust starts t=0] out_of_rail_t=0.329  apogee=10329 m
[thrust starts t=8] out_of_rail_t=0.000  apogee=0 m   <- never leaves the pad

New behavior

__setup_phase_time_nodes now forces a solver time node at the motor's ignition and burn-out whenever burn_start_time > 0, so the burn is always sampled. With the fix the delayed case flies identically to the t=0 case, just shifted:

[thrust starts t=8] out_of_rail_t=8.329  apogee=10329 m

The change is guarded to burn_start_time > 0, so ordinary motors (which ignite at t=0) hit none of the new code and are byte-for-byte unaffected — confirmed by the unchanged t=0 result above and the existing flight tests staying green.

Breaking change

  • No

Additional information

Adds test_flight_with_delayed_burn_leaves_rail in tests/integration/simulation/test_flight.py; it asserts a burn_time=(8, 20) rocket leaves the rail after ignition and reaches altitude. It fails on develop and passes with this change.

Closes #411

@wuisabel-gif
wuisabel-gif requested a review from a team as a code owner July 22, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant