8000 update use/computation of sys._isstatic() · python-control/python-control@d99ac61 · GitHub
[go: up one dir, main page]

Skip to content

Commit d99ac61

Browse files
committed
update use/computation of sys._isstatic()
1 parent 2cb0520 commit d99ac61

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
@@ -1668,7 +1668,7 @@ def ufun(t):
16681668
return U[..., idx-1] * (1. - dt) + U[..., idx] * dt
16691669

16701670
# Check to make sure this is not a static function
1671-
if nstates == 0: # No states => map input to output
1671+
if sys._isstatic():
16721672
# Make sure the user gave a time vector for evaluation (or 'T')
16731673
if t_eval is None:
16741674
# 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
@@ -225,6 +225,7 @@ def __init__(self, *args, **kwargs):
225225
break
226226
if not static:
227227
break
228+
self._static = static
228229

229230
defaults = args[0] if len(args) == 1 else \
230231
{'inputs': num.shape[1], 'outputs': num.shape[0]}
@@ -1279,12 +1280,8 @@ def _isstatic(self):
12791280
"""returns True if and only if all of the numerator and denominator
12801281
polynomials of the (possibly MIMO) transfer function are zeroth order,
12811282
that is, if the system has no dynamics. """
1282-
for list_of_polys in self.num, self.den:
1283-
for row in list_of_polys:
1284-
for poly in row:
1285-
if len(poly) > 1:
1286-
return False
1287-
return True
1283+
# Check done at initialization
1284+
return self._static
12881285

12891286
# Attributes for differentiation and delay
12901287
#

0 commit comments

Comments
 (0)
0