Compute or plot passivity index as function of frequency
the relative passivity indices of the dynamic system
a function of frequency. When
I + G is minimum
phase, the relative passivity indices are the singular values of
- G)(I + G)^-1. The largest singular value measures the
(R < 1) or shortage
> 1) at each frequency. See
more information about the meaning of the passivity index.
passiveplot automatically chooses the frequency
range and number of points for the plot based on the dynamics of
G is a model with complex coefficients, then
Log frequency scale, the plot shows two branches, one for positive frequencies and one for negative frequencies. The arrows indicate the direction of increasing frequency values for each branch.
Linear frequency scale, the plot shows a single branch with a symmetric frequency range centered at a frequency value of zero.
the passivity index for frequencies specified by
w is a cell array of the form
passiveplot plots the passivity index at
frequencies ranging between
w is a vector of frequencies, then
passiveplot plots the passivity index at each
specified frequency. The vector
w can contain both
negative and positive frequencies.
You can use this syntax with any of the previous input-argument combinations.
specifies a color, linestyle, and marker for each system in the plot.
plots the passivity index with the options set specified in
plotoptions. You can use these options to customize the
plot appearance using the command line. Settings you specify in
plotoptions override the preference settings in the
MATLAB® session in which you run
Therefore, this syntax is useful when you want to write a script to generate
multiple plots that look the same regardless of the local preferences.
Plot the relative passivity index as a function of frequency of the system .
G = tf([1 2],[1 1]); passiveplot(G)
The plot shows that the relative passivity index is less than 1 at all frequencies. Therefore, the system
G is passive.
Plot the input passivity index of the same system.
The input passivity index is positive at all frequencies. Therefore, the system is input strictly passive.
Plot the input passivity index of two dynamic systems and their series interconnection.
G1 = tf([5 3 1],[1 2 1]); G2 = tf([1 1 5 0.1],[1 2 3 4]); H = G2*G1; passiveplot(G1,'r',G2,'b--',H,'gx','input') legend('G1','G2','G2*G1')
The input passivity index of the interconnected system dips below 0 around 1 rad/s. This plot shows that the series interconnection of two passive systems is not necessarily passive. However, passivity is preserved for parallel or feedback interconnections of passive systems.
Plot the relative passivity indices of a complex-coefficient model and a real-coefficient model on the same plot.
A = [-3.50,-1.25-0.25i;2,0]; B = [1;0]; C = [-0.75-0.5i,0.625-0.125i]; D = 0.5; Gc = ss(A,B,C,D); Gr = tf([1 5 10],[1 10 5]); passiveplot(Gc,Gr) legend('Complex-coefficient model','Real-coefficient model','Location','southeast')
In log frequency scale, the plot shows two branches for models with complex coefficients, one for positive frequencies, with a right-pointing arrow, and one for negative frequencies, with a left-pointing arrow. In both branches, the arrows indicate the direction of increasing frequencies. The plots for models with real coefficients always contain a single branch with no arrows.
Set the plotting frequency scale to linear.
opt = sectorplotoptions; opt.FreqScale = 'Linear';
Plot the indices.
passiveplot(Gc,Gr,opt) legend('Complex-coefficient model','Real-coefficient model')
In linear frequency scale, the plots show a single branch with a symmetric frequency range centered at a frequency value of zero. The plot also shows the negative-frequency response of a real-coefficient model when you plot the response along with a complex-coefficient model.
G— Model to analyze
Model to analyze for passivity, specified as a dynamic
system model such as a
G can be MIMO, if the number of inputs equals the
number of outputs.
G can be continuous or discrete. If
G is a generalized model with tunable or uncertain
passiveplot evaluates passivity of the current,
nominal value of
G is a model array, then
passiveplot plots the passivity index of all models
in the array on the same plot. When you use output arguments to get
G must be a single model.
type— Type of passivity index
Type of passivity index, specified as one of the following:
'input' — Input passivity index (input
feedforward passivity). This value is the smallest eigenvalue of , for s =
jω in continuous time, and s =
ejω in discrete time.
'output' — Output passivity index
(output feedback passivity). When
G is minimum
phase, this value is the smallest eigenvalue of , for s =
jω in continuous time, and s =
ejω in discrete time.
'io' — Combined I/O passivity index.
I + G is minimum phase, this value is the
largest τ(ω) such that:
for s = jω in continuous time, and s = ejω in discrete time.
See About Passivity and Passivity Indices for details about these indices.
plotoptions— Passivity index plot options set
Passivity index plot options set, specified as a
SectorPlotOptions object. You can use this option set
to customize the plot appearance. Use
sectorplotoptions to create the option set. Settings you
plotoptions overrides the preference
settings in the MATLAB session in which you run
plotoptions is useful when you want to write
a script to generate multiple plots that look the same regardless of the
For the list of available options, see
index— Passivity indices
Passivity indices as a function of frequency, returned as a
index contains whichever type of passivity
index you specify, computed at the frequencies
you supplied them, or
wout if you did not.
as many columns as there are values in
One row, for the input, output, or combined i/o passivity indices.
As many rows as
G has inputs
or outputs, for the relative passivity index.
For example, suppose that
G is a 3-input,
3-output system, and
w is a 1-by-30 vector of
frequencies. Then the following syntax returns a 3-by-30 matrix
index = passiveplot(G,w);
index(:,k) contains the relative
passivity indices of
G, in descending order,
at the frequency