dzp = DiscreteTransferFunction.Conversion.toDiscreteZerosAndPoles(tf)
Computes a DiscreteZerosAndPoles record
product(z + n1[i]) * product(z^2 + n2[i,1]*z + n2[i,2]) zp = k * --------------------------------------------------------- product(z + d1[i]) * product(z^2 + d2[i,1]*z + d2[i,2])
of a discrete transfer function represented by numerator and denominator polynomial. The poles and zeros and the gain k are computed by (zerosAndPoles) and are used as inputs the DiscreteZerosAndPoles constructor.
DiscreteTransferFunction z = Modelica_LinearSystems2.DiscreteTransferFunction.z(); Modelica_LinearSystems2.TransferFunction tf = 1/(z^2 + 3*z +2) algorithm dzp:=Modelica_LinearSystems2.TransferFunction.Conversion.toZerosAndPoles(dtf); // zp = 1/( (z + 1)*(z + 2) )
encapsulated function toDiscreteZerosAndPoles import Modelica; import Complex; import Modelica_LinearSystems2; import Modelica_LinearSystems2.WorkInProgress.DiscreteZerosAndPoles; import Modelica_LinearSystems2.WorkInProgress.DiscreteTransferFunction; import Modelica_LinearSystems2.TransferFunction; input DiscreteTransferFunction dtf "transfer function of a system"; output 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;