ZerosAndPoles.Plot.polesAndZeros(zp); or ZerosAndPoles.Plot.polesAndZeros( zp, poles=true, zeros=true, plot=true, defaultDiagram=Modelica_LinearSystems2.Internal.DefaultDiagramPolesAndZeros(), device=Modelica_LinearSystems2.Utilities.Plot.Records.Device());
This function plots a pole-zero-map of the poles and zeros of a transfer function in ZerosAndPoles format. The Boolean inputs "poles" and "zeros" define what to plot. If Boolean input "plot = true", the pole-zero-map is plotted. If false, only the diagram is generated and returned as output argument. The records "defaultDiagram" and "device" allow to set various layout options and the size and location of the diagram on the screen.
The example Modelica_LinearSystems2.Examples.ZerosAndPoles.plotPolesAndZeros defines a transfer functions as:
TransferFunction s = TransferFunction.s(); TransferFunction tf = (s^3 + 4*s + 1)/(s^4 + 2*s^3 + 3*s^2 + 4*s); ZerosAndPoles zp = ZerosAndPoles(tf); Modelica_LinearSystems2.ZerosAndPoles.Plot.polesAndZeros(zp=zp, defaultDiagram=Modelica_LinearSystems2.Internal.DefaultDiagramPolesAndZeros( heading="Poles and zeros of " + String(tf)));
and results in
encapsulated function polesAndZeros import Modelica; import Modelica_LinearSystems2; import Modelica_LinearSystems2.ZerosAndPoles; import Complex; import Modelica_LinearSystems2.Utilities.Plot; input ZerosAndPoles zp "Linear system in ZerosAndPoles form"; input Boolean poles = true "= true, to plot the poles of zp" annotation( choices(checkBox = true)); input Boolean zeros = true "= true, to plot the zeros of zp" annotation( choices(checkBox = true)); extends Modelica_LinearSystems2.Internal.PartialPlotFunction(defaultDiagram = Modelica_LinearSystems2.Internal.DefaultDiagramPolesAndZeros()); end polesAndZeros;