Sign convention for enforcing positive definite matrix P ( 𝑃 ⪰ 𝜀 𝐼 ) using lmiterm in MATLAB LMI Toolbox (LMI)
48 views (last 30 days)
Show older comments
Manish Kumar
on 22 Dec 2025 at 2:30
Commented: Manish Kumar
on 30 Dec 2025 at 14:01
%% Common Lyapunov LMI using MATLAB LMI Toolbox
% 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
LHS≤0,
this corresponds to
−P+εI≤0.
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)?
0 Comments
Accepted Answer
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)
See Also
Categories
Find more on LMI Solvers in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!