Skip to content

Commit 86401d6

Browse files
sawyerbfullerbnavigator
authored andcommitted
set default dt to be 0 instead of None.
1 parent 578cfa6 commit 86401d6

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

control/statesp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@
7272
# Define module default parameter values
7373
_statesp_defaults = {
7474
'statesp.use_numpy_matrix': False, # False is default in 0.9.0 and above
75-
'statesp.default_dt': None,
75+
'statesp.default_dt': 0,
7676
'statesp.remove_useless_states': True,
77-
}
77+
}
7878

7979

8080
def _ssmatrix(data, axis=1):
@@ -974,7 +974,7 @@ def dcgain(self):
974974
return np.squeeze(gain)
975975

976976
def is_static_gain(self):
977-
"""True if and only if the system has no dynamics, that is,
977+
"""True if and only if the system has no dynamics, that is,
978978
if A and B are zero. """
979979
return not np.any(self.A) and not np.any(self.B)
980980

control/xferfcn.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171

7272
# Define module default parameter values
7373
_xferfcn_defaults = {
74-
'xferfcn.default_dt': None}
74+
'xferfcn.default_dt': 0}
7575

7676
class TransferFunction(LTI):
7777

@@ -1597,6 +1597,20 @@ def _clean_part(data):
15971597

15981598
return data
15991599

1600+
def _isstaticgain(num, den):
1601+
"""returns true if and only if all of the numerator and denominator
1602+
polynomials of the (possibly MIMO) transfer funnction are zeroth order,
1603+
that is, if the system has no dynamics. """
1604+
num, den = _clean_part(num), _clean_part(den)
1605+
for m in range(len(num)):
1606+
for n in range(len(num[m])):
1607+
if len(num[m][n]) > 1:
1608+
return False
1609+
for m in range(len(den)):
1610+
for n in range(len(den[m])):
1611+
if len(den[m][n]) > 1:
1612+
return False
1613+
return True
16001614

16011615
# Define constants to represent differentiation, unit delay
16021616
TransferFunction.s = TransferFunction([1, 0], [1], 0)

0 commit comments

Comments
 (0)