%% Parallel Interconnection of Passive Systems
% This example illustrates the properties of a parallel interconnection of passive systems.
%% Parallel Interconnection of Passive Systems
% Consider an interconnection of two subsystems G_1 and G_2 in parallel. The interconnected system H maps the input r to the output y.
%
% If both systems G_1 and G_2 are passive, then the interconnected system H is guaranteed to be passive. Take for example
%  G_1(s) = \frac{0.1s + 1}{s +2} ; \quad G_2(s) = \frac{s^2 + 2s + 1}{s^2 + 3s + 10}
% Both systems are passive.

G1 = tf([0.1,1],[1,2]);
isPassive(G1)
G2 = tf([1,2,1],[1,3,10]);
isPassive(G2)

%
% We can therefore expect their parallel interconnection H to be passive, as confirmed by

H = parallel(G1,G2);
isPassive(H)

%
%% Passivity Indices for Parallel Interconnection
% There is a relationship between the passivity indices of G_1 and G_2 and the passivity indices of the interconnected system H. Let \nu_1 and \nu_2 denote the input passivity indices for G_1 and G_2, and let \rho_1 and \rho_2 denote the output passivity indices. If all these indices are nonnegative, then the input passivity index \nu and the output passivity index \rho for the parallel interconnection H satisfy
% \nu \geq \nu_1 + \nu_2 , \;\;\; \rho \geq \frac{\rho_1 \rho_2}{\rho_1+\rho_2} .
% In other words, we can infer some minimum level of input and output passivity for the parallel connection H from the input and output passivity indices of G_1 and G_2. For details, see the paper by Yu, H., "Passivity and dissipativity as design and analysis tools for networked control systems," Chapter 2, PhD Thesis, University of Notre Dame, 2012. Verify the lower bound for the input passivity index \nu.

% Input passivity index for G1
nu1 = getPassiveIndex(G1,'input');
% Input passivity index for G2
nu2 = getPassiveIndex(G2,'input');
% Input passivity index for H
nu = getPassiveIndex(H,'input')

%

% Lower bound
nu1+nu2

%
% Similarly, verify the lower bound for the output passivity index of H.

% Output passivity index for G1
rho1 = getPassiveIndex(G1,'output');
% Output passivity index for G2
rho2 = getPassiveIndex(G2,'output');
% Output passivity index for H
rho = getPassiveIndex(H,'output')

%

% Lower bound
rho1*rho2/(rho1+rho2)

% Copyright 2015 The MathWorks, Inc.