1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) INRIA -
4 // Copyright (C) 2012 - 2016 - Scilab Enterprises
6 // This file is hereby licensed under the terms of the GNU GPL v2.0,
7 // pursuant to article 5.3.4 of the CeCILL v.2.1.
8 // This file was originally licensed under the terms of the CeCILL v2.1,
9 // and continues to be available under such terms.
10 // For more information, see the COPYING file which you should have received
11 // along with this program.
14 function [enx,X,Y,eny]=entropy(S,gama)
15 //Computation of the entropy at gama of a linear system S
16 //[enx,X,Y,eny]=entropy(S,gama)
21 if S1(1)=="r" then S=tf2ss(S);end
24 H=[A,g1*B*B';-g1*C'*C,-A'];
25 [X,zero]=ric_desc(H); //zero=A'*X+X*A+g1*g1*X*B*B'*X+C'*C;
26 enx=sum(diag(X*B*B'));
27 J=[A',g1*C'*C;-g1*B*B',-A];
28 [Y,zero]=ric_desc(J); //zero=A*Y+Y*A'+g1*g1*Y*C'*C*Y+B*B'
29 eny=sum(diag(Y*C'*C));