@@ -1479,9 +1479,38 @@ def __init__(self, io_sys, ss_sys=None, connection_type=None):
14791479 outputs = io_sys .output_labels , states = io_sys .state_labels ,
14801480 params = io_sys .params , remove_useless_states = False )
14811481
1482- # Use StateSpace.__call__ to evaluate at a given complex value
1483- def __call__ (self , * args , ** kwargs ):
1484- return StateSpace .__call__ (self , * args , ** kwargs )
1482+ # Use StateSpace.__call__ to evaluate at a given complex value
1483+ def __call__ (self , * args , ** kwargs ):
1484+ return StateSpace .__call__ (self , * args , ** kwargs )
1485+
1486+ def __str__ (self ):
1487+ string = InterconnectedSystem .__str__ (self ) + "\n "
1488+ string += "\n \n " .join ([
1489+ "{} = {}" .format (Mvar ,
1490+ "\n " .join (str (M ).splitlines ()))
1491+ for Mvar , M in zip (["A" , "B" , "C" , "D" ],
1492+ [self .A , self .B , self .C , self .D ])])
1493+ return string
1494+
1495+ # Use InputOutputSystem repr for 'eval' since we can't recreate structure
1496+ # (without this, StateSpace._repr_eval_ gets used...)
1497+ def _repr_eval_ (self ):
1498+ return InputOutputSystem ._repr_eval_ (self )
1499+
1500+ def _repr_html_ (self ):
1501+ syssize = self .nstates + max (self .noutputs , self .ninputs )
1502+ if syssize > config .defaults ['statesp.latex_maxsize' ]:
1503+ return None
1504+ elif config .defaults ['statesp.latex_repr_type' ] == 'partitioned' :
1505+ return InterconnectedSystem ._repr_info_ (self , html = True ) + \
1506+ "\n " + StateSpace ._latex_partitioned (self )
1507+ elif config .defaults ['statesp.latex_repr_type' ] == 'separate' :
1508+ return InterconnectedSystem ._repr_info_ (self , html = True ) + \
1509+ "\n " + StateSpace ._latex_separate (self )
1510+ else :
1511+ raise ValueError (
1512+ "Unknown statesp.latex_repr_type '{cfg}'" .format (
1513+ cfg = config .defaults ['statesp.latex_repr_type' ]))
14851514
14861515 # The following text needs to be replicated from StateSpace in order for
14871516 # this entry to show up properly in sphinx doccumentation (not sure why,
0 commit comments