Repository navigation
Conversation
Without wind the Mach number is exactly 0 until liftoff, so the safety factor divided by zero and the spline fit raised a ValueError. Leave those points out. Just after liftoff the safety factor is very large and a spline through it oscillates below zero, so interpolate it with pchip. The values at the samples do not change.
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 --checkandpylintpass on the changed filestests/unitandtests/integration/simulationpass locallyCurrent behavior
Closes #1249.
fin_flutter_analysisraisesValueErrorfor a flight without wind, because the Mach number is 0 until liftoff and the safety factor divides by it.New behavior
The points where the Mach number is 0 are left out of the safety factor. The remaining values are unchanged, but the safety factor is now interpolated with
pchipinstead ofspline. Just after liftoff the values are so large that a spline oscillates: withflight_calisto_robustit reaches about -10,600, and it also goes negative between samples in a wind of 0.01 m/s.The new tests use
flight_calisto_robust, which has no wind. They compare the safety factor with the ratio of the two Mach numbers, check that the interpolated curve never goes below its lowest sample, and cover the prints and graphs. They fail ondevelop.Breaking change
With wind, the safety factor keeps its domain and its value at every sample, so the printed minimum doesn't change. Between samples it changes slightly: with
flight_calisto_custom_wind(5.4 m/s of wind), by at most 1.2% up to apogee and by 0.03% where the safety factor is below 6. The largest difference is in the second or so around main parachute deployment, where the spline dipped to about 7 between two samples of 19.5 and pchip stays at 19.5.Additional information
#1201 changes
_flutter_mach_numberin the same file. The branches merge without conflicts, and these tests don't depend on the flutter constant._flutter_safety_factornow reads the samples offlight.mach_number, so I changed the stub flight in #1201's test to use sampledFunctions instead of constant ones. With that, the tests intest_utilities.pypass with both changes applied.