harold.Transfer¶

class harold.Transfer(num, den=None, dt=None)

A class for creating Transfer functions.

__init__(num, den=None, dt=None)

For SISO models, 1D lists or 1D numpy arrays are expected, e.g.,:

>>> G = Transfer(1,[1,2,1])


For MIMO systems, the array like objects are expected to be inside the appropriate shaped list of lists

>>> G = Transfer([[ [1,3,2], [1,3] ],
...               [   [1]  , [1,0] ]],# end of num
...              [[ [1,2,1] ,  [1,3,3]  ],
...               [ [1,0,0] , [1,2,3,4] ]])


If the denominator is common then the denominator can be given as a single array like object.

>>> G = Transfer([[ [1,3,2], [1,3] ],
...               [   [1]  , [1,0] ]],# end of num
...              [1, 2, 3, 4, 5]) # common den


Setting SamplingPeriod property to 'None' will make the system continuous time again and relevant properties are reset to continuous-time properties. However the numerical data will still be the same.

Methods

 __init__(num[, den, dt]) For SISO models, 1D lists or 1D numpy arrays are expected, e.g.,. pole_properties([output_data]) The resulting array holds the poles in the first column, natural frequencies in the second and damping ratios in the third. to_array() If a Transfer representation is a static gain, this method returns a regular 2D-ndarray. validate_arguments(num, den[, verbose]) A helper function to validate whether given arguments to an Transfer instance are valid and compatible for instantiation.

Attributes

 DiscretizationMatrix This 2x2 matrix denoted with q is used internally to represent the upper linear fractional transformation of the operation $$\frac{1}{s} I = \frac{1}{z} I \star Q$$. DiscretizedWith This property is used internally to keep track of (if applicable) the original method used for discretization. NumberOfInputs A read only property that holds the number of inputs. NumberOfOutputs A read only property that holds the number of outputs. PrewarpFrequency If the discretization method is tustin then a frequency warping correction might be required the match of the discrete time system response at the frequency band of interest. SamplingPeriod If this property is called G.SamplingPeriod then returns the sampling period data. SamplingSet If this property is called G.SamplingSet then returns the set Z or R for discrete and continuous models respectively. den If this property is called G.den then returns the numerator data. num If this property is called G.num then returns the numerator data. polynomials A read only property that returns the model numerator and the denominator as the outputs. shape A read only property that holds the shape of the system as a tuple such that the result is (# of outputs, # of inputs).