result = TransferFunction.Analysis.evaluate(tf, s)
Function Analysis.evaluate evaluates a transfer function at a given (complex) value of s. The transfer function G(s)=N(s)/D(s) is evaluated by calculating the numerator polynomial N(s) and the denominator polynomial D(s).
import Modelica.ComplexMath.j; TransferFunction s = Modelica_LinearSystems2.TransferFunction.s(); Modelica_LinearSystems2.TransferFunction tf=(s+1)/(s^2+s+1); Complex result; algorithm result := Modelica_LinearSystems2.TransferFunction.Analysis.evaluate(tf, j+1); // result = 0.538462 - 0.307692*j
Math.Polynomial.evaluateComplex
encapsulated function evaluate import Modelica; import Modelica.ComplexMath.j; import Complex; import Modelica_LinearSystems2.Math.Polynomial; import Modelica_LinearSystems2.TransferFunction; input TransferFunction tf "transfer function of a system"; input Complex s "Value of s where tf shall be evaluated"; input Real den_min = 0 "|denominator(s)| is limited by den_min"; output Complex result "= tf(s)"; end evaluate;