7070
7171
7272# Define module default parameter values
73- _xferfcn_defaults = {
74- 'xferfcn.default_dt' : 0 }
73+ _xferfcn_defaults = {}
7574
7675class TransferFunction (LTI ):
7776
@@ -95,8 +94,8 @@ class TransferFunction(LTI):
9594 has a non-zero value, then it must match whenever two transfer functions
9695 are combined. If 'dt' is set to True, the system will be treated as a
9796 discrete time system with unspecified sampling time. The default value of
98- 'dt' is None and can be changed by changing the value of
99- ``control.config.defaults['xferfcn .default_dt']``.
97+ 'dt' is 0 and can be changed by changing the value of
98+ ``control.config.defaults['control .default_dt']``.
10099
101100 The TransferFunction class defines two constants ``s`` and ``z`` that
102101 represent the differentiation and delay operators in continuous and
@@ -127,8 +126,8 @@ def __init__(self, *args):
127126 (num , den ) = args
128127 if _isstaticgain (num , den ):
129128 dt = None
130- else :
131- dt = config .defaults ['xferfcn .default_dt' ]
129+ else :
130+ dt = config .defaults ['control .default_dt' ]
132131 elif len (args ) == 3 :
133132 # Discrete time transfer function
134133 (num , den , dt ) = args
@@ -146,8 +145,8 @@ def __init__(self, *args):
146145 except NameError : # pragma: no coverage
147146 if _isstaticgain (num , den ):
148147 dt = None
149- else :
150- dt = config .defaults ['xferfcn .default_dt' ]
148+ else :
149+ dt = config .defaults ['control .default_dt' ]
151150 else :
152151 raise ValueError ("Needs 1, 2 or 3 arguments; received %i."
153152 % len (args ))
@@ -421,7 +420,7 @@ def __mul__(self, other):
421420 outputs = self .outputs
422421
423422 dt = common_timebase (self .dt , other .dt )
424-
423+
425424 # Preallocate the numerator and denominator of the sum.
426425 num = [[[0 ] for j in range (inputs )] for i in range (outputs )]
427426 den = [[[1 ] for j in range (inputs )] for i in range (outputs )]
@@ -1083,16 +1082,16 @@ def _dcgain_cont(self):
10831082 return np .squeeze (gain )
10841083
10851084 def is_static_gain (self ):
1086- """returns True if and only if all of the numerator and denominator
1087- polynomials of the (possibly MIMO) transfer function are zeroth order,
1085+ """returns True if and only if all of the numerator and denominator
1086+ polynomials of the (possibly MIMO) transfer function are zeroth order,
10881087 that is, if the system has no dynamics. """
1089- for list_of_polys in self .num , self .den :
1088+ for list_of_polys in self .num , self .den :
10901089 for row in list_of_polys :
10911090 for poly in row :
1092- if len (poly ) > 1 :
1091+ if len (poly ) > 1 :
10931092 return False
10941093 return True
1095-
1094+
10961095# c2d function contributed by Benjamin White, Oct 2012
10971096def _c2d_matched (sysC , Ts ):
10981097 # Pole-zero match method of continuous to discrete time conversion
@@ -1566,15 +1565,15 @@ def _clean_part(data):
15661565 return data
15671566
15681567def _isstaticgain (num , den ):
1569- """returns True if and only if all of the numerator and denominator
1570- polynomials of the (possibly MIMO) transfer funnction are zeroth order,
1568+ """returns True if and only if all of the numerator and denominator
1569+ polynomials of the (possibly MIMO) transfer funnction are zeroth order,
15711570 that is, if the system has no dynamics. """
15721571 num , den = _clean_part (num ), _clean_part (den )
1573- for list_of_polys in num , den :
1572+ for list_of_polys in num , den :
15741573 for row in list_of_polys :
15751574 for poly in row :
15761575 poly_trimmed = np .trim_zeros (poly , 'f' ) # trim leading zeros
1577- if len (poly_trimmed ) > 1 :
1576+ if len (poly_trimmed ) > 1 :
15781577 return False
15791578 return True
15801579
0 commit comments