/*
 * sdpsol source of the example given in the user's guide
 */

/* give A1, A2, and B */
A1 = [-1, 0, 1; 0, -2, 1; 0, 0, -1];
A2 = A1 + 0.1*A1';
B = [1, 2; 3, 4; 5, 6];
/* variable declarations */
variable P(3,3) symmetric;   /* P is a 3x3 symmetric matrix */
variable D(2,2) diagonal;    /* D is a 2x2 diagonal matrix */
/* constraints */
A1'*P+P*A1 + B*D*B' < 0;
A2'*P+P*A2 + B*D*B' < 0;
P > 0;
D > 0;
Tr(D) == 1;
/* objective */
minimize trace = Tr(P);
