Repository navigation
BUG: fix the tip-off phase and run it without a flag - #1217
Conversation
The line was too long for ruff format --check. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The phase from #920 now runs in every 6 DOF flight with the standard equations of motion whose two rail buttons start on the rail. The use_udot_rail2 flag is removed. - udot_rail2 is rewritten: same model, no closure, no numpy solve and no cache written by u_dot_generalized on every call. - Rail exits are found with brentq on the solver's dense output instead of one cubic fitted over the last step, which misplaced the exit on long steps and could raise "No valid roots found". - The accelerations reported inside the window are the constrained ones. - The lower rail button forces cover the window and are saved with the flight. - between_rails_* is renamed to tip_off_end_*, and tip_off_end_time is saved with the flight. - A parachute opening inside the window is no longer handed back to free flight, tip_off_duration is never negative, and a rail shorter than the nozzle to lower button distance skips the phase. - The on-rail button forces select their points by time, since flights with controllers store no post-processed point at event times. The tests compare the phase with an independent rigid-body model of a button sliding on the rail (pitch angle, pitch rate and button force). Pinned values that depend on the trajectory are re-baselined. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Removes the flag, corrects the sign of the r_CM x omega_dot terms after #1196, states the limits of the model (no friction, no contact between the rocket body and the rail), describes the outputs and adds a verification section with the reference of Peng et al. (2017). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
@Gui-FernandesBR this is a follow-up for the v1.14.0 release: it covers the Flight task of #1209 (the tip-off bugs in #920, the validation test and the rail-exit root finding), fixing the phase forward instead of reverting it. Two things to be aware of:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1217 +/- ##
========================================
Coverage 91.67% 91.68%
========================================
Files 131 131
Lines 18242 18221 -21
========================================
- Hits 16724 16706 -18
+ Misses 1518 1515 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| def distance_left(t): | ||
| x, y, z = interpolator(t)[:3] | ||
| return effective_rl**2 - (x**2 + y**2 + (z - elevation) ** 2) |
There was a problem hiding this comment.
this function will be defined at every single call, right? Maybe defining it outside of the main flight loop would save us some execution time, no?
There was a problem hiding this comment.
i ran a profiler on the code, this is not impacting simulation at all
Pull request type
Checklist
ruff,pylint) has passed locallypytest tests) have passed locallyCHANGELOG.md: no action needed here, see the note at the endWhat this is
This closes the Flight task of the v1.14.0 release checklist (#1209): "the 4 tip-off bugs in #920, a validation test against an independent ODE, rail-exit root finding". It fixes the tip-off phase from #920 (#28) instead of reverting it, as discussed in #1194.
Current behavior
The phase is on
developbehindFlight(use_udot_rail2=True), with these problems:tip_off_durationcan be negative, and a very short rail leaves the flight in the tip-off phase forever.New behavior
brentqon the solver's own interpolation of the step.rail_button2_normal_forceandrail_button2_shear_forcecover the window.between_rails_*is renamed totip_off_end_*.udot_rail2simplified, and the three event bugs above are fixed with regression tests.docs/technical/tip_off.rstupdated, including the limits of the model.Why always on
I want this to be the default with no switch:
use_udot_rail2is named after an internal method, was never released, and would have to be deprecated as soon as the phase became the default. Removing it now costs nothing.Effect on results
Every flight with two rail buttons changes: the rocket leaves the rail with a small nose-down pitch rate. Calisto on a 5.2 m rail, no wind, against the phase switched off:
At 85° this is the same as tilting the rail by about 0.2° (solid) or 0.4° (liquid, slower rail exit). Pinned values in
tests/unit/simulation/test_flight.pyare re-baselined; the acceptance tests against measured flights pass unchanged.Limits, stated in the docs: no rail friction, no contact between the rocket body and the rail, and no measured flight to compare against.
Breaking change
use_udot_rail2and thebetween_rails_*names exist only ondevelop. Simulation results change as described above.Additional information
use_udot_rail2throughStochasticFlight, tests it and names it in the changelog. Whichever PR merges second has to drop those lines.rocketpy/tools.pyis reformatted soruff format --checkpasses.master, not fixed here: the rail button forces with both buttons on the rail use a wrong lever arm and leave out the weight, and a rocket whose thrust starts below its weight never leaves the rail unlessmax_time_stepis set.Refs #1209, #1194, #920, #28.
🤖 Generated with Claude Code