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