"The coefficient matrix is not full row rank, numerical problems may occur. "" and " Infeasible problem (SeDuMi-1.3) "

134 views
Skip to first unread message

Vu Thanh

unread,
Nov 17, 2020, 6:14:57 AM11/17/20
to YALMIP
%%
clc
clear
close all


%% Define the parameter
J1 = 1.69;
C1 = 0.01;
K1 = 6652;
J2 = 0.01;
C2 = 0.02;
K2 = 2561;
J3 = 0.09;
C3 = 7.82;
K3 = 50.4;
C4 = 5.31;
K4 = 215;
Kt = 3.56; 
Ke = 3.32;
R  = 0.21;


%% Define the matrices  
A = [   0                      1                                             0                         0               0          0       0; 
    -(K1)/J1  (-(C1/J1)+((Kt*Ke)/(J1*R)))         K1/J1               C1/J1           0          0       0;
        0                         0                                             0                         1               0          0       0;
      K1/J2             C1/J2                          -(K1+K2+K4)/J2    -(C1+C2+C4)/J2    K2/J2     C2/J2     0;
        0               0                          0                0            0          1       0;
        0               0                        K2/J3            C2/J3      (-K2-K3)/J3 -C2/J3   K3/J3;
        0               0                          0                0          K3/C3        0    -K3/C3];

B = [   0;         -Kt/(J1*R);                0;               0;           0;         0;      0 ];

%% Output 
%C =eye(7);% [ 0 0 1 0 0 0 0];
C1 = [ 1 0 0 0 0 0 0;
       0 1 0 0 0 0 0;
       0 0 1 0 0 0 0;
       0 0 0 1 0 0 0;
       0 0 0 0 1 0 0;
       0 0 0 0 0 1 0;
       0 0 0 0 0 0 1];
%C2 =[0; 0; 1; 0; 0; 0; 0];
D2 = zeros(7,1);

%% figure


p1 = eig(A)

p = 1.0e+02 * [-2.6409 + 9.3842i ; -2.6409 - 9.3842i ; -0.0553 + 1.4895i ; -0.0553 - 1.4895i ;   -0.0298 + 0.0000i ;  -0.0843 + 0.0000i ;   -0.2933 + 0.0000i ];

K = - place(A,B,p) %関数”place”ではBのランクを超える固有値の重複は許されない。

eig(A+B*K)

sim('test2model');
figure
plot(t,x(:,3));
ylabel('blade_angel');
xlim([0 2]);
saveas(gcf,'blade_angel.png');

figure
plot(t,x(:,4));
ylabel('blade_dot');
xlim([0 1]);
saveas(gcf,'blade_dot.png');


%% LMI可解問題

n = length(A);     %n:x(t)の次元

alpha = 2;         %alpha=2

ep = 1e-6;         %十分小さな正数 = 10^(-6)

P = sdpvar(n,n,'sy');

LMI = [P >= ep*eye(n)];

LMI2 = LMI + [A'*P + P*A +2*alpha*P <= -ep*eye(n)];

solvesdp(LMI2)     %LMI可解問題の求解

P2 = double(P)      %実行能解 P を表示


And Result

The coefficient matrix is not full row rank, numerical problems may occur.
SeDuMi 1.3.4 by AdvOL, 2005-2008 and Jos F. Sturm, 1998-2003.
Alg = 2: xz-corrector, theta = 0.250, beta = 0.500
eqs m = 28, order n = 22, dim = 148, blocks = 4
nnz(A) = 190 + 0, nnz(ADA) = 784, nnz(L) = 406
 it :     b*y       gap    delta  rate   t/tP*  t/tD*   feas cg cg  prec
  0 :            6.46E+11 0.000
  1 :   0.00E+00 1.33E+11 0.000 0.2052 0.9000 0.9000   1.00  1  1  7.7E+05
  2 :   0.00E+00 2.56E+10 0.000 0.1928 0.9000 0.9000   1.00  1  1  1.5E+05
  3 :   0.00E+00 5.01E+09 0.000 0.1960 0.9000 0.9000   1.00  1  1  2.9E+04
  4 :   0.00E+00 1.57E+08 0.000 0.0313 0.9900 0.9900   1.00  1  1  9.2E+02
  5 :   0.00E+00 3.20E+07 0.000 0.2035 0.9000 0.9000   0.88  1  1  2.1E+02
  6 :   0.00E+00 2.40E+06 0.000 0.0751 0.9900 0.9900   0.50  1  1  2.6E+01
  7 :   0.00E+00 4.83E+05 0.000 0.2014 0.9000 0.9000  -0.70  1  1  2.7E+01
  8 :   0.00E+00 3.02E+04 0.000 0.0625 0.9900 0.9900  -0.96  1  1  2.9E+01
  9 :   0.00E+00 8.19E+02 0.000 0.0271 0.9900 0.9900  -1.00  1  1  2.9E+01
 10 :   0.00E+00 2.16E+01 0.000 0.0264 0.9900 0.9900  -1.00  1  1  2.9E+01
 11 :   0.00E+00 5.69E-01 0.000 0.0264 0.9900 0.9900  -1.00  2  2  2.9E+01
 12 :   0.00E+00 1.50E-02 0.000 0.0264 0.9900 0.9900  -1.00  2  2  2.9E+01
 13 :   0.00E+00 3.85E-04 0.000 0.0257 0.9900 0.9900  -1.00  2  2  2.9E+01
 14 :   0.00E+00 1.16E-04 0.000 0.3006 0.9000 0.9000  -1.00  2  3  2.9E+01
 15 :   0.00E+00 2.27E-05 0.000 0.1965 0.9000 0.9000  -1.00  3  3  2.4E+01
Run into numerical problems.

iter seconds  |Ax|    [Ay]_+     |x|       |y|
 15      0.1   4.8e-08   3.0e-17   6.0e+00   5.0e-17
Failed: no sensible solution/direction found.

Detailed timing (sec)
   Pre          IPM          Post
2.002E-03    5.899E-02    1.006E-03    
Max-norms: ||b||=0, ||c|| = 1.000000e-06,
Cholesky |add|=0, |skip| = 0, ||L.L|| = 45.7594.

ans = 

  フィールドをもつ struct:

    yalmipversion: '20200930'
    matlabversion: '9.4.0.813654 (R2018a)'
       yalmiptime: 0.1846
       solvertime: 0.0624
             info: 'Infeasible problem (SeDuMi-1.3)'
          problem: 1


P2 =

   1.0e-16 *

   -0.1911   -0.0329    0.0184    0.0670    0.0223    0.0604    0.0076
   -0.0329    0.0239   -0.0547    0.0001   -0.0475    0.0011    0.0243
    0.0184   -0.0547   -0.2224   -0.0928    0.0027    0.0090    0.0057
    0.0670    0.0001   -0.0928   -0.0001    0.0229    0.0000    0.0002
    0.0223   -0.0475    0.0027    0.0229   -0.2217   -0.0799    0.0052
    0.0604    0.0011    0.0090    0.0000   -0.0799    0.0000    0.0031
    0.0076    0.0243    0.0057    0.0002    0.0052    0.0031   -0.2902

Johan Löfberg

unread,
Nov 17, 2020, 6:28:38 AM11/17/20
to YALMIP
First, there is no official command called solvesdp

The problem you pose is simply not feasible, as SeDuMi tells you. This is trivial to see

For A'*P + P*A + 2*alpha*P <= 0 to hold, with positive alpha and positive definite P, it must hold that  A'*P + P*A < 0 . That condition is equivalent with A being stable, which it isn''t

>> eig(A)
ans =
   1.0e+02 *
  -2.6402 + 9.3835i
  -2.6402 - 9.3835i
  -0.0103 + 1.4868i
  -0.0103 - 1.4868i
   0.2299 + 0.0000i
   0.0554 + 0.0000i
  -0.0580 + 0.0000i


Message has been deleted

Vu Thanh

unread,
Nov 17, 2020, 8:44:41 AM11/17/20
to YALMIP
Thank you for your response.  

I have a mistake in A matrix , and i fixed it . Then , i run code again , and i got unwanted result

%%
clc
clear
close all


%% Define the parameter
J1 = 1.69;
C1 = 0.01;
K1 = 6652;
J2 = 0.01;
C2 = 0.02;
K2 = 2561;
J3 = 0.09;
C3 = 7.82;
K3 = 50.4;
C4 = 5.31;
K4 = 215;
Kt = 3.56; 
Ke = 3.32;
R  = 0.21;


%% Define the matrices
A = [   0               1                          0                0            0          0       0; 
    -(K1)/J1  ((C1/J1)-((Kt*Ke)/(J1*R)))         K1/J1            C1/J1          0          0       0;

================================================================================
and Result

The coefficient matrix is not full row rank, numerical problems may occur.
SeDuMi 1.3.4 by AdvOL, 2005-2008 and Jos F. Sturm, 1998-2003.
Alg = 2: xz-corrector, theta = 0.250, beta = 0.500
eqs m = 28, order n = 22, dim = 148, blocks = 4
nnz(A) = 190 + 0, nnz(ADA) = 784, nnz(L) = 406
 it :     b*y       gap    delta  rate   t/tP*  t/tD*   feas cg cg  prec
  0 :            6.46E+11 0.000
  1 :   0.00E+00 1.42E+11 0.000 0.2192 0.9000 0.9000   1.00  1  1  8.3E+05
  2 :   0.00E+00 3.15E+10 0.000 0.2225 0.9000 0.9000   1.00  1  1  1.8E+05
  3 :   0.00E+00 6.09E+09 0.000 0.1931 0.9000 0.9000   1.00  1  1  3.6E+04
  4 :   0.00E+00 2.32E+08 0.000 0.0381 0.9900 0.9900   1.00  1  1  1.4E+03
  5 :   0.00E+00 4.27E+07 0.000 0.1840 0.9000 0.9000   0.92  1  1  2.7E+02
  6 :   0.00E+00 2.84E+06 0.000 0.0665 0.9900 0.9900   0.60  1  1  2.7E+01
  7 :   0.00E+00 5.91E+05 0.000 0.2082 0.9000 0.9000  -0.65  1  1  2.6E+01
  8 :   0.00E+00 3.76E+04 0.000 0.0636 0.9900 0.9900  -0.95  1  1  2.9E+01
  9 :   0.00E+00 1.17E+03 0.000 0.0312 0.9900 0.9900  -1.00  1  1  2.9E+01
 10 :   0.00E+00 3.64E+01 0.000 0.0311 0.9900 0.9900  -1.00  1  1  2.9E+01
 11 :   0.00E+00 1.10E+00 0.000 0.0301 0.9900 0.9900  -1.00  1  2  2.9E+01
 12 :   0.00E+00 3.40E-02 0.000 0.0310 0.9900 0.9900  -1.00  2  2  2.9E+01
 13 :   0.00E+00 1.06E-03 0.000 0.0312 0.9900 0.9900  -1.00  2  2  2.9E+01
 14 :   0.00E+00 5.58E-05 0.000 0.0525 0.9900 0.9900  -1.00  2  3  3.1E+01
 15 :   0.00E+00 3.24E-05 0.000 0.5804 0.9000 0.9000  -1.00  3  3  3.0E+01
 16 :   0.00E+00 2.13E-05 0.000 0.6587 0.9000 0.9000  -1.00  3  3  3.0E+01
Run into numerical problems.

iter seconds  |Ax|    [Ay]_+     |x|       |y|
 16      0.1   5.1e-08   1.9e-17   6.1e+00   3.2e-17
Failed: no sensible solution/direction found.

Detailed timing (sec)
   Pre          IPM          Post
2.997E-03    6.100E-02    0.000E+00    
Max-norms: ||b||=0, ||c|| = 1.000000e-06,
Cholesky |add|=0, |skip| = 0, ||L.L|| = 71.3251.

ans = 

  フィールドをもつ struct:

    yalmipversion: '20200930'
    matlabversion: '9.4.0.813654 (R2018a)'
       yalmiptime: 0.3520
       solvertime: 0.0640
             info: 'Infeasible problem (SeDuMi-1.3)'
          problem: 1


P2 =

   1.0e-16 *

   -0.1414   -0.0360    0.0044    0.0384    0.0158    0.0416    0.0003
   -0.0360   -0.0329   -0.0495   -0.0002   -0.0413   -0.0016    0.0040
    0.0044   -0.0495   -0.1260   -0.0531    0.0102    0.0081    0.0003
    0.0384   -0.0002   -0.0531   -0.0000    0.0127   -0.0000    0.0001
    0.0158   -0.0413    0.0102    0.0127   -0.1388   -0.0587    0.0015
    0.0416   -0.0016    0.0081   -0.0000   -0.0587   -0.0001    0.0015
    0.0003    0.0040    0.0003    0.0001    0.0015    0.0015   -0.1774

2020年11月17日火曜日 20:28:38 UTC+9 Johan Löfberg:

Johan Löfberg

unread,
Nov 17, 2020, 1:11:36 PM11/17/20
to YALMIP
You have a classical case of bad formatting with spaces in matlab

>> [A'*P + P*A +2*alpha*P  <= -ep*eye(n)]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|   ID|              Constraint|      Coefficient range|
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|   #1|   Matrix inequality 7x7|   0.0059172 to 1885600|
|   #2|   Matrix inequality 7x7|             1e-06 to 4|
++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Reply all
Reply to author
Forward
0 new messages