4949_iosys_defaults = {
5050 'iosys.state_name_delim' : '_' ,
5151 'iosys.duplicate_system_name_prefix' : '' ,
52- 'iosys.duplicate_system_name_suffix' : '$copy'
52+ 'iosys.duplicate_system_name_suffix' : '$copy' ,
53+ 'iosys.linearized_system_name_prefix' : '' ,
54+ 'iosys.linearized_system_name_suffix' : '$linearized'
5355}
5456
5557
@@ -570,7 +572,10 @@ def linearize(self, x0, u0, t=0, params={}, eps=1e-6,
570572 # Set the names the system, inputs, outputs, and states
571573 if copy :
572574 if name is None :
573- linsys .name = self .name + "_linearized"
575+ linsys .name = \
576+ config .defaults ['iosys.linearized_system_name_prefix' ] + \
577+ self .name + \
578+ config .defaults ['iosys.linearized_system_name_suffix' ]
574579 linsys .ninputs , linsys .input_index = self .ninputs , \
575580 self .input_index .copy ()
576581 linsys .noutputs , linsys .output_index = \
@@ -1781,9 +1786,13 @@ def linearize(sys, xeq, ueq=[], t=0, params={}, **kw):
17811786 the system name is set to the input system name with the string
17821787 '_linearized' appended.
17831788 name : string, optional
1784- Set the name of the linearized system. If not specified and if `copy`
1785- is `False`, a generic name <sys[id]> is generated with a unique
1786- integer id.
1789+ Set the name of the linearized system. If not specified and
1790+ if `copy` is `False`, a generic name <sys[id]> is generated
1791+ with a unique integer id. If `copy` is `True`, the new system
1792+ name is determined by adding the prefix and suffix strings in
1793+ config.defaults['iosys.linearized_system_name_prefix'] and
1794+ config.defaults['iosys.linearized_system_name_suffix'], with the
1795+ default being to add the suffix '$linearized'.
17871796
17881797 Returns
17891798 -------
@@ -1967,6 +1976,13 @@ def interconnect(syslist, connections=[], inplist=[], outlist=[],
19671976
19681977 Notes
19691978 -----
1979+ If a system is duplicated in the list of systems to be connected,
1980+ a warning is generated a copy of the system is created with the
1981+ name of the new system determined by adding the prefix and suffix
1982+ strings in config.defaults['iosys.linearized_system_name_prefix']
1983+ and config.defaults['iosys.linearized_system_name_suffix'], with the
1984+ default being to add the suffix '$copy'$ to the system name.
1985+
19701986 It is possible to replace lists in most of arguments with tuples instead,
19711987 but strictly speaking the only use of tuples should be in the
19721988 specification of an input- or output-signal via the tuple notation
@@ -1977,7 +1993,7 @@ def interconnect(syslist, connections=[], inplist=[], outlist=[],
19771993 In addition to its use for general nonlinear I/O systems, the
19781994 :func:`~control.interconnect` function allows linear systems to be
19791995 interconnected using named signals (compared with the
1980- :func:`~control.connect` function, which uses signal indicies ) and to be
1996+ :func:`~control.connect` function, which uses signal indices ) and to be
19811997 treated as both a :class:`~control.StateSpace` system as well as an
19821998 :class:`~control.InputOutputSystem`.
19831999
0 commit comments