% sdpsol source invariant_ell -- find an invariant ellipsoid of a linear
% system with uncertain, time-varying, unity-bounded, diaginal feedback.
%
% feasibility sdp problem
%   find        P and D
%   subject to  [A^TP+PA+C^TDC  PB
%                B^TP           -D] <= 0
%               P > 0
%
% WARNING: cannot run using the stand-alone sdpsol from UNIX, since A,
%          B, C are not defined
n=cols(A);
p=cols(B);
variable P(n,n) symmetric;
variable D(p,p) diagonal;

[A'*P+P*A+C'*D*C, P*B;
 B'*P,            -D] < 0;
P > 0;