49
49
_iosys_defaults = {
50
50
'iosys.state_name_delim' : '_' ,
51
51
'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'
53
55
}
54
56
55
57
@@ -570,7 +572,10 @@ def linearize(self, x0, u0, t=0, params={}, eps=1e-6,
570
572
# Set the names the system, inputs, outputs, and states
571
573
if copy :
572
574
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' ]
574
579
linsys .ninputs , linsys .input_index = self .ninputs , \
575
580
self .input_index .copy ()
576
581
linsys .noutputs , linsys .output_index = \
@@ -1781,9 +1786,13 @@ def linearize(sys, xeq, ueq=[], t=0, params={}, **kw):
1781
1786
the system name is set to the input system name with the string
1782
1787
'_linearized' appended.
1783
1788
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'.
1787
1796
1788
1797
Returns
1789
1798
-------
@@ -1967,6 +1976,13 @@ def interconnect(syslist, connections=[], inplist=[], outlist=[],
1967
1976
1968
1977
Notes
1969
1978
-----
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
+
1970
1986
It is possible to replace lists in most of arguments with tuples instead,
1971
1987
but strictly speaking the only use of tuples should be in the
1972
1988
specification of an input- or output-signal via the tuple notation
@@ -1977,7 +1993,7 @@ def interconnect(syslist, connections=[], inplist=[], outlist=[],
1977
1993
In addition to its use for general nonlinear I/O systems, the
1978
1994
:func:`~control.interconnect` function allows linear systems to be
1979
1995
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
1981
1997
treated as both a :class:`~control.StateSpace` system as well as an
1982
1998
:class:`~control.InputOutputSystem`.
1983
1999
0 commit comments