Repository navigation
BUG: the rocket does not take off the rail #411
Description
Activity
I think it's not a good idea to start the simulation with a initial_time different of t=0.
Otherwise, we would lose some insights in the flight, for example, the "apogee_time" would become the flight time plus the time until ignition starts. This would be a bit confusing I guess.It's better to adjust the thrust curve to always start at 0, probably.
I'm open to discussions anyway
This bug happens to me frequently even when the thrust curve starts with 0. The way I fix it is the same as suggested (changing the maxTimeStep to 0.1) as shown in the screenshot
The simulations of this screenshot had a thrust curve that starts like this
In Monte Carlo simulations this also happens sometimes, usually when the standard deviation of the burn time is too high. To correct the dispersion analysis, I have to reduce the standard deviation.
Reacted by duda and Gui- addedFlightFlight Class related featuresFlight Class related features
on Oct 30, 2023 I've encountered the same error when trying to simulate a low-powered rocket, but this time, even after setting the maxTimeStep to 0.1, it only partially mitigated the issue, as I still encounter the following error:
"
File c:\Users....conda\lib\site-packages\numpy\lib\function_base.py:630, in asarray_chkfinite(a, dtype, order)
628 a = asarray(a, dtype=dtype, order=order)
629 if a.dtype.char in typecodes['AllFloat'] and not np.isfinite(a).all():
--> 630 raise ValueError(
631 "array must not contain infs or NaNs")
632 return aValueError: array must not contain infs or NaNs
"Additionally, the original issue of the rocket failing to leave the rail persists in Monte Carlo simulations, even with a very low standard deviation for all parameters.
I've encountered the same error when trying to simulate a low-powered rocket, but this time, even after setting the maxTimeStep to 0.1, it only partially mitigated the issue, as I still encounter the following error:
" File c:\Users....conda\lib\site-packages\numpy\lib\function_base.py:630, in asarray_chkfinite(a, dtype, order) 628 a = asarray(a, dtype=dtype, order=order) 629 if a.dtype.char in typecodes['AllFloat'] and not np.isfinite(a).all(): --> 630 raise ValueError( 631 "array must not contain infs or NaNs") 632 return a
ValueError: array must not contain infs or NaNs "
Additionally, the original issue of the rocket failing to leave the rail persists in Monte Carlo simulations, even with a very low standard deviation for all parameters.
Hello @Exsthain ,
The error you have indicated is being raised from numpy. Without a context, it is impossible to understand what generated the error in first place, nor reproduce it.
Have you tried to set an even smaller
max_time_step?My recommendation is for you to debug the code focusing on the
u_dot_rail1method.Hey @Gui-FernandesBR , I was looking into this issue and noticed that
burn_start_timeis never added as a flight phase boundary. Withmax_time_step=np.inf, the integrator can skip right over the burn window without ever "seeing" the thrust. I was thinking the cleanest fix would be to add a phase atburn_start_timewhen it's greater thant_initial, so the solver is forced to stop there and restart. From that point on, with non-zero thrust, the adaptive integrator handles the rest naturally. Do you think that's the right direction, or do you prefer changing the defaultmax_time_stepto something like0.1? The phase boundary approach feels less invasive since it doesn't affect performance for motors that start at t=0.Hey @Gui-FernandesBR , I was looking into this issue and noticed that
burn_start_timeis never added as a flight phase boundary. Withmax_time_step=np.inf, the integrator can skip right over the burn window without ever "seeing" the thrust. I was thinking the cleanest fix would be to add a phase atburn_start_timewhen it's greater thant_initial, so the solver is forced to stop there and restart. From that point on, with non-zero thrust, the adaptive integrator handles the rest naturally. Do you think that's the right direction, or do you prefer changing the defaultmax_time_stepto something like0.1? The phase boundary approach feels less invasive since it doesn't affect performance for motors that start at t=0.yes I think that's in the right direction! If you could ensure all the tests passing after your modifications, feel free to raise a PR. I will be glad reviewing it :)
Reacted by Yuri de CastroConfirmed this still reproduces on
develop, and I have a fix — will open a PR shortly.Minimal repro (same rocket and total impulse, only the thrust curve's start time differs):
[thrust starts t=0] out_of_rail_t=0.329 out_of_rail_v=23.96 apogee=10329 m [thrust starts t=8] out_of_rail_t=0.000 out_of_rail_v=0.00 apogee=0 m <- never leaves the padRoot cause (matches your original diagnosis): the rail phase's only time nodes are
[t=0, max_time]. With no thrust at t=0 the rocket is stationary, so LSODA (max_stepdefaults toinf) takes one huge step that jumps clean over the t=8 burn — the thrust is never sampled and the rocket never lifts off.Fix: force a solver time node at the motor's ignition and burn-out whenever
burn_start_time > 0, so the burn is always sampled. Guarded to late-starting motors, so ordinary motors (burn_start_time == 0) are byte-for-byte unaffected. With the fix the delayed case flies identically to the t=0 case, just shifted:out_of_rail_t=8.329,apogee=10329 m.- added a commit that references this issue
on Aug 8, 2026 This was fixed on `develop` by #1085 (`335834d8`). Late-starting thrust curves (e.g. `burn_time=(8, 20)`) should leave the rail correctly now. Please close if you can still reproduce on current `develop`.
- linked a pull request that will close this issueBUG: rocket with a late-starting thrust curve never leaves the rail (#411) #1085
on Aug 11, 2026 This was fixed on
developby #1085 (335834d8). Late-starting thrust curves (e.g.burn_time=(8, 20)) should leave the rail correctly now. Please close if you can still reproduce on currentdevelop.true
- added a commit that references this issue
on Sep 19, 2026
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsBacklog


Describe the bug
To Reproduce
Try to follow the code block below. You're gonna see that the rocket never leaves the position (0, 0, 0).
Expected behavior
A description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Some warning are also generated due to this BUG, for example:
Possible solutions:
While discussing this internally, we came up with some suggestions:
max_time_stepas 0.1 *burn_duration, for example, to ensure that any simulation will have at least 10 steps.max_time_stepcould now be set to 0.1 instead ofnp.inf