.Modelica_LinearSystems2.DiscreteZerosAndPoles.'constructor'.fromPolesAndZeros

Information

Syntax

dzp = 'constructor'.fromPolesAndZeros(z, p, k, Ts, method)
dzp = 'constructor'.fromPolesAndZeros(z, p, k, Ts, method, uName, yName)

Description

This function constructs a DiscreteZerosAndPoles transfer function from denominator and numerator zeros, as well as a gain.

Since only transfer functions with real coefficients are supported, complex roots must be defined as conjugate complex pairs. It is required that complex conjugate pairs must directly follow each other as above. An error occurs if this is not the case.

Example

             (q + 0.1)
dzp = 4* -----------------
         (q + 1)*(q - 0.1)

is defined as

  import Complex;
  import Modelica_LinearSystems2.DiscreteZerosAndPoles;

  dzp = DiscreteZerosAndPoles(
          z = {Complex(-0.1,0)},
          p = {Complex(-1,0),
               Complex(0.1)},
               k=4);

Interface

encapsulated function fromPolesAndZeros
  import Modelica;
  import Complex;
  import Modelica_LinearSystems2;
  import Modelica_LinearSystems2.DiscreteZerosAndPoles;
  import Modelica_LinearSystems2.Internal;
  input Complex z[:] = fill(Complex(0), 0) "Zeros (Complex vector of numerator zeros)";
  input Complex p[:] = fill(Complex(0), 0) "Poles (Complex vector of denominator zeros)";
  input Real k = 1.0 "Constant multiplied with transfer function";
  input Modelica.Units.SI.Time Ts "Sample time";
  input Modelica_LinearSystems2.Utilities.Types.Method method = Modelica_LinearSystems2.Utilities.Types.Method.Trapezoidal "Discretization method";
  input String uName = "" "input name";
  input String yName = "" "output name";
  output DiscreteZerosAndPoles dzp(redeclare Real n1[Internal.numberOfRealZeros(z)], redeclare Real n2[integer((size(z, 1) - Internal.numberOfRealZeros(z))/2), 2], redeclare Real d1[Internal.numberOfRealZeros(p)], redeclare Real d2[integer((size(p, 1) - Internal.numberOfRealZeros(p))/2), 2]) "ZerosAndPoles transfer functions of the zeros, poles and k";
end fromPolesAndZeros;

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