Numerical problems (SeDuMi-1.3)

312 views
Skip to first unread message

mohammad hassan

unread,
Mar 7, 2019, 10:57:49 AM3/7/19
to YALMIP
Dear Yohan Löfberg

I'm new in using Yalmip solver.
I have problem 'Numerical problems (SeDuMi-1.3)' in solve linear matrix inequality.

I run the following code
I also send the code file in the attachment.
---------------------------------------------------------------------------
clc
clear all

% Define parameters
A1 = 1e+04 * [-0.0000    0.0000    0.0000    0.0000    0.0000
    0   -0.0002    4.4982         0         0
    0    0.0000   -0.0003    0.0000    0.0000
    0    0.0002         0   -0.0000    0.0001
    0         0    0.0002         0   -0.0002];

A2 = 1e+04 * [-0.0000    0.0000    0.0000    0.0000    0.0000
    0   -0.0002    4.4982         0         0
    0    0.0000   -0.0003    0.0000    0.0000
    0    0.0002         0   -4.4976    0.0001
    0         0    0.0002         0   -0.0002];

A3 = [-0.0030    0.4640    0.4640    0.4640    0.4640
    0   -2.4600    0.0042         0         0
    0    0.1000   -2.7510    0.0003    0.2978
    0    1.9000         0   -0.4631    1.0622
    0         0    2.2910         0   -1.8200];

A4 = 1e+04 * [-0.0000    0.0000    0.0000    0.0000    0.0000
    0   -0.0002    0.0000         0         0
    0    0.0000   -0.0003    0.0000    0.0000
    0    0.0002         0   -4.4976    0.0001
    0         0    0.0002         0   -0.0002];

A5 = 1e+05 * [-1.1244    0.0000    0.0000    0.0000    0.0000
    0   -0.0000    0.4498         0         0
    0    0.0000   -0.0000    0.0000    0.0000
    0    0.0000         0   -0.0000    0.0000
    0         0    0.0000         0   -0.0000];

A6 = 1e+05 * [-1.1244    0.0000    0.0000    0.0000    0.0000
    0   -0.0000    0.4498         0         0
    0    0.0000   -0.0000    0.0000    0.0000
    0    0.0000         0   -0.4498    0.0000
    0         0    0.0000         0   -0.0000];

A7 = 1e+05 * [-1.1244    0.0000    0.0000    0.0000    0.0000
    0   -0.0000    0.0000         0         0
    0    0.0000   -0.0000    0.0000    0.0000
    0    0.0000         0   -0.0000    0.0000
    0         0    0.0000         0   -0.0000];

A8 = 1e+05 * [-1.1244    0.0000    0.0000    0.0000    0.0000
    0   -0.0000    0.0000         0         0
    0    0.0000   -0.0000    0.0000    0.0000
    0    0.0000         0   -0.4498    0.0000
    0         0    0.0000         0   -0.0000];

B1 = [0 0
    0 0
    -0.75 0
    0 -0.6
    0.75 0.6];

B2 = B1;
B3 = B1;
B4 = B1;
B5 = B1;
B6 = B1;
B7 = B1;
B8 = B1;

Pb = sdpvar(5,5);
Kb = sdpvar(2,5);

M1 = A1*Pb+B1*Kb+transpose(A1*Pb+B1*Kb);
M2 = A2*Pb+B2*Kb+transpose(A2*Pb+B2*Kb);
M3 = A3*Pb+B3*Kb+transpose(A3*Pb+B3*Kb);
M4 = A4*Pb+B4*Kb+transpose(A4*Pb+B4*Kb);
M5 = A5*Pb+B5*Kb+transpose(A5*Pb+B5*Kb);
M6 = A6*Pb+B6*Kb+transpose(A6*Pb+B6*Kb);
M7 = A7*Pb+B7*Kb+transpose(A7*Pb+B7*Kb);
M8 = A8*Pb+B8*Kb+transpose(A8*Pb+B8*Kb);

Constraints = [Pb >= 0, M1 <= 0, M2 <= 0, M3 <= 0, M4 <= 0, M5 <= 0, M6 <= 0, M7 <= 0, M8 <= 0];

options = sdpsettings('verbose',1,'solver','sedumi','quadprog.maxiter',100);

sol = optimize(Constraints,[],options);

if sol.problem == 0
    % Extract and display value
    disp('Pb =')
    disp(value(Pb))
    disp('Kb =')
    disp(value(Kb))
else
    disp('Hmm, something went wrong!');
    sol.info
    yalmiperror(sol.problem)
end
---------------------------------------------------------------------------

In above code 'Pb' must be positive definite matrix.
And I encounter the following error.

---------------------------------------------------------------------------
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 = 25, order n = 46, dim = 226, blocks = 10
nnz(A) = 378 + 0, nnz(ADA) = 625, nnz(L) = 325
 it :     b*y       gap    delta  rate   t/tP*  t/tD*   feas cg cg  prec
  0 :            7.04E+10 0.000
  1 :   0.00E+00 1.46E+10 0.000 0.2074 0.9000 0.9000   1.00  1  0  3.7E+05
  2 :   0.00E+00 3.11E+09 0.000 0.2129 0.9000 0.9000   1.00  1  1  7.9E+04
  3 :   0.00E+00 5.82E+08 0.000 0.1873 0.9000 0.9000   1.00  1  1  1.5E+04
  4 :   0.00E+00 1.42E+07 0.000 0.0243 0.9900 0.9900   1.00  1  1  3.6E+02
  5 :   0.00E+00 9.40E+05 0.000 0.0663 0.9900 0.9900   1.00  1  1  2.4E+01
  6 :   0.00E+00 3.73E+05 0.000 0.3967 0.9000 0.9000   1.00  1  1  9.5E+00
  7 :   0.00E+00 1.06E+05 0.000 0.2835 0.9000 0.9000   1.00  1  1  2.7E+00
  8 :   0.00E+00 4.11E+04 0.000 0.3892 0.9000 0.9000   1.00  1  1  1.1E+00
  9 :   0.00E+00 1.32E+04 0.000 0.3210 0.9000 0.9000   1.00  1  1  3.4E-01
 10 :   0.00E+00 3.46E+03 0.000 0.2623 0.9000 0.9000   1.00  1  1  8.9E-02
 11 :   0.00E+00 8.07E+02 0.000 0.2331 0.9000 0.9000   1.00  1  4  2.0E-02
 12 :   0.00E+00 6.44E+01 0.000 0.0797 0.9900 0.9900   1.00  1  5  1.6E-03
 13 :   0.00E+00 4.64E-01 0.000 0.0072 0.9990 0.9990   1.00  2  3  1.2E-05
 14 :   0.00E+00 1.29E-02 0.000 0.0277 0.9900 0.9900   1.00  5 30  3.5E-07
 15 :   0.00E+00 3.86E-03 0.125 0.2995 0.9000 0.9000   0.98  7  1  1.1E-07
 16 :   0.00E+00 1.80E-03 0.000 0.4675 0.9000 0.9000   0.94  4  4  5.0E-08
 17 :   0.00E+00 3.81E-04 0.000 0.2115 0.9000 0.9000   0.86  4  9  1.2E-08
 18 :   0.00E+00 7.79E-05 0.000 0.2044 0.9000 0.9000   0.49 10  7  4.3E-09
 19 :   0.00E+00 6.79E-05 0.000 0.8719 0.9000 0.9000  -0.24  8  9  4.2E-09
Run into numerical problems.

iter seconds digits       c*x               b*y
 19      1.5   Inf  0.0000000000e+00  0.0000000000e+00
|Ax-b| =   2.3e-09, [Ay-c]_+ =   1.8E-15, |x|=  5.9e+00, |y|=  1.3e+00

Detailed timing (sec)
   Pre          IPM          Post
1.450E-01    9.040E-01    3.200E-02    
Max-norms: ||b||=0, ||c|| = 0,
Cholesky |add|=0, |skip| = 5, ||L.L|| = 15770.4.
Hmm, something went wrong!

ans =

    'Numerical problems (SeDuMi-1.3)'


ans =

    'Numerical problems '
---------------------------------------------------------------------------

Thanks for advising me on finding the answer
Code.m

Johan Löfberg

unread,
Mar 7, 2019, 11:52:32 AM3/7/19
to YALMIP
First, transpose in matlab is simply '

Second, your data is nasty (10^5 etc), so I wouldn't have too much hope, in particular with sedumi. Try mosek

Third, your model is ill-posed as 0 is a feasible solution. Pb>= eye(n) would be a start to dehomogenize the problem

mohammad hassan

unread,
Mar 7, 2019, 5:16:23 PM3/7/19
to YALMIP
Thanks alot
I was able to get a fairly good answer by setting the parameters.
Reply all
Reply to author
Forward
0 new messages