Skip to content

Commit b9ba9ae

Browse files
committed
update use/computation of sys._isstatic()
1 parent f73e893 commit b9ba9ae

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

control/nlsys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,7 @@ def ufun(t):
17121712
return U[..., idx-1] * (1. - dt) + U[..., idx] * dt
17131713

17141714
# Check to make sure this is not a static function
1715-
if nstates == 0: # No states => map input to output
1715+
if sys._isstatic():
17161716
# Make sure the user gave a time vector for evaluation (or 'T')
17171717
if t_eval is None:
17181718
# User overrode t_eval with None, but didn't give us the times...

control/xferfcn.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ def __init__(self, *args, **kwargs):
228228
break
229229
if not static:
230230
break
231+
self._static = static
231232

232233
defaults = args[0] if len(args) == 1 else \
233234
{'inputs': num.shape[1], 'outputs': num.shape[0]}
@@ -1287,12 +1288,8 @@ def _isstatic(self):
12871288
"""returns True if and only if all of the numerator and denominator
12881289
polynomials of the (possibly MIMO) transfer function are zeroth order,
12891290
that is, if the system has no dynamics. """
1290-
for list_of_polys in self.num, self.den:
1291-
for row in list_of_polys:
1292-
for poly_ in row:
1293-
if len(poly_) > 1:
1294-
return False
1295-
return True
1291+
# Check done at initialization
1292+
return self._static
12961293

12971294
# Attributes for differentiation and delay
12981295
#

0 commit comments

Comments
 (0)