A=rand(4) A = 0.9501 0.8913 0.8214 0.9218 0.2311 0.7621 0.4447 0.7382 0.6068 0.4565 0.6154 0.1763 0.4860 0.0185 0.7919 0.4057 eig(A) ans = 2.3230 0.0914 + 0.4586i 0.0914 - 0.4586i 0.2275 A=A-3*eye(4) A = -2.0499 0.8913 0.8214 0.9218 0.2311 -2.2379 0.4447 0.7382 0.6068 0.4565 -2.3846 0.1763 0.4860 0.0185 0.7919 -2.5943 lmis=set([ ]) empty SET P=sdpvar(4) Linear matrix variable 4x4 (symmetric, real, 10 variables) lmis=lmis+set(P>0) +++++++++++++++++++++++++++++++++++++++++++++++++ | ID| Constraint| Type| +++++++++++++++++++++++++++++++++++++++++++++++++ | #1| Numeric value| Matrix inequality 4x4| +++++++++++++++++++++++++++++++++++++++++++++++++ lmis=lmis+set(A'*P+P*A+eye(4)<0) +++++++++++++++++++++++++++++++++++++++++++++++++ | ID| Constraint| Type| +++++++++++++++++++++++++++++++++++++++++++++++++ | #1| Numeric value| Matrix inequality 4x4| | #2| Numeric value| Matrix inequality 4x4| +++++++++++++++++++++++++++++++++++++++++++++++++ sol=solvesdp(lmis,trace(P)) SeDuMi 1.1R3 by AdvOL, 2006 and Jos F. Sturm, 1998-2003. Alg = 2: xz-corrector, theta = 0.250, beta = 0.500 eqs m = 10, order n = 9, dim = 33, blocks = 3 nnz(A) = 68 + 0, nnz(ADA) = 100, nnz(L) = 55 it : b*y gap delta rate t/tP* t/tD* feas cg cg prec 0 : 5.74E+00 0.000 1 : -1.35E+00 1.90E+00 0.000 0.3310 0.9000 0.9000 2.23 1 1 2.5E+00 2 : -1.31E+00 5.93E-01 0.000 0.3122 0.9000 0.9000 2.38 1 1 4.6E-01 3 : -1.30E+00 2.48E-02 0.000 0.0418 0.9900 0.9900 1.41 1 1 1.6E-02 4 : -1.30E+00 2.22E-06 0.354 0.0001 1.0000 1.0000 1.01 1 1 1.4E-06 5 : -1.30E+00 6.19E-09 0.195 0.0028 0.9990 0.9990 1.00 1 1 4.0E-09 6 : -1.30E+00 1.30E-11 0.000 0.0021 0.9990 0.9990 1.00 1 1 8.3E-12 iter seconds digits c*x b*y 6 0.2 Inf -1.3044668936e+00 -1.3044668936e+00 |Ax-b| = 1.3e-11, [Ay-c]_+ = 1.6E-12, |x|= 8.4e-01, |y|= 7.5e-01 Detailed timing (sec) Pre IPM Post 1.400E-01 1.900E-01 5.000E-02 Max-norms: ||b||=1, ||c|| = 1, Cholesky |add|=0, |skip| = 0, ||L.L|| = 1.10477. sol = yalmiptime: 0.6760 solvertime: 0.4782 info: 'No problems detected (SeDuMi-1.1)' problem: 0 dimacs: [6.7491e-12 0 0 8.0046e-13 -7.1974e-13 7.6965e-13] Plmi=double(P) Plmi = 0.3501 0.1442 0.1790 0.1559 0.1442 0.3118 0.1465 0.1246 0.1790 0.1465 0.3488 0.1508 0.1559 0.1246 0.1508 0.2938 PLyap=lyap(A',eye(4)) PLyap = 0.3501 0.1442 0.1790 0.1559 0.1442 0.3118 0.1465 0.1246 0.1790 0.1465 0.3488 0.1508 0.1559 0.1246 0.1508 0.2938 abs(Plmi-PLyap) ans = 1.0e-11 * 0.0204 0.1156 0.0135 0.0643 0.1156 0.1727 0.0603 0.0654 0.0135 0.0603 0.0367 0.0303 0.0643 0.0654 0.0303 0.0717 checkset(lmis) +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ID| Constraint| Type| Primal residual| Dual residual| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | #1| Numeric value| Matrix inequality| 0.16328| 7.7447e-14| | #2| Numeric value| Matrix inequality| -1.6009e-12| 0.1634| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++