[37] | 1 |
|
---|
| 2 | function [A,Bperp,Ctperp,y,info,X,Y] = lmiranktest2
|
---|
| 3 | % [A,Bperp,Ctperp,y,info,X,Y] = lmiranktest2;
|
---|
| 4 | %
|
---|
| 5 | % LMIRANKTEST2 runs a test problem for LMIRANK.
|
---|
| 6 | % The problem is a two-mass-spring, reduced order output feedback problem
|
---|
| 7 | % considered in
|
---|
| 8 | %
|
---|
| 9 | % R. Orsi, U. Helmke, and J. B. Moore. A Newton-like method for solving
|
---|
| 10 | % rank constrained linear matrix inequalities. In Proceedings of the
|
---|
| 11 | % 43rd IEEE Conference on Decision and Control, pages 3138-3144,
|
---|
| 12 | % Paradise Island, Bahamas, 2004.
|
---|
| 13 | %
|
---|
| 14 | % It is of the form:
|
---|
| 15 | %
|
---|
| 16 | % Find symmetric matrices X and Y such that
|
---|
| 17 | %
|
---|
| 18 | % -Bperp*(A*X+X*A')*Bperp' > 0, (1)
|
---|
| 19 | % -Ctperp*(Y*A+A'*Y)*Ctperp' > 0, (2)
|
---|
| 20 | % [X I; I Y] >= 0, (3)
|
---|
| 21 | % rank[X I; I Y] <= n + k. (4)
|
---|
| 22 | %
% The code first uses YALMIP to convert constraints (1), (2) and (3) into
|
---|
| 23 | % the SeDuMi data format. (This is the format used by LMIRANK.) After
|
---|
| 24 | % specifying the rank constraint, LMIRANK is called. Using the solution of
|
---|
| 25 | % LMIRANK, X and Y are reconstructed using YALMIP. Finally, the minimum
|
---|
| 26 | % eigenvalues of the left hand sides of (1), (2) and (3) are displayed,
|
---|
| 27 | % along with the rank in (4).
|
---|
| 28 | %
|
---|
| 29 | % See also LMIRANK.
|
---|
| 30 |
|
---|
| 31 | % Author Robert Orsi
|
---|
| 32 | % Feb 2005
|
---|
| 33 |
|
---|
| 34 |
|
---|
| 35 | %%%% Problem data
|
---|
| 36 | alpha=0.2;
|
---|
| 37 | A=[ 0 0 1 0; 0 0 0 1; -1 1 0 0; 1 -1 0 0];
|
---|
| 38 | A=A+alpha*eye(size(A));
|
---|
| 39 | Bperp=[1 0 0 0; 0 1 0 0; 0 0 0 1 ];
|
---|
| 40 | Ctperp=[1 0 0 0; 0 0 1 0; 0 0 0 1];
|
---|
| 41 | epsilon = 1e-6;
|
---|
| 42 | k=2; % controller order
|
---|
| 43 |
|
---|
| 44 | %%%% Determine various sizes
|
---|
| 45 | n=size(A,2);
|
---|
| 46 | m=size(Bperp,1);
|
---|
| 47 | p=size(Ctperp,1);
|
---|
| 48 |
|
---|
| 49 | %%%% Create A,c,K using YALMIP
|
---|
| 50 | yalmip('clear');
|
---|
| 51 | X=sdpvar(n,n);
|
---|
| 52 | Y=sdpvar(n,n);
|
---|
| 53 | M1=-Bperp*(A*X+X*A')*Bperp';
|
---|
| 54 | M2=-Ctperp*(Y*A+A'*Y)*Ctperp';
|
---|
| 55 | M3=[X eye(n); eye(n) Y];
|
---|
| 56 | F=set( M1 > epsilon*eye(m) ) + set( M2 > epsilon*eye(p) ) + set( M3 > 0 );
|
---|
| 57 | [model,recoverymodel] = export(F,[],sdpsettings('solver','sedumi'));
|
---|
| 58 | At=model.A;
|
---|
| 59 | c=model.C;
|
---|
| 60 | K.s=model.K.s;
|
---|
| 61 |
|
---|
| 62 | %%%% Specify rank constraint
|
---|
| 63 | K.rank=[m p (n+k)];
|
---|
| 64 |
|
---|
| 65 | %%%% Call LMIRank
|
---|
| 66 | pars.itermod=10;
|
---|
| 67 | [y,info] = lmirank(At,c,K,pars);
|
---|
| 68 |
|
---|
| 69 | %%%% Reconstruct X and Y from y using YALMIP
|
---|
| 70 | setsdpvar(recover(recoverymodel.used_variables),y);
|
---|
| 71 | X=double(X);
|
---|
| 72 | Y=double(Y);
|
---|
| 73 |
|
---|
| 74 | %%%% Testing
|
---|
| 75 | M1=double(M1);
|
---|
| 76 | M2=double(M2);
|
---|
| 77 | M3=double(M3);
|
---|
| 78 | disp(' ');
|
---|
| 79 | disp(['min eig M1 = ',num2str(min(eig(M1)),2)]);
|
---|
| 80 | disp(['min eig M2 = ',num2str(min(eig(M2)),2)]);
|
---|
| 81 | disp(['min eig M3 = ',num2str(min(eig(M3)),2)]);
|
---|
| 82 | disp(['rank M3 = ',num2str(rank(M3),2)]);
|
---|
| 83 | disp(' ');
|
---|
| 84 |
|
---|