dzp = DiscreteTransferFunction.Conversion.toDiscreteZerosAndPoles(tf)
Computes a DiscreteZerosAndPoles record
product(q + n1[i]) * product(q^2 + n2[i,1]*q + n2[i,2]) dzp = k * --------------------------------------------------------- product(q + d1[i]) * product(q^2 + d2[i,1]*q + d2[i,2])
of a discrete transfer function represented by numerator and denominator polynomial. The poles and zeros and the gain k are computed from the DiscreteTransferFunction-input and are used as inputs the DiscreteZerosAndPoles constructor.
DiscreteTransferFunction z = Modelica_LinearSystems2.DiscreteTransferFunction.z(); Modelica_LinearSystems2.DiscreteTransferFunction dtf = 1/(z^2 + 3*z + 2) algorithm dzp = Modelica_LinearSystems2.DiscreteTransferFunction.Conversion.toDiscreteZerosAndPoles(dtf); // dzp = 1/( (z + 1)*(z + 2) )
encapsulated function toDiscreteZerosAndPoles import Modelica; import Complex; import Modelica_LinearSystems2; import Modelica_LinearSystems2.DiscreteZerosAndPoles; import Modelica_LinearSystems2.DiscreteTransferFunction; import Modelica_LinearSystems2.TransferFunction; input DiscreteTransferFunction dtf "transfer function of a system"; output Modelica_LinearSystems2.DiscreteZerosAndPoles dzp(redeclare Real n1[DiscreteZerosAndPoles.Internal.numberOfRealZeros2(dtf)], redeclare Real n2[integer((size(dtf.n, 1) - 1 - DiscreteZerosAndPoles.Internal.numberOfRealZeros2(dtf))/2), 2], redeclare Real d1[DiscreteZerosAndPoles.Internal.numberOfRealPoles(dtf)], redeclare Real d2[integer((size(dtf.d, 1) - 1 - DiscreteZerosAndPoles.Internal.numberOfRealPoles(dtf))/2), 2]); end toDiscreteZerosAndPoles;