Skip to content

Commit 8af308b

Browse files
committed
ENH: zero inertia check on rocket initialization (issue #826)
- ENH adding a small check to avoid singularity of inertia input in rocket class
1 parent 5b625a8 commit 8af308b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

rocketpy/rocket/rocket.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,12 @@ def __init__( # pylint: disable=too-many-statements
294294
self.I_13_without_motor = inertia[4]
295295
self.I_23_without_motor = inertia[5]
296296

297+
# Initial Inertia Tensor determinant singularity check
298+
if abs(inertia) == 0:
299+
raise ValueError(
300+
"The rocket inertia tensor is singular (determinant is zero). "
301+
)
302+
297303
# Define rocket geometrical parameters in SI units
298304
self.center_of_mass_without_motor = center_of_mass_without_motor
299305
self.radius = radius

0 commit comments

Comments
 (0)