We can ignore the polytopic part for now.
clear all
clc
fs = 10000.0;
Ts = 1/fs;
fg = 60;
wg = 2*pi*fg;
R = 0.5;
L = 1.7e-3;
A=[R/L wg;
-wg R/L];
B=[1/L 0;
0 1/L];
C=eye(2);
D=zeros(2);
[Ade, Bde] = c2d(A, B, Ts);
% Integral model
Ai = zeros(2,2);
Bi = eye(2);
[Aide, Bide] = c2d(Ai, Bi, Ts);
AA = [Ade, zeros(2,2); -Bide*C, Aide];
BB = [Bde; zeros(2,2)];
% declare variables
Q = sdpvar(4,4);
Y = sdpvar(2,4);
Qi = sdpvar(4,4);
alpha = sdpvar(1,1);
% declare LMIs
LMI1 = Qi;
LMI2 = [Qi (AA*Qi+BB*Y)';
AA*Qi+BB*Y Q];
LMI = [LMI1 >= 0, LMI2 >= 0, Q<(alpha*Qi), 0<alpha, alpha<1];
options = sdpsettings('solver','penlab','verbose',1,'warning',1);
solution = optimize(LMI,alpha,options);
K = double(Y)*inv(double(Qi));
When I run the code, sometime I got message "PenLab didn't converge: unconstrained minimization failed" or the Matlab just stuck at some iteration (for example iteration number 8) and no result comes out even after I wait for a long time. And then I need to stop the running code because the Matlab won't continue the simulation.
Thank you.