Feaseability problem solving


(hamide) #1

hi
i try to solve this lmi using CVX but it is infeasible. could you please check this m file.

x0 = [.5;.5]; %initial condition vector
A=[0 1;0 -10];
B=[0;1];
C=[4 0];
D=0;
E=[0.1;0.1];
Ts=.01;
%State-Space Model
sys = ss(A, B, C, D);
%discrete State-Space Model
sys_d = c2d(sys, Ts);
[Ad, Bd, Cd, Dd] = ssdata(sys_d);
%State-Space Model
%n = size(A,1);
Aaug=[Ad zeros(2,1);Cd eye(1,1)];
Baug=[Bd;zeros(1,1)];
Caug=[Cd zeros(1,1)];
Eaug=[E zeros(2,2);zeros(1,1) 0 -1];
n = size(Aaug,1);
%State-Space Model

cvx_begin sdp
variable sigmax
variable gamasq
variable S(n,n) symmetric
variable G(n,n)
variable F(1,n)

%minimize (gamasq)
%minimize (sigmax)
%subject to
S > 0
[G’+G-S zeros(n,n) zeros(n,n) GAaug’+F’Baug’ G GCaug’;
zeros(n,n) eye(n,n) zeros(n,n) eye(n,n) zeros(n,n) zeros(n,1);
zeros(n,n) zeros(n,n) gamasq
eye(n,n) Eaug’ zeros(n,n) zeros(n,1);
AaugG’+BaugF eye(n,n) Eaug S zeros(n,n) zeros(n,1);
G’ zeros(n,n) zeros(n,n) zeros(n,n) sigmaxeye(n,n) zeros(n,1);
Caug
G’ zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) 1]>0

cvx_end
%sigma1=1/sigmax;
%sigma1=.254
P=inv(S);
K_LQR=(G*P);

%% LQR Simulation
open(‘moningeventcontcvx’);
while(~exist(‘moningeventcontcvx’))
pause(1);
end;


(Mark L. Stone) #2

Your code is not reproducible by people who don’t have the required toolboxes. I suggest you re-write it so that it is reproducible without the toolboxes.

Have you at least checked whether the block diagonal of the big LMI LHS is feasible, i.e., that all blocks on the diagonal have feasible positive definite solutions. That is necessary, but not sufficient for the big LM I to be positive definite. Note that CVX will actually provide the > 0 LMI’s as >= 0 LMI’s, i.e, enforcing, within tolerance, that minimum eigenvalue >= 0, not that minimum eigenvalue > 0. if you need strict positive definiteness, you will need to add a “fudge factor”. For instance, LHS - small_positive_number*eye("correct dimension") >= 0

in order to determine how far from feasibiliity your problem is, you can include an objective which maximizes the minimum eigenvalue of one of or sum of S and big LMI LHS and remove the corresponding constraint(s).

If you do all of this, you should start getting some insight.


(hamide) #3

hi
sorry I don’t get the point. you mean the problem is in code? how can I reproduce the code? and should I solve the problem for >=0 ???


(hamide) #4

hi

I write my code as a word file I hope you can run it because I cant find the problem at all and this LMI is feasible in LMISOLVER. but I want to solve it using CVX.

thank you so much for your hel.


(hamide) #5

Untitled1 Untitled


(Mark L. Stone) #6

I mean that toolbox(es) are required to run your code. I don’t have them. Some other readers who might be able to help you might not have then. You need to get the output from running the toolbox commands and provide that output as input (MATLAB assignment) which doesn’t require the toolbox(es).

Enter your code as Prefomatted text (use the icon) so that readers can copy and paste your code into their own MATLAB session. Do not post code “images”.

You wrote:

I write my code as a word file I hope you can run it because I cant find the problem at all and this LMI is feasible in LMISOLVER. but I want to solve it using CVX

Are you referring to .https://help.scilab.org/doc/5.5.2/en_US/lmisolver.html ? Aside from differences in solvers, perhaps the model you entered in CVX is not equivalent to what you entered into lmisolver. Given that lmisolver reported feasibility, I suggest you try additional solvers under CVX (Mosek, SDPT3, Sedumi). Also, follow the general advice I provided in my previous post.