.Modelica_LinearSystems2.TransferFunction.Conversion.toZerosAndPoles

Information

Syntax

zp = TransferFunction.Conversion.toZerosAndPoles(tf)

Description

Computes a ZerosAndPoles record

          product(s + n1[i]) * product(s^2 + n2[i,1]*s + n2[i,2])
zp = k * ---------------------------------------------------------
          product(s + d1[i]) * product(s^2 + d2[i,1]*s + d2[i,2])

of a transfer function represented by numerator and denominator polynomial. The poles and zeros and the gain k are computed (zerosAndPoles) and are used as inputs the ZerosAndPoles constructor.

Example

  TransferFunction s = Modelica_LinearSystems2.TransferFunction.s();
  Modelica_LinearSystems2.TransferFunction dtf = 1/(s^2 + 3*s +2)

algorithm
  zp:=Modelica_LinearSystems2.TransferFunction.Conversion.toZerosAndPoles(tf);
//  zp = 1/( (s + 1)*(s + 2) )

Interface

encapsulated function toZerosAndPoles
  import Modelica;
  import Modelica_LinearSystems2.ZerosAndPoles;
  import Modelica_LinearSystems2.TransferFunction;
  import Complex;
  input TransferFunction tf "Transfer function of a system";
  output ZerosAndPoles zp(redeclare Real n1[ZerosAndPoles.Internal.numberOfRealZeros2(tf)], redeclare Real n2[integer((size(tf.n, 1) - 1 - ZerosAndPoles.Internal.numberOfRealZeros2(tf))/2), 2], redeclare Real d1[ZerosAndPoles.Internal.numberOfRealPoles(tf)], redeclare Real d2[integer((size(tf.d, 1) - 1 - ZerosAndPoles.Internal.numberOfRealPoles(tf))/2), 2]) "ZerosAndPoles object";
end toZerosAndPoles;

Generated at 2024-11-22T19:25:38Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos