Sign convention for enforcing positive definite matrix P ( 𝑃 ⪰ 𝜀 𝐼 ) using lmiterm in MATLAB LMI Toolbox (LMI)

48 views (last 30 days)
%% Common Lyapunov LMI using MATLAB LMI Toolbox
Solver for LMI feasibility problems L(x) < R(x) This solver minimizes t subject to L(x) < R(x) + t*I The best value of t should be negative for feasibility Iteration : Best value of t so far 1 -0.226331 Result: best value of t: -0.226331 f-radius saturation: 0.000% of R = 1.00e+09
Feasible P:
0.4133 0.0704 0.0704 0.2539
Eigenvalues of P:
0.2273 0.4400
% Example system matrices (can be replaced by A_rule{k})
A_rule{1} = [-1 2;
0 -3];
A_rule{2} = [-2 1;
-1 -4];
N = numel(A_rule);
n = size(A_rule{1},1);
setlmis([])
% Decision variable: symmetric P
p = lmivar(1,[n 1]);
% Stability LMIs: A_k' P + P A_k <= 0
for k = 1:N
L = newlmi;
lmiterm([L 1 1 p],1,A_rule{k},'s');
end
% Positivity constraint: P >= eps*I ?
eps = 1e-6;
S = newlmi;
% ---- QUESTION IS ABOUT THESE TWO LINES ----
lmiterm([-S 1 1 p],1,1); % term involving P
lmiterm([-S 1 1 0],eps*eye(n)); % constant term
% ------------------------------------------
lmis = getlmis;
[tmin,xfeas] = feasp(lmis);
if tmin < 1e-6
P = dec2mat(lmis,xfeas,p);
disp('Feasible P:');
disp(P)
disp('Eigenvalues of P:');
disp(eig(P))
else
disp('No feasible solution.');
end
In the code above, I want to enforce the Lyapunov positivity constraint PεI.
Since all LMIs in the MATLAB LMI Toolbox are interpreted as
LHS0,
this corresponds to
P+εI0.
Do the two lines
lmiterm([-S 1 1 p],1,1);
lmiterm([-S 1 1 0],eps*eye(n));
correctly enforce PεI according to the official LMI Toolbox convention?
If not, what is the recommended and unambiguous way to impose this constraint (e.g., using explicit negative coefficients on P)?

Accepted Answer

Sam Chak
Sam Chak on 22 Dec 2025 at 9:03
I believe I made an error in my previous comment from another thread. LMIs appear deceptively simple but can be logically unforgiving, particularly regarding signs and certain command lines, without a clear understanding of the underlying mathematics.
Although your code does not affect the result, the following commands will effectively enforce the Lyapunov positivity constraint::
lmiterm([-S 1 1 p], 1, 1); % -S places "P" on the RHS of the inequality: 0 < P
% lmiterm([-S 1 1 0], eps*eye(n)); % -S places "ε*I" → 0 < P + ε*I, which implies -ε*I < P (weak condition)
lmiterm([ S 1 1 0], eps*eye(n)); % +S places "ε*I" on the LHS of the inequality: ε*I < P

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!