BUG: fin_flutter_analysis raises ValueError for a flight without wind
維護者通常 3 天內回覆
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 25/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- numpy, python
- 領域
- backend, testing-qa
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- Python
- 星號
- 1.1k
- 分支
- 280
- 平均合併
- 3 天 2 小時
- 30 天內合併 PR
- 24
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
RocketPy-Team/RocketPy 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
RocketPy-Team/RocketPy#1255 ·
維護者通常 3 天內回覆
-
難度 1/5 1 小時以內 新手友好度 92/100
RocketPy-Team/RocketPy#1241 ·
維護者通常 3 天內回覆
-
難度 2/5 1-3 小時 新手友好度 84/100
RocketPy-Team/RocketPy#1202 ·
維護者通常 3 天內回覆
-
Monte Carlo test fixtures write their logs into the working directory可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
RocketPy-Team/RocketPy#1189 ·
維護者通常 3 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
RocketPy-Team/RocketPy#1171 · 1 則留言 ·
維護者通常 3 天內回覆
查看 RocketPy-Team/RocketPy 的全部 Issue
相似的 Issue
-
docs(contributing): the two things that silently block a PR可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉available documentation good first issue
難度 1/5 1-3 小時 新手友好度 95/100
Nixitov/Riptide-Native#944 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 88/100
JTHCode/secretguard#24 ·
維護者通常 1 天內回覆
-
area: middleware documentation good first issue
難度 2/5 1-3 小時 新手友好度 88/100
-
enhancement good first issue
難度 2/5 1-3 小時 新手友好度 88/100
維護者通常 1 天內回覆
-
good first issue
難度 1/5 1 小時以內 新手友好度 95/100
omarelshamy25x/shamy-hijri#63 ·
維護者通常 1 天內回覆