Skip to content

Exception Hierarchy

exceptions

Custom exception hierarchy and domain errors for ctrlpy.

CtrlPyError

Bases: Exception

Base exception class for all ctrlpy domain errors.

Source code in src/ctrlpy/exceptions.py
class CtrlPyError(Exception):
    """Base exception class for all ctrlpy domain errors."""

DimensionMismatchError

Bases: CtrlPyError, ValueError

Exception raised when system matrix or vector dimensions are incompatible.

Source code in src/ctrlpy/exceptions.py
class DimensionMismatchError(CtrlPyError, ValueError):
    """Exception raised when system matrix or vector dimensions are incompatible."""

UnstableSystemError

Bases: CtrlPyError

Exception raised when an operation is invalid for an unstable system.

For example, steady-state metrics, settling time, or overshoot calculations are not well-defined for systems with poles in the Right Half Plane (Re(p) > 0).

Source code in src/ctrlpy/exceptions.py
class UnstableSystemError(CtrlPyError):
    """Exception raised when an operation is invalid for an unstable system.

    For example, steady-state metrics, settling time, or overshoot calculations
    are not well-defined for systems with poles in the Right Half Plane (Re(p) > 0).
    """

UnstableSystemWarning

Bases: UserWarning

Warning emitted when an operation may be problematic for an unstable system.

Source code in src/ctrlpy/exceptions.py
class UnstableSystemWarning(UserWarning):
    """Warning emitted when an operation may be problematic for an unstable system."""