BUG: fin_flutter_analysis raises ValueError for a flight without wind
Mantenedores costumam responder em até 3 dias
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 25/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- numpy, python
- Domínio
- backend, testing-qa
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 1.1k
- Forks
- 280
- Merge médio
- 3d 2h
- PRs com merge (30d)
- 24
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de RocketPy-Team/RocketPy
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
RocketPy-Team/RocketPy#1255 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
RocketPy-Team/RocketPy#1241 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
RocketPy-Team/RocketPy#1202 ·
Mantenedores costumam responder em até 3 dias
-
Monte Carlo test fixtures write their logs into the working directoryTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
RocketPy-Team/RocketPy#1189 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
RocketPy-Team/RocketPy#1171 · 1 comentário ·
Mantenedores costumam responder em até 3 dias
Todas as issues de RocketPy-Team/RocketPy
Issues semelhantes
-
docs(contributing): the two things that silently block a PRTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertaavailable documentation good first issue
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 95/100
Nixitov/Riptide-Native#944 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
JTHCode/secretguard#24 ·
Mantenedores costumam responder em até 1 dia
-
area: middleware documentation good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
-
enhancement good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
-
good first issue
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 95/100
omarelshamy25x/shamy-hijri#63 ·
Mantenedores costumam responder em até 1 dia