I want to solve following LMI, but i meet a problem

183 views
Skip to first unread message

mohamed lamine nacer

unread,
Nov 23, 2014, 3:40:44 AM11/23/14
to yal...@googlegroups.com

Hello, Johan Löfberg .

I'm new to yalmip, and,I want to solve following LMI, but i meet a problem:

A1 =[ -224 600 203 13429; -600 -224  -13429 203; 4   0   -9   0;
           0  4  0   -9];
A2 =[ -223.9  600.0  203.5 4476.3;-600.0   -223.9   -4476.3    203.5;
    4.0   0  -9.1  400.0; 0  0.0040 -0.4000 -0.0091];
A3 =[ -224  200 203 13429; -200  -224 -13429  203;
           4   0  -9   -400; 0   4  400  -9];
A4 = [-223.9 200.0  203.5  4476.3;-200.0  -223.9  -4476.3  203.5;
    4.0   0  -9.1  0; 0   4.0    0  -9.1];

u=-10000;uu=-200;b=100;
    

 X=sdpvar(4,4);
W1=sdpvar(2,4);
W2=sdpvar(2,4);
W3=sdpvar(2,4);
W4=sdpvar(2,4);
V =set([]);
V = V + set(X > 0);
 
V =V + set([X*A1-W1*C+A1'*X-C'*W1'-2*u*X 0;0 -X*A1+W1*C-A1'*X+C'*W1'+2*uu*X]<0);
V =V + set([-2*b*X  X*A1-W1*C+A1'*X-C'*W1';-(X*A1-W1*C+A1'*X-C'*W1')'  -2*b*X ]<0);
V =V + set([X*A2-W2*C+A2'*X-C'*W2'-2*u*X 0;0 -X*A2+W2*C-A2'*X+C'*W2'+2*uu*X]<0);
V =V + set([-2*b*X  X*A2-W2*C+A2'*X-C'*W2';-(X*A2-W2*C+A2'*X-C'*W2')'  -2*b*X ]<0);
V =V + set([X*A3-W3*C+A3'*X-C'*W3'-2*u*X 0;0 -X*A3+W3*C-A3'*X+C'*W3'+2*uu*X]<0);
V =V + set([-2*b*X  X*A3-W3*C+A3'*X-C'*W3';-(X*A3-W3*C+A3'*X-C'*W3')'  -2*b*X ]<0);

V =V + set([X*A4-W4*C+A4'*X-C'*W4'-2*u*X 0;0 -X*A4+W4*C-A4'*X+C'*W4'+2*uu*X]<0);
V =V + set([-2*b*X  X*A4-W4*C+A4'*X-C'*W4';-(X*A4-W4*C+A4'*X-C'*W4')'  -2*b*X ]<0);
solvesdp(V);
X=double(X);
W1=double(W1)
W2=double(W2)
W3=double(W3)
W4=double(W4)
L1=inv(X)*W1'
L2=inv(X)*W2'
L3=inv(X)*W3'
L4=inv(X)*W4'

And the result is:

Error using sdpvar/mtimes (line 502)

Inner matrix dimensions must agree.

Error in yalamp (line)

V =V + set([X*A1-W1*C+A1'*X-C'*W1'-2*u*X 0;0 -X*A1+W1*C-A1'*X+C'*W1'+2*uu*X]<0);

Thank you very much.


matlab.zip

Johan Löfberg

unread,
Nov 24, 2014, 2:19:43 AM11/24/14
to yal...@googlegroups.com
To begin with,m SET is an obsolete command that you should not use (and the fact that it still runs shows that you are using an old version of YALMIP). Additionally, don't use strict inequalities, it is only a theoretical notation with no practical relevance (it should display warnings)

I cannot run your code as you haven't supplied C. However, the error clearly suggests that the matrix dimensions in X*A1-W1*C+A1'*X-C'*W1'-2*u*X 0;0 -X*A1+W1*C-A1'*X+C'*W1'+2*uu*X don't match. It is rather obvious that it will fail. X*A1 is 4x4 and W1*C is 2x?

Finally, your theoretical model looks weird. You have a constraint [-2bX S;-S' -2bX] < 0. For that to be an LMI it has to be symmetric and thus you have to have S = -S. Looks like you have tried to squeeze a nonlinear nonconvex model into a linear form by a flawed Schur complement argument (I'm assuming real data)

mohamed lamine

unread,
Nov 24, 2014, 4:45:11 AM11/24/14
to yal...@googlegroups.com

Hi johan,

Thanks for your reply,this simulation task is based on article of Bahlol in attachment

I tried to correct my code as follows:

Matlab : (R2012a)

YALMIP version: R20131002 ,and SeDuMi_1_3 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


clear all;clc

Ls=0.462;Lr=0.462;Lsr=0.4402;Rs=5.72;Rr=4.2;Dm=0.0049;Rm=0.003;np=2;

Lm=Lsr;

sigma=1-(Lsr^2)/(Ls*Lr);

Tr=Lr/Rr;

gama=(Rs/(Ls*sigma))+((Lsr^2)/(Ls*sigma*Lr*Tr))

a1=(np*Lsr)/(Dm*Lr);

a2=-Rm/Dm;

a3=-1/Dm;

a4=-1/Tr;

a5=Lsr/Tr;

a6=Lsr/(Tr*sigma*Ls*Lr);

a7=(np*Lsr)/(sigma*Ls*Lr);

a8=1/(sigma*Ls);

u=-10000;uu=-200;b=100;

 A01=[-gama 0 a6 0 ;0 -gama 0 a6 ;a5 0 a4 0 ;0 a5 0 a4 ]

 A11=[0 0 0 a7 ;0 0 -a7 0 ;0 0 0 -np ;0 0 np 0]

 A21=[0 1 0 0 ;-1 0 0 0 ;0 0 0 1 ;0 0 -1 0]

B=[a8 0;0 a8;0 0;0 0]

C=[1 0 0 0;0 1 0 0]

D=[0 0;0 0]

wmax=300;wmin=100;wsmax=600;wsmin=200;

A1=A01+300*A11+600*A21;

A2=A01+100*A11+600*A21;

A3=A01+300*A11+200*A21;

A4=A01+100*A11+200*A21;



 X=sdpvar(4,4);

W1=sdpvar(4,2);

W2=sdpvar(4,2);

W3=sdpvar(4,2);

W4=sdpvar(4,2);

F = [X > 0];

 

F =[F,[X*A1-W1*C+A1'*X-C'*W1'-2*u*X zeros(4,4);zeros(4,4) -X*A1+W1*C-A1'*X+C'*W1'+2*uu*X]<0];

F =[F,[-2*b*X  X*A1-W1*C+A1'*X-C'*W1';-(X*A1-W1*C+A1'*X-C'*W1')'  -2*b*X ]<0];

F =[F,[X*A2-W2*C+A2'*X-C'*W2'-2*u*X zeros(4,4);zeros(4,4) -X*A2+W2*C-A2'*X+C'*W2'+2*uu*X]<0];

F =[F,[-2*b*X  X*A2-W2*C+A2'*X-C'*W2';-(X*A2-W2*C+A2'*X-C'*W2')'  -2*b*X ]<0];

F =[F,[X*A3-W3*C+A3'*X-C'*W3'-2*u*X zeros(4,4);zeros(4,4) -X*A3+W3*C-A3'*X+C'*W3'+2*uu*X]<0];

F =[F,[-2*b*X  X*A3-W3*C+A3'*X-C'*W3';-(X*A3-W3*C+A3'*X-C'*W3')'  -2*b*X ]<0];


F =[F,[X*A4-W4*C+A4'*X-C'*W4'-2*u*X zeros(4,4);zeros(4,4) -X*A4+W4*C-A4'*X+C'*W4'+2*uu*X]<0];

F =[F,[-2*b*X  X*A4-W4*C+A4'*X-C'*W4';-(X*A4-W4*C+A4'*X-C'*W4')'  -2*b*X ]<0];

 solvesdp(F,-trace(X))

%  solvesdp(F);

X=double(X);

W1=double(W1);

W2=double(W2);

W3=double(W3);

W4=double(W4);

L1=inv(X)*W1

L2=inv(X)*W2

L3=inv(X)*W3

L4=inv(X)*W4

%%%%%%%%%%%%%%%%%%%%%%%

And the result is:

The coefficient matrix is not full row rank, numerical problems may occur.

SeDuMi 1.3 by AdvOL, 2005-2008 and Jos F. Sturm, 1998-2003.

Alg = 2: xz-corrector, theta = 0.250, beta = 0.500

eqs m = 42, order n = 293, dim = 529, blocks = 6

nnz(A) = 1314 + 0, nnz(ADA) = 996, nnz(L) = 519

 it :     b*y       gap    delta  rate   t/tP*  t/tD*   feas cg cg  prec

  0 :            4.03E+07 0.000

  1 :  -1.59E-04 9.10E+06 0.000 0.2260 0.9000 0.9000   1.00  1  1  3.5E+04

  2 :  -1.45E-04 7.55E+05 0.000 0.0829 0.9900 0.9900   1.00  1  1  2.9E+03

  3 :  -4.05E-06 4.23E+04 0.000 0.0561 0.9900 0.9900   1.00  1  1  1.6E+02

  4 :  -1.93E-09 8.54E+00 0.000 0.0002 0.9999 0.9999   1.00  1  1  3.3E-02

  5 :  -4.24E-15 2.23E-05 0.000 0.0000 1.0000 1.0000   1.00  1  1  7.8E-08

  6 :  -2.96E-16 1.78E-06 0.000 0.0797 0.9900 0.9900   1.15  2  2  5.5E-09

  7 :  -5.05E-17 1.59E-06 0.000 0.8913 0.9000 0.9000  15.50  2  3  9.4E-10


iter seconds digits       c*x               b*y

  7      0.5   7.1  0.0000000000e+00 -5.0510257927e-17

|Ax-b| =   1.8e-09, [Ay-c]_+ =   4.3E-15, |x|=  6.0e+00, |y|=  3.9e-13


Detailed timing (sec)

   Pre          IPM          Post

5.000E-01    8.300E-01    6.001E-02    

Max-norms: ||b||=1, ||c|| = 0,

Cholesky |add|=0, |skip| = 4, ||L.L|| = 13429.7.


ans = 


    yalmiptime: 1.1000

    solvertime: 1.4500

          info: 'Successfully solved (SeDuMi-1.3)'

       problem: 0



L1 =


   1.0e+04 *


    0.5766   -1.0693

    1.0412   -0.5629

    0.6143   -2.0058

    1.9773   -0.5815



L2 =


   1.0e+03 *


    2.0502   -3.6327

    3.5020   -2.0452

    2.1892   -6.7365

    6.5770   -1.9141



L3 =


   1.0e+04 *


    0.5613   -1.0641

    1.0371   -0.5483

    0.6073   -2.0031

    1.9753   -0.5759



L4 =


   1.0e+03 *


    1.9165   -3.5786

    3.4577   -1.8871

    2.1515   -6.7123

    6.5531   -1.8336

Mohamed BAHLOUL_Takagi Sugeno Fuzzy Observer Based Direct Rotor Field Oriented Control of Induction Machine.pdf

Johan Löfberg

unread,
Nov 24, 2014, 8:42:23 AM11/24/14
to yal...@googlegroups.com
The third constraint in (31) makes no sense, as it is an unsymmetric matrix (unless \Xi is constrained to be 0). Hence, YALMIP interprets it as an elementwise constraint, i.e all elements must be non-negative (which also will lead to \Xi = 0). The presentation in the paper is wrong. Do the derivation and you will see that the off-diagonal blocks are wrong.
Message has been deleted

Johan Löfberg

unread,
Nov 26, 2014, 4:59:59 AM11/26/14
to yal...@googlegroups.com
As I said, the LMI stated is unsymmetric and makes no sense. There are sign-errors in the expression. Derive it your self to see, and note that the result in the appendix which you refer to is different from the result in the paper (i.e., the result in the appendix appears to be correct)

Are the authors of the book granting you the right to put this book on-line with public access? If not, delete your links.

Johan Löfberg

unread,
Nov 26, 2014, 5:15:43 AM11/26/14
to yal...@googlegroups.com
There are errors in the expression in the appendix too...Note the magically disappearing - in front of 2a. The expression A1.1 is incorrect also. Considering the multiple errors and typos, you should absolutely derive these things your self to make sure you are using correct expressions
Reply all
Reply to author
Forward
0 new messages