BUG: fin_flutter_analysis raises ValueError for a flight without wind

Ouverte
#1,249 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 3 jours

@rundvd y travaille déjà.

Depuis le 1/12/2026.

  • #1250 par @rundvd — ouverte

É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

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de RocketPy-Team/RocketPy

Toutes les issues de RocketPy-Team/RocketPy

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.