@@ -142,8 +142,7 @@ def __init__(self, params=None, **kwargs):
142142
143143 """
144144 # Store the system name, inputs, outputs, and states
145- name , inputs , outputs , states , dt = _process_namedio_keywords (
146- kwargs )
145+ name , inputs , outputs , states , dt = _process_namedio_keywords (kwargs )
147146
148147 # Initialize the data structure
149148 # Note: don't use super() to override LinearIOSystem/StateSpace MRO
@@ -910,8 +909,7 @@ def __init__(self, syslist, connections=None, inplist=None, outlist=None,
910909 dt = kwargs .pop ('dt' , None )
911910
912911 # Process keyword arguments (except dt)
913- name , inputs , outputs , states , _ = _process_namedio_keywords (
914- kwargs , end = True )
912+ name , inputs , outputs , states , _ = _process_namedio_keywords (kwargs )
915913
916914 # Initialize the system list and index
917915 self .syslist = list (syslist ) # insure modifications can be made
@@ -1012,7 +1010,7 @@ def __init__(self, syslist, connections=None, inplist=None, outlist=None,
10121010 # Note: don't use super() to override LinearICSystem/StateSpace MRO
10131011 InputOutputSystem .__init__ (
10141012 self , inputs = inputs , outputs = outputs ,
1015- states = states , params = params , dt = dt , name = name )
1013+ states = states , params = params , dt = dt , name = name , ** kwargs )
10161014
10171015 # Convert the list of interconnections to a connection map (matrix)
10181016 self .connect_map = np .zeros ((ninputs , noutputs ))
@@ -1241,7 +1239,9 @@ def set_output_map(self, output_map):
12411239 ----------
12421240 output_map : 2D array
12431241 Specify the matrix that will be used to multiply the vector of
1244- subsystem outputs to obtain the vector of system outputs.
1242+ subsystem outputs concatenated with subsystem inputs to obtain
1243+ the vector of system outputs.
1244+
12451245 """
12461246 # Figure out the number of internal inputs and outputs
12471247 ninputs = sum (sys .ninputs for sys in self .syslist )
@@ -2552,7 +2552,7 @@ def interconnect(
25522552 signals are given names, then the forms 'sys.sig' or ('sys', 'sig')
25532553 are also recognized. Finally, for multivariable systems the signal
25542554 index can be given as a list, for example '(subsys_i, [inp_j1, ...,
2555- inp_jn])', as as a slice, for example, 'sys.sig[i:j]', or as a base
2555+ inp_jn])'; as a slice, for example, 'sys.sig[i:j]'; or as a base
25562556 name `sys.sig` (which matches `sys.sig[i]`).
25572557
25582558 Similarly, each output-spec should describe an output signal from
@@ -2715,7 +2715,7 @@ def interconnect(
27152715 ... [P, C], connections=[['P', 'C'], ['C', '-P']],
27162716 ... inplist=['C'], outlist=['P'])
27172717
2718- This feedback system can also be constructed using the
2718+ A feedback system can also be constructed using the
27192719 :func:`~control.summing_block` function and the ability to
27202720 automatically interconnect signals with the same names:
27212721
@@ -2734,7 +2734,7 @@ def interconnect(
27342734 default being to add the suffix '$copy' to the system name.
27352735
27362736 In addition to explicit lists of system signals, it is possible to
2737- lists vectors of signals, using one of the following forms:
2737+ lists vectors of signals, using one of the following forms::
27382738
27392739 (subsys, [i1, ..., iN], gain) signals with indices i1, ..., in
27402740 'sysname.signal[i:j]' range of signal names, i through j-1
@@ -2760,8 +2760,7 @@ def interconnect(
27602760
27612761 """
27622762 dt = kwargs .pop ('dt' , None ) # by pass normal 'dt' processing
2763- name , inputs , outputs , states , _ = _process_namedio_keywords (
2764- kwargs , end = True )
2763+ name , inputs , outputs , states , _ = _process_namedio_keywords (kwargs )
27652764
27662765 if not check_unused and (ignore_inputs or ignore_outputs ):
27672766 raise ValueError ('check_unused is False, but either '
@@ -3017,10 +3016,21 @@ def interconnect(
30173016 outlist , outputs = new_outlist , new_outputs
30183017 dprint (f" { outlist = } \n { outputs = } " )
30193018
3019+ # Make sure inputs and outputs match inplist outlist, if specified
3020+ if inputs and (
3021+ isinstance (inputs , (list , tuple )) and len (inputs ) != len (inplist )
3022+ or isinstance (inputs , int ) and inputs != len (inplist )):
3023+ raise ValueError ("`inputs` incompatible with `inplist`" )
3024+ if outputs and (
3025+ isinstance (outputs , (list , tuple )) and len (outputs ) != len (outlist )
3026+ or isinstance (outputs , int ) and outputs != len (outlist )):
3027+ raise ValueError ("`outputs` incompatible with `outlist`" )
3028+
30203029 newsys = InterconnectedSystem (
30213030 syslist , connections = connections , inplist = inplist ,
30223031 outlist = outlist , inputs = inputs , outputs = outputs , states = states ,
3023- params = params , dt = dt , name = name , warn_duplicate = warn_duplicate )
3032+ params = params , dt = dt , name = name , warn_duplicate = warn_duplicate ,
3033+ ** kwargs )
30243034
30253035 # See if we should add any signals
30263036 if add_unused :
@@ -3040,7 +3050,8 @@ def interconnect(
30403050 newsys = InterconnectedSystem (
30413051 syslist , connections = connections , inplist = inplist ,
30423052 outlist = outlist , inputs = inputs , outputs = outputs , states = states ,
3043- params = params , dt = dt , name = name , warn_duplicate = warn_duplicate )
3053+ params = params , dt = dt , name = name , warn_duplicate = warn_duplicate ,
3054+ ** kwargs )
30443055
30453056 # check for implicitly dropped signals
30463057 if check_unused :
0 commit comments