%% Plot Passivity of Multiple Systems
% 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.
% Copyright 2012 The MathWorks, Inc.