@@ -181,7 +181,7 @@ def __call__(sys, u, params=None, squeeze=None):
181181
182182 """
183183 # Make sure the call makes sense
184- if not sys ._isstatic () :
184+ if sys .nstates != 0 :
185185 raise TypeError (
186186 "function evaluation is only supported for static "
187187 "input/output systems" )
@@ -199,7 +199,7 @@ def __call__(sys, u, params=None, squeeze=None):
199199 def __mul__ (self , other ):
200200 """Multiply two input/output systems (series interconnection)"""
201201 # Convert 'other' to an I/O system if needed
202- other = _convert_static_iosystem (other )
202+ other = _convert_to_iosystem (other )
203203 if not isinstance (other , InputOutputSystem ):
204204 return NotImplemented
205205
@@ -231,7 +231,7 @@ def __mul__(self, other):
231231 def __rmul__ (self , other ):
232232 """Pre-multiply an input/output systems by a scalar/matrix"""
233233 # Convert other to an I/O system if needed
234- other = _convert_static_iosystem (other )
234+ other = _convert_to_iosystem (other )
235235 if not isinstance (other , InputOutputSystem ):
236236 return NotImplemented
237237
@@ -263,7 +263,7 @@ def __rmul__(self, other):
263263 def __add__ (self , other ):
264264 """Add two input/output systems (parallel interconnection)"""
265265 # Convert other to an I/O system if needed
266- other = _convert_static_iosystem (other )
266+ other = _convert_to_iosystem (other )
267267 if not isinstance (other , InputOutputSystem ):
268268 return NotImplemented
269269
@@ -284,7 +284,7 @@ def __add__(self, other):
284284 def __radd__ (self , other ):
285285 """Parallel addition of input/output system to a compatible object."""
286286 # Convert other to an I/O system if needed
287- other = _convert_static_iosystem (other )
287+ other = _convert_to_iosystem (other )
288288 if not isinstance (other , InputOutputSystem ):
289289 return NotImplemented
290290
@@ -305,7 +305,7 @@ def __radd__(self, other):
305305 def __sub__ (self , other ):
306306 """Subtract two input/output systems (parallel interconnection)"""
307307 # Convert other to an I/O system if needed
308- other = _convert_static_iosystem (other )
308+ other = _convert_to_iosystem (other )
309309 if not isinstance (other , InputOutputSystem ):
310310 return NotImplemented
311311
@@ -329,7 +329,7 @@ def __sub__(self, other):
329329 def __rsub__ (self , other ):
330330 """Parallel subtraction of I/O system to a compatible object."""
331331 # Convert other to an I/O system if needed
332- other = _convert_static_iosystem (other )
332+ other = _convert_to_iosystem (other )
333333 if not isinstance (other , InputOutputSystem ):
334334 return NotImplemented
335335 return other - self
@@ -355,6 +355,10 @@ def __truediv__(self, other):
355355 else :
356356 return NotImplemented
357357
358+ # Determine if a system is static (memoryless)
359+ def _isstatic (self ):
360+ return self .nstates == 0
361+
358362 def _update_params (self , params ):
359363 # Update the current parameter values
360364 self ._current_params = self .params .copy ()
@@ -484,7 +488,7 @@ def feedback(self, other=1, sign=-1, params=None):
484488
485489 """
486490 # Convert sys2 to an I/O system if needed
487- other = _convert_static_iosystem (other )
491+ other = _convert_to_iosystem (other )
488492
489493 # Make sure systems can be interconnected
490494 if self .noutputs != other .ninputs or other .noutputs != self .ninputs :
@@ -932,6 +936,7 @@ def _out(self, t, x, u):
932936 # Make the full set of subsystem outputs to system output
933937 return self .output_map @ ylist
934938
939+ # Find steady state (static) inputs and outputs
935940 def _compute_static_io (self , t , x , u ):
936941 # Figure out the total number of inputs and outputs
937942 (ninputs , noutputs ) = self .connect_map .shape
@@ -1711,8 +1716,8 @@ def ufun(t):
17111716 dt = (t - T [idx - 1 ]) / (T [idx ] - T [idx - 1 ])
17121717 return U [..., idx - 1 ] * (1. - dt ) + U [..., idx ] * dt
17131718
1714- # Check to make sure this is not a static function
1715- if nstates == 0 : # No states => map input to output
1719+ # Check to make sure see if this is a static function
1720+ if sys . nstates == 0 :
17161721 # Make sure the user gave a time vector for evaluation (or 'T')
17171722 if t_eval is None :
17181723 # User overrode t_eval with None, but didn't give us the times...
@@ -2924,8 +2929,8 @@ def _process_vector_argument(arg, name, size):
29242929 return val , nelem
29252930
29262931
2927- # Utility function to create an I/O system from a static gain
2928- def _convert_static_iosystem (sys ):
2932+ # Utility function to create an I/O system ( from number or array)
2933+ def _convert_to_iosystem (sys ):
29292934 # If we were given an I/O system, do nothing
29302935 if isinstance (sys , InputOutputSystem ):
29312936 return sys
0 commit comments