ENH: Zero Inertia tensor Check
Maintainer thường phản hồi trong vòng 3 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Is your feature request related to a problem? Please describe.
Previously, users could accidentally set the rocket's dry inertia tensor to a zero vector or otherwise singular configuration. This led to runtime errors during simulation, typically manifesting as RuntimeWarning: divide by zero encountered in scalar divide and subsequent integration failures in the ODE solver.
Describe the solution you'd like
The dry inertia tensor should be validated as soon as the Rocket object is initialized. Specifically:
-
Construct the 3×3 inertia matrix from user-provided I_ij values in Rocket.init.
-
Immediately compute its determinant.
-
Raise a clear ValueError if the determinant is zero (i.e., the tensor is singular), with a helpful message prompting users to provide physically realistic values.
-
This approach shifts error detection earlier in the development cycle, prevents invalid configurations from reaching the solver, and gives users a precise explanation of what's wrong.
-
No changes are made to motor or dynamic inertia evaluation. Only the dry inertia (which is static and available at init) is validated.
Additional context
-
This change improves usability and safety, especially for multi-stage and upper-stage configurations where users often define placeholder or dummy inertia values.
-
It avoids obscure integration failures and makes RocketPy more robust to user error.
-
The solution avoids invasive structural changes by operating entirely within the Rocket class and leveraging existing Matrix functionality.
Future extensions could optionally introduce runtime checks for singular dynamic inertias (e.g., in u_dot_generalized), but this patch focuses only on validating static dry inertia at creation time. For dynamic inertia evaluation a debug_inertia_check can be implemented as optional boolean flag added to the Flight class to catch near-singular total inertia tensors during simulation. When enabled, it performs a lightweight determinant check on the dynamically evaluated total inertia matrix at each time step. If the determinant falls below a safe threshold, a clear error is raised indicating potential instability due to ill-conditioned inertial properties. This helps users catch modeling or configuration issues in motor or mass properties that may otherwise cause silent solver failures. The feature is off by default to avoid performance overhead in production runs.
- Ngôn ngữ chính
- Python
- Star
- 1.1k
- Fork
- 280
- Merge trung bình
- 3 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 24
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của RocketPy-Team/RocketPy
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
RocketPy-Team/RocketPy#1255 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
RocketPy-Team/RocketPy#1241 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
RocketPy-Team/RocketPy#1202 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Monte Carlo test fixtures write their logs into the working directoryCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
RocketPy-Team/RocketPy#1189 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
RocketPy-Team/RocketPy#1171 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của RocketPy-Team/RocketPy
Issue tương tự
-
docs(contributing): the two things that silently block a PRCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởavailable documentation good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 95/100
Nixitov/Riptide-Native#944 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
JTHCode/secretguard#24 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: middleware documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainer thường phản hồi trong vòng 1 ngày