encapsulated function frequencyResponse
extends Modelica.Icons.Function;
import Modelica;
import Modelica_LinearSystems2.Internal;
import Modelica.Units.SI;
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 Integer nPoints(min = 2) = 200 "Number of points";
input Boolean autoRange = true "= true, if abszissa range is automatically determined";
input SI.Frequency f_min(min = 0) = 0.1 "Minimum frequency value, if autoRange = false" annotation(
Dialog(enable = not autoRange));
input SI.Frequency f_max(min = 0) = 10 "Maximum frequency value, if autoRange = false" annotation(
Dialog(enable = not autoRange));
input Boolean Hz = true "= true, to compute abszissa in [Hz], otherwise in [rad/s] (= 2*pi*Hz)" annotation(
choices(checkBox = true));
input Boolean dB = false "= true, to compute magnitude in [], otherwise in [dB] (=20*log10(value))" annotation(
choices(checkBox = true));
input Boolean logX = true "= true, to compute abszissa values for logarithmic scale" annotation(
choices(checkBox = true));
output Real f[nPoints] "Frequency vector (either in Hz or rad/s)";
output Real A[nPoints] "Amplitude (either without unit or in dB)";
output Modelica.Units.NonSI.Angle_deg phi[nPoints] "Angles in degree";
end frequencyResponse;