@@ -155,11 +155,11 @@ def __init__(self, *args, **kwargs):
155155 def __str__ (self ):
156156 """String representation of the transfer function."""
157157
158- mimo = self .inputs > 1 or self .outputs > 1
158+ mimo = self .ninputs > 1 or self .noutputs > 1
159159 outstr = ['Frequency response data' ]
160160
161- for i in range (self .inputs ):
162- for j in range (self .outputs ):
161+ for i in range (self .ninputs ):
162+ for j in range (self .noutputs ):
163163 if mimo :
164164 outstr .append ("Input %i to output %i:" % (i + 1 , j + 1 ))
165165 outstr .append ('Freq [rad/s] Response' )
@@ -201,12 +201,12 @@ def __add__(self, other):
201201 other = _convert_to_FRD (other , omega = self .omega )
202202
203203 # Check that the input-output sizes are consistent.
204- if self .inputs != other .inputs :
204+ if self .ninputs != other .ninputs :
205205 raise ValueError ("The first summand has %i input(s), but the \
206- second has %i." % (self .inputs , other .inputs ))
207- if self .outputs != other .outputs :
206+ second has %i." % (self .ninputs , other .ninputs ))
207+ if self .noutputs != other .noutputs :
208208 raise ValueError ("The first summand has %i output(s), but the \
209- second has %i." % (self .outputs , other .outputs ))
209+ second has %i." % (self .noutputs , other .noutputs ))
210210
211211 return FRD (self .fresp + other .fresp , other .omega )
212212
@@ -236,14 +236,14 @@ def __mul__(self, other):
236236 other = _convert_to_FRD (other , omega = self .omega )
237237
238238 # Check that the input-output sizes are consistent.
239- if self .inputs != other .outputs :
239+ if self .ninputs != other .noutputs :
240240 raise ValueError (
241241 "H = G1*G2: input-output size mismatch: "
242242 "G1 has %i input(s), G2 has %i output(s)." %
243- (self .inputs , other .outputs ))
243+ (self .ninputs , other .noutputs ))
244244
245- inputs = other .inputs
246- outputs = self .outputs
245+ inputs = other .ninputs
246+ outputs = self .noutputs
247247 fresp = empty ((outputs , inputs , len (self .omega )),
248248 dtype = self .fresp .dtype )
249249 for i in range (len (self .omega )):
@@ -263,14 +263,14 @@ def __rmul__(self, other):
263263 other = _convert_to_FRD (other , omega = self .omega )
264264
265265 # Check that the input-output sizes are consistent.
266- if self .outputs != other .inputs :
266+ if self .noutputs != other .ninputs :
267267 raise ValueError (
268268 "H = G1*G2: input-output size mismatch: "
269269 "G1 has %i input(s), G2 has %i output(s)." %
270- (other .inputs , self .outputs ))
270+ (other .ninputs , self .noutputs ))
271271
272- inputs = self .inputs
273- outputs = other .outputs
272+ inputs = self .ninputs
273+ outputs = other .noutputs
274274
275275 fresp = empty ((outputs , inputs , len (self .omega )),
276276 dtype = self .fresp .dtype )
@@ -290,8 +290,8 @@ def __truediv__(self, other):
290290 else :
291291 other = _convert_to_FRD (other , omega = self .omega )
292292
293- if (self .inputs > 1 or self .outputs > 1 or
294- other .inputs > 1 or other .outputs > 1 ):
293+ if (self .ninputs > 1 or self .noutputs > 1 or
294+ other .ninputs > 1 or other .noutputs > 1 ):
295295 raise NotImplementedError (
296296 "FRD.__truediv__ is currently only implemented for SISO "
297297 "systems." )
@@ -313,8 +313,8 @@ def __rtruediv__(self, other):
313313 else :
314314 other = _convert_to_FRD (other , omega = self .omega )
315315
316- if (self .inputs > 1 or self .outputs > 1 or
317- other .inputs > 1 or other .outputs > 1 ):
316+ if (self .ninputs > 1 or self .noutputs > 1 or
317+ other .ninputs > 1 or other .noutputs > 1 ):
318318 raise NotImplementedError (
319319 "FRD.__rtruediv__ is currently only implemented for "
320320 "SISO systems." )
@@ -392,10 +392,10 @@ def eval(self, omega, squeeze=None):
392392 else :
393393 out = self .fresp [:, :, elements ]
394394 else :
395- out = empty ((self .outputs , self .inputs , len (omega_array )),
395+ out = empty ((self .noutputs , self .ninputs , len (omega_array )),
396396 dtype = complex )
397- for i in range (self .outputs ):
398- for j in range (self .inputs ):
397+ for i in range (self .noutputs ):
398+ for j in range (self .ninputs ):
399399 for k , w in enumerate (omega_array ):
400400 frraw = splev (w , self .ifunc [i , j ], der = 0 )
401401 out [i , j , k ] = frraw [0 ] + 1.0j * frraw [1 ]
@@ -406,7 +406,7 @@ def __call__(self, s, squeeze=None):
406406 """Evaluate system's transfer function at complex frequencies.
407407
408408 Returns the complex frequency response `sys(s)` of system `sys` with
409- `m = sys.inputs ` number of inputs and `p = sys.outputs ` number of
409+ `m = sys.ninputs ` number of inputs and `p = sys.noutputs ` number of
410410 outputs.
411411
412412 To evaluate at a frequency omega in radians per second, enter
@@ -474,10 +474,10 @@ def feedback(self, other=1, sign=-1):
474474
475475 other = _convert_to_FRD (other , omega = self .omega )
476476
477- if (self .outputs != other .inputs or self .inputs != other .outputs ):
477+ if (self .noutputs != other .ninputs or self .ninputs != other .noutputs ):
478478 raise ValueError (
479479 "FRD.feedback, inputs/outputs mismatch" )
480- fresp = empty ((self .outputs , self .inputs , len (other .omega )),
480+ fresp = empty ((self .noutputs , self .ninputs , len (other .omega )),
481481 dtype = complex )
482482 # TODO: vectorize this
483483 # TODO: handle omega re-mapping
@@ -487,9 +487,9 @@ def feedback(self, other=1, sign=-1):
487487 fresp [:, :, k ] = np .dot (
488488 self .fresp [:, :, k ],
489489 linalg .solve (
490- eye (self .inputs )
490+ eye (self .ninputs )
491491 + np .dot (other .fresp [:, :, k ], self .fresp [:, :, k ]),
492- eye (self .inputs ))
492+ eye (self .ninputs ))
493493 )
494494
495495 return FRD (fresp , other .omega , smooth = (self .ifunc is not None ))
0 commit comments