BUG: fin_flutter_analysis raises ValueError for a flight without wind
Les mainteneurs répondent en général sous 3 jours
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 25/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- numpy, python
- Domaine
- backend, testing-qa
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Python
- Étoiles
- 1.1k
- Forks
- 280
- Merge moyen
- 3 j 2 h
- PR mergées (30 j)
- 24
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de RocketPy-Team/RocketPy
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
RocketPy-Team/RocketPy#1255 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
RocketPy-Team/RocketPy#1241 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
RocketPy-Team/RocketPy#1202 ·
Les mainteneurs répondent en général sous 3 jours
-
Monte Carlo test fixtures write their logs into the working directoryPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
RocketPy-Team/RocketPy#1189 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
RocketPy-Team/RocketPy#1171 · 1 commentaire ·
Les mainteneurs répondent en général sous 3 jours
Toutes les issues de RocketPy-Team/RocketPy
Issues similaires
-
docs(contributing): the two things that silently block a PRPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverteavailable documentation good first issue
Difficulté 1/5 1-3 heures Accessibilité débutants 95/100
Nixitov/Riptide-Native#944 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
JTHCode/secretguard#24 ·
Les mainteneurs répondent en général sous 1 jour
-
area: middleware documentation good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
enhancement good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 1 jour
-
good first issue
Difficulté 1/5 Moins d'une heure Accessibilité débutants 95/100
omarelshamy25x/shamy-hijri#63 ·
Les mainteneurs répondent en général sous 1 jour