@@ -634,11 +634,11 @@ def __mul__(self, other):
634634 from .statesp import StateSpace
635635
636636 # Convert the second argument to a transfer function.
637- if isinstance (other , StateSpace ):
637+ if isinstance (other , ( StateSpace , np . ndarray ) ):
638638 other = _convert_to_transfer_function (other )
639- elif isinstance (other , (int , float , complex , np .number , np . ndarray )):
640- other = _convert_to_transfer_function ( other , inputs = self . ninputs ,
641- outputs = self .noutputs )
639+ elif isinstance (other , (int , float , complex , np .number )):
640+ # Multiply by a scaled identity matrix (transfer function)
641+ other = _convert_to_transfer_function ( np . eye ( self .ninputs ) * other )
642642 if not isinstance (other , TransferFunction ):
643643 return NotImplemented
644644
@@ -681,8 +681,8 @@ def __rmul__(self, other):
681681
682682 # Convert the second argument to a transfer function.
683683 if isinstance (other , (int , float , complex , np .number )):
684- other = _convert_to_transfer_function ( other , inputs = self . ninputs ,
685- outputs = self .ninputs )
684+ # Multiply by a scaled identity matrix (transfer function)
685+ other = _convert_to_transfer_function ( np . eye ( self .noutputs ) * other )
686686 else :
687687 other = _convert_to_transfer_function (other )
688688
@@ -723,9 +723,8 @@ def __truediv__(self, other):
723723 """Divide two LTI objects."""
724724
725725 if isinstance (other , (int , float , complex , np .number )):
726- other = _convert_to_transfer_function (
727- other , inputs = self .ninputs ,
728- outputs = self .ninputs )
726+ # Multiply by a scaled identity matrix (transfer function)
727+ other = _convert_to_transfer_function (np .eye (self .ninputs ) * other )
729728 else :
730729 other = _convert_to_transfer_function (other )
731730
0 commit comments