functionbode
Plot ZerosAndPoles transfer function as bode plot
Extends from Modelica_LinearSystems2.Internal.PartialPlotFunction (Interface of a plot function).
Information
Syntax
ZerosAndPoles.Plot.bode(zp) or ZerosAndPoles.Plot.bode( zp, nPoints, autoRange, f_min, f_max, magnitude=true, phase=true, defaultDiagram=Modelica_LinearSystems2.Internal.DefaultDiagramBodePlot(), device=Modelica_LinearSystems2.Utilities.Plot.Records.Device() )
Description
This function plots the bode-diagram of a transfer function.
Example
ZerosAndPoles p = Modelica_LinearSystems2.ZerosAndPoles.p(); Modelica_LinearSystems2.ZerosAndPoles zp =(p^2 + 5*p + 7)/(p + 2)/(p + 3); algorithm Modelica_LinearSystems2.ZerosAndPoles.Plot.bode(zp) // gives:
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| ZerosAndPoles | zp | ZerosAndPoles transfer function to be plotted | |
| Integer | nPoints | 200 | Number of points |
| Boolean | autoRange | true | True, if abszissa range is automatically determined |
| SI.Frequency | f_min | 0.1 | Minimum frequency value, if autoRange = false |
| SI.Frequency | f_max | 10 | Maximum frequency value, if autoRange = false |
| Boolean | magnitude | true | = true, to plot magnitude |
| Boolean | phase | true | = true, to plot phase |
| Plot.Records.Diagram | defaultDiagram (from PartialPlotFunction) | Default diagram layout | |
| Plot.Records.Device | device (from PartialPlotFunction) | Modelica_LinearSystems2.Utilities.Plot.Records.Device() | Properties of device where figure is shown |
| Boolean | Hz | true | = true, to plot abszissa in [Hz], otherwise in [rad/s] (= 2*pi*Hz) |
| Boolean | dB | false | = true, to plot magnitude in [], otherwise in [dB] (=20*log10(value)) |
| Boolean | onFile | false | = true, if frequency response is stored on file as matrix [f,A,phi] |
| String | fileName | "frequencyResponse.mat" | If onFile=true, file on which the frequency response will be stored |
| String | matrixName | if Hz and not dB then "fHz_A_phiDeg" elseif Hz and dB then "fHz_AdB_phiDeg" elseif not Hz and dB then "f_AdB_phiDeg" else "f_A_phiDeg" | If onFile=true, Name of matrix on file |