ml_bodemag

Bode magnitude plots of transfer functions.

Contents

Syntax

[w, mag, tf, info] = ml_bodemag(sys1, ..., sysN)
[w, mag, tf, info] = ml_bodemag(sys1, ..., sysN, opts)
[w, mag, tf, info] = ml_bodemag(sys, rom1, ..., romM)
[w, mag, tf, info] = ml_bodemag(sys, rom1, ..., romM, opts)

Description

This function can be used to compute and plot absolute magnitude values of transfer functions in given intervals. It can be used to compute/plot

   abs(G1(jw)), ..., abs(GN(jw)),
   abs(G(jw) - H1(jw)), ..., abs(G(jw) - HM(jw)),
   abs(G(jw) - H1(jw)) / abs(G(jw)), ...,

where G1, ..., GN are the transfer functions of sys1, ..., sysN, G the transfer function of sys and H1, ..., HM the transfer functions of rom1, ..., romM.

Input

sys1, ..., sysN - structure or state-space objects, containing {!} standard/descriptor/second-order systems rom1, ..., romM - structure or state-space objects, containing {!} standard/descriptor/second-order systems * opts - structure, containing the following optional entries:

Parameter
Meaning
AccuracyTol
nonnegative scalar, tolerance used for the accuracy of the adaptive sampling method
default: 0.1
DiffMode
character array, determining type of plot
  • 'off' - Bode magnitude plots of sys1, sys2, ...
  • 'abs' - absolute errors sys-rom1, sys-rom2, ...
  • 'rel' - relative errors sys-rom1, sys-rom2, ...
  • 'all' - all plot types are shown
default: 'off'
FreqRange
vector of length 2, exponents of the frequency range, in which should be sampled
default: [-4, 4]
FreqSample
vector or character array, determining the frequency points, where to sample
  • 'adapt' - adaptive sampling
  • 'equal' - logarithmically equidistant sampling
  • [numeric] - given frequency values are used
default: 'adapt'
FreqUnit
character array, frequency unit of the sample points and the plot 'rad/sec' - frequency in radian per second
  • 'Hz' - frequency in Hertz
default: 'rad/sec'
Info
{0, 1}, used to disable/enable display of sampling steps
default: 0
InitPoints
positive integer >= 3 or vector of length >= 3, initial number of equally distributed sampling points or initial frequency vector for opts.FreqSample == 'adapt'
default: 3
LineSpecs
{!}
character array, determining the line specifications for the plots
default: '-'
MagScale
character array, determines scaling of the magnitude axis
  • 'log' - creates loglog plot
  • 'linear' - creat semilogx plot
default: 'log'
MagUnit
character array, magnitude unit in the plot
  • 'abs' - absolute values
  • 'dB' - deciBel
default: 'abs'
MaxPoints
positive integer, maximum number of sampling points, if DiffMode == 'equal' total number of points
default: 500
ShowPlot
{0, 1}, used to disable/enable showing of plots
default: 1

Note: Arguments/Parameters marked with {!} may also be a cell array containing multiple arguments.

Output

Entry
Meaning
AbsErr
if opts.DiffMode == 'off' empty, otherwise 4-D array of size p x m x (number samples) x (number systems - 1), containing the computed absolute error values
Accuracy
vector, containing the computed accuracy values during the adaptive sampling and initial zeros for non-adaptive sampling
Npts
positive integer, number of plotted points
RelErr
if opts.DiffMode == 'off' empty, otherwise 4-D array of size p x m x (number samples) x (number systems - 1), containing the computed relative error values

See Also

ml_sigmaplot | ml_frobeniusplot