%% Check Input and Output Passivity
% Test whether the transfer function G is input passive with index 0.25. To do so, use nu = 0.25 and rho = 0.

G = tf([1,1],[1,2]);
[pfin,Rin] = isPassive(G,0.25,0)

% The result shows that G is input passive with this nu value and has some excess passivity.
%
% Test whether G is output passive with index 2.

[pfout,Rout] = isPassive(G,0,2)

% Here, the result pfout = 0 shows that G is not output passive with this rho value. The R value gives a relative measure of the shortage of passivity.
% Copyright 2012 The MathWorks, Inc.