Source code for rocketpy.exceptions
"""Custom exceptions and warnings for RocketPy."""
[docs]
class RocketPyError(Exception):
"""Base class for all RocketPy exceptions."""
[docs]
class InvalidParameterError(RocketPyError, ValueError):
"""Raised when a constructor parameter has an invalid value (e.g. negative
radius or mass)."""
[docs]
class InvalidInertiaError(RocketPyError, ValueError):
"""Raised when the inertia tuple/list does not have the expected length."""
[docs]
class UnstableRocketWarning(UserWarning):
"""Issued when the rocket's static margin is negative at motor ignition,
indicating an aerodynamically unstable configuration.
Not issued when the rocket has any ``GenericSurface`` aerodynamic
surfaces, since their lift coefficient derivative is not accounted for
in the center of pressure calculation, making the static margin
unreliable for this check in that case.
"""