.Modelica_LinearSystems2.Internal.frequencyEvaluate

Information

Syntax

result = ZerosAndPoles.Analysis.evaluate(zp, p, den_min=0)

Description

Function Analysis.evaluate evaluates the ZerosAndPoles transfer function at a given (complex) value of p and returns the value G(p)=N(p)/D(p). The optional argument den_min with default 0 is used to guard against a division by zero.

  if |(D(p))| >= den_min then
     G(p) = N(p) / D(p);
  elseif D(p).re >= 0.0 then
     G(p) = N(p) / den_min
  else
     G(p) = -N(p) / den_min
  end if;

Example

  Complex j = Modelica_LinearSystems2.Math.Complex.j();
  ZerosAndPoles p = Modelica_LinearSystems2.ZerosAndPoles.p();
  Modelica_LinearSystems2.ZerosAndPoles zp=(p+1)/(p^2+p+1);

  Complex result;

algorithm
  result := Modelica_LinearSystems2.ZerosAndPoles.Analysis.evaluate(zp, j+1);
//  result = 0.538462 - 0.307692j

See also

Math.Polynomial.evaluateComplex

Interface

encapsulated function frequencyEvaluate
  import Modelica;
  import Modelica_LinearSystems2;
  import Modelica_LinearSystems2.Internal;
  import Modelica.Utilities.Streams.print;
  input Real gain "Gain of transfer function";
  input Real Zeros[:, 2] "Zeros as Real matrix (first column: real, second column imaginary values)";
  input Real Poles[:, 2] "Poles as Real matrix (first column: real, second column imaginary values)";
  input Real re "Real value of complex number";
  input Real im "Imaginary value of complex number";
  output Real A "Amplitude of complex value";
  output Modelica.Units.SI.Angle phi "Angle of complex value";
  output Integer info "= 0/1/2 success/infinity(A is a large value)/indefinite (A=0/0; A=0 returned)";
end frequencyEvaluate;

Revisions

Date Author Comment
2010-05-31 Marcus Baur, DLR-RM Realization

Generated at 2024-04-22T18:15:51Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos