(z,p,k) = ZerosAndPoles.Analysis.zerosAndPoles(zp)
This function calculates the zeros, poles and gain of a ZerosAndPoels transfer function.
ZerosAndPoles p = Modelica_LinearSystems2.ZerosAndPoles.p(); Modelica_LinearSystems2.ZerosAndPoles zp=(p+1)/(p^2+p+1); public output Complex z; output Complex p; output Real k; algorithm (z,p,k)=Modelica_LinearSystems2.ZerosAndPoles.Analysis.zerosAndPoles(zp); // z = {-1} // p = {-0.5 + 0.866025*j, -0.5 - 0.866025*j} // k = 1
encapsulated function zerosAndPoles import Modelica; import Modelica.ComplexMath.j; import Modelica_LinearSystems2; import Modelica_LinearSystems2.ZerosAndPoles; import Complex; input ZerosAndPoles zp "ZerosAndPoles transfer function of a system"; output Complex z[:] = fill(Complex(0, 0), size(zp.n1, 1) + 2*size(zp.n2, 1)) "Zeros (Complex vector of numerator zeros)"; output Complex p[:] = fill(Complex(0, 0), size(zp.d1, 1) + 2*size(zp.d2, 1)) "Poles (Complex vector of denominator zeros)"; output Real k "Constant multiplied with transfer function"; end zerosAndPoles;