BUG: fin_flutter_analysis raises ValueError for a flight without wind
Maintainer antworten meist innerhalb von 3 Tagen
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- numpy, python
- Bereich
- backend, testing-qa
Rechercherichtung
Start with fin_flutter_analysis in rocketpy.utilities and trace how zero Mach values produce invalid safety factors and reach the spline fit. Check the existing tests that use flight_calisto_custom_wind and flight_calisto_robust; done means windless flights no longer raise and zero Mach points are excluded, as the issue describes. The author says a fix with tests is ready, so check for work already underway before starting.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Describe the bug
fin_flutter_analysis raises ValueError: array must not contain infs or NaNs for a flight without wind, which includes the default standard atmosphere. Without wind the Mach number is exactly 0 until liftoff, so flutter_mach / flight.mach_number divides by zero. Function replaces the resulting inf with about 1.8e308 (np.nan_to_num), and the spline fit then overflows.
To Reproduce
from rocketpy import Environment, Flight, GenericMotor, Rocket
from rocketpy.utilities import fin_flutter_analysis
env = Environment()
motor = GenericMotor(
thrust_source=1500,
burn_time=3,
chamber_radius=0.04,
chamber_height=0.5,
chamber_position=0,
propellant_initial_mass=2,
nozzle_radius=0.03,
)
rocket = Rocket(
radius=0.05,
mass=10,
inertia=(5, 5, 0.03),
power_off_drag=0.4,
power_on_drag=0.4,
center_of_mass_without_motor=0,
)
rocket.add_motor(motor, position=-0.8)
rocket.add_nose(length=0.4, kind="vonKarman", position=1)
rocket.add_trapezoidal_fins(
n=4, root_chord=0.15, tip_chord=0.06, span=0.1, position=-0.85
)
flight = Flight(rocket=rocket, environment=env, rail_length=5)
fin_flutter_analysis(
fin_thickness=0.003, shear_modulus=2.6e9, flight=flight, see_graphs=False
)
ValueError: array must not contain infs or NaNs
It happens on develop (d3cf83a7) and v1.13.0. With env.set_atmospheric_model(type="custom_atmosphere", wind_u=3) the same script runs and prints a minimum safety factor of 0.844.
Expected behavior
The same analysis as with wind. The safety factor has no value while the Mach number is 0, so I'd leave those points out.
Additional context
The existing tests don't catch it because they all use a flight with wind (flight_calisto_custom_wind). With the windless flight_calisto_robust, the function raises the same error.
I have a fix with tests ready and will open a PR.
- Vorherrschende Sprache
- Python
- Sterne
- 1.1k
- Forks
- 280
- Ø Merge
- 3 T. 2 Std.
- Gemergte PRs (30 T.)
- 24
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus RocketPy-Team/RocketPy
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
RocketPy-Team/RocketPy#1255 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
RocketPy-Team/RocketPy#1241 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
RocketPy-Team/RocketPy#1202 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Monte Carlo test fixtures write their logs into the working directoryEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
RocketPy-Team/RocketPy#1189 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
RocketPy-Team/RocketPy#1171 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 3 Tagen
Alle Issues in RocketPy-Team/RocketPy
Ähnliche Issues
-
docs(contributing): the two things that silently block a PREvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenavailable documentation good first issue
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 95/100
Nixitov/Riptide-Native#944 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
JTHCode/secretguard#24 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: middleware documentation good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
good first issue
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainer antworten meist innerhalb von 1 Tag