 BodePlot - Maple Help

DynamicSystems

 BodePlot
 plot magnitude and phase versus frequency Calling Sequence BodePlot( sys, opts ) Parameters

 sys - System; system object to plot opts - (optional) equation(s) of the form option = value; specify options for the BodePlot command Options

 • In addition to the following options, the BodePlot command takes many of the standard plot options; see plot,options.
 Specifies whether the frequencies are determined adaptively. The adaptive algorithm takes the value of the linearfreq option into account when determining the frequency distribution. The default value is false.
 • decibels = truefalse
 Specifies whether the magnitude is in decibels, that is, 20*log10(). If $\mathrm{true}$, the magnitude is in decibels, otherwise, it is not transformed. The default value is assigned by DynamicSystems[SystemOptions].
 • frequencies = list or Vector of nonnegative values
 Specifies frequencies to be used to generate a frequency response. The list or Vector must be sorted, from smallest to largest. The units are determined by the hertz option.
 • hertz = truefalse
 Specifies the unit of frequency. If this value is set to true, the unit of frequency is Hertz; otherwise, it is radians per second. The default value is assigned by DynamicSystems[SystemOptions].
 • legend = list or element
 Specifies the legend for the plot. A list specifies a legend entry for each subsystem. The elements in the list correspond to the Matrix of subsystems taken in Fortran order. An element can be used for a one-by-one Matrix of subsystems. The default is no legend.
 • linearfreq = truefalse
 Specifies the frequency scale. If this value is set to $\mathrm{true}$, the scale is linear; otherwise, by default, the scale is logarithmic.
 • linearmag = truefalse
 Specifies whether the vertical axis (magnitude) is a linear or logarithmic scale. If $\mathrm{true}$, the scale is linear, otherwise it is logarithmic. The default is the value of the keyword option decibels.
 Setting linearmag to false and decibels to true is generally not desirable; the effective scale is a logarithm of a logarithm, that is, decibels are plotted on a logarithmic scale.  If the magnitude is less than one, the decibels are negative and that part of the plot does not appear.
 • method = function or matrix
 Selects the method used to compute the frequency response. The function method generates the transfer functions of sys and evaluates them at the selected frequencies. The matrix method generates the state-space matrices of sys and evaluates the expression $C·{\left(Iz-A\right)}^{\left(-1\right)}·B+\mathrm{D}$ at specific values of $z$. The default is to use the function method for frequency-domain systems (TF, Coeff, and ZPK), and to use the matrix method for time-domain systems (DE and SS).
 • numpoints = nonnegative integer
 Specifies the number of points. The default is 100.
 • output = one of arrayplot, dualaxis, horizontalplot, magnitudeplot, magnitudedata, phaseplot, phasedata, or verticalplot, or a list of these names.

Specifies the output of BodePlot. A list of these names returns a list of the corresponding values, in the order specified.

 – The arrayplot option is the same as the horizontalplot option.
 – The dualaxis option plots both magnitude and phase in the same plot, with the left axis the magnitude scale and the right axis the phase scale. Associated magnitude/phases are plotted with the same color; the magnitude plot is shown as a solid line and the phase plot is shown as a dashed line.
 – The horizontalplot option generates an array plot with the magnitude plot on the left and the phase plot on the right.
 – The magnitudeplot and magnitudedata options specify the plot and data of the magnitude plot, respectively. The data returned by the magnitudedata and phasedata options is returned as a Matrix for a single response and a list of Matrices for more than one response. Each Matrix has two columns: the first is the frequency, the second is the value at that frequency. The units are selected by appropriate options.
 – The phaseplot and phasedata options select the plot and data values of the phase plot, respectively.
 – The verticalplot option generates an array plot with the magnitude plot above the phase plot.
 – The default is verticalplot.
 • parameters = set(name = complexcons) or list(name = complexcons)
 Specifies numeric values for parameters in sys. These values override those specified by the parameters field of the system object, which in turn override the settings in in SystemOptions(parameters). The numeric value on the right-hand side of each equation is substituted for the name on the left-hand side in the expressions that define the model. No checking is done during the substitution to determine whether the substituted value is valid. For example, a complex value can be substituted for the coefficient of a polynomial. If the complex value had been originally assigned to the model at creation, a warning would be generated.
 Specifies whether the phase is in radians or degrees. If $\mathrm{true}$, the phase is in radians, otherwise it is in degrees. The default value is assigned by DynamicSystems[SystemOptions].
 • range = range( realcons )
 Specifies the frequency range to plot. The default setting is to compute an appropriate range based on the locations of the zeros and poles of the transfer functions of the selected subsystems. Similarly, if the right-hand side of range is infinity, a maximum is computed based on the zeros and poles. The units are specified by the hertz option.
 • subsystem = [ posint, posint ] or list of same
 Selects subsystems of a multi-input/multi-output system. Each selected subsystem is specified as a list of two indices: the first specifies the output and the second specifies the input. For example, $\left[1,2\right]$ specifies the subsystem from the second input to the first output. A list of lists selects multiple subsystems. The default setting is to select all subsystems, using Fortran ordering. That is, for an m x n system, the default list of subsystems is [ [1,1], ..., [m,1], ..., [1,n], ..., [m,n] ]. Description

 • The BodePlot command plots the magnitude versus frequency and the phase versus frequency response of a System object, sys. By default, the BodePlot command returns an arrayplot which consists of the magnitudeplot and the phaseplot.
 • If sys is a continuous system, its s-domain transfer function is computed and then converted to the real frequency domain using the transformation s -> I*omega, where omega is the angular frequency.
 • If sys is a discrete system, its z-domain transfer function is computed and then converted to the real frequency domain using the transformation z -> exp(I*omega*Ts), where omega is the angular frequency and Ts is the sample time.
 • The BodePlot command uses the plot option axis to assign a logarithmic scale to an axis. This feature does not work with the default plot driver used in the Classic Worksheet interface. To use this feature in the Classic worksheet interface, or with command-line Maple, use $\mathrm{plotsetup}\left(\mathrm{maplet}\right)$. For details, see plot,device.
 • The BodePlot command takes all standard plot,options. Examples

 > $\mathrm{with}\left(\mathrm{DynamicSystems}\right):$
 > $\mathrm{sys}≔\mathrm{TransferFunction}\left(\frac{1}{s-10}\right):$
 > $\mathrm{BodePlot}\left(\mathrm{sys}\right)$  > $\mathrm{den}≔\left(s+1+I\cdot 10\right)\left(s+1-I\cdot 10\right):$
 > $\mathrm{sys}≔\mathrm{NewSystem}\left(⟨⟨\frac{s}{\mathrm{den}}|\frac{1}{s}⟩,⟨\frac{1}{\mathrm{den}}|\frac{1}{s-10}⟩⟩\right):$
 > $\mathrm{sys}:-\mathrm{tf}$
 $\left[\begin{array}{cc}\frac{s}{{s}^{2}+2{}s+101}& \frac{1}{s}\\ \frac{1}{{s}^{2}+2{}s+101}& \frac{1}{s-10}\end{array}\right]$ (1)

Plot the two subsystems on the matrix diagonal.  This is the command to create the plot from the Plotting Guide.

 > $\mathrm{BodePlot}\left(\mathrm{sys},\mathrm{subsystem}=\left[\left[1,1\right],\left[2,2\right]\right]\right)$  >