%%%% lyapunov_shift.m

clear; format compact
% --- ƒXƒeƒbƒv 1 ---------
A = [ 0  1
     -2 -3 ];
% --- ƒXƒeƒbƒv 2 ---------
P = sdpvar(2,2,'sy');
% --- ƒXƒeƒbƒv 3 ---------
LMI = set([]);
M = P*A + A'*P;
LMI = LMI + set(M < 0);
LMI = LMI + set(P > 0);
LMI = LMI + set(trace(P) == 1);
% --- ƒXƒeƒbƒv 4 ---------
ops = sdpsettings; ops.shift = 1e-7;
sol = solvesdp(LMI,[],ops)
% ------------------------
if sol.problem ~= 1 
  % --- ƒXƒeƒbƒv 5 -------
  P_feas = double(P)  
  sign(eig(double(P))')
  sign(eig(double(-M))')
end
