# Why do I get 'sqlp stop: primal or dual is diverging, 1.9e+16"

I am trying to replicate the paper:https://asp-eurasipjournals.springeropen.com/track/pdf/10.1186/s13634-016-0326-2
In the paper it clearly defines the problem in equtation 45 and the constraint by equation 29, 30 and 44. But when I tried to implement I get the above error… My eintire code and the out put of the CVX are below:

CODE:
N = 4; % filter order
Rs = 40;% stopband attenuation dB
Wc = 0.2; % centre of stopband
Wb = 1/128; % bandwidth of stopband. For 128x oversampling Wb = 1/128
Ws = Wc +0.5Wb[ -1, 1];% stopband edge frequency (normalised)
Wf = Wc + 0.3Wb[-1, 1]; % output filter passband
% [z, p,k ] = cheby2( N, Rs, Ws);
[z, p,k ] = butter( N, Ws);
[sos,g] = zp2sos(z,p,k);
[Heb, Hea ]=sos2tf(sos,g);
figure(656)
plot(abs(freqz(Heb,Hea,2001)))
hold on
%%%%%%
orderN=N;
filLen=2*orderN;
FirOrder=32;
jita=1.5;
%%%% constants
Ar=zeros(FirOrder,FirOrder);
for kt=1:FirOrder-1
Ar(kt,kt+1)=1;
end
Br=zeros(FirOrder,1);
Br(FirOrder)=1;
Dr=1;

%%%% design parameter
Ah=zeros(filLen,filLen);
for kt=1:filLen
Ah(filLen,kt)=-Hea(filLen-kt+2);
end
% Ah(filLen,filLen)=-1;
% Ah(filLen,1)=-1;
Bh=zeros(filLen,1);
Br(filLen)=1;
Ch=zeros(1,filLen);
for kt=1:filLen
Ch(kt)=Heb(filLen-kt+2)-Hea(filLen-kt+2)*Heb(1);
end
Dh=Heb(1);
% Ch(filLen)=1;

[Ah1,Bh1,Ch1,Dh1]=tf2ss(Heb,Hea);
%%%% derived parameter;
A=[Ar, BrCh;zeros(filLen,FirOrder),Ah];
B=[Br
Dh;Bh];
% Cr=zeros(1,filLen);
D=Dh;

%%%%Optimize to find out parameter

cvx_begin % quiet
variables P(filLen+FirOrder,FirOrder+filLen)
variables Pr(FirOrder,FirOrder)
variables Cr(1,FirOrder);
variables u2
P == semidefinite(FirOrder+filLen);
Pr == semidefinite(FirOrder);
%%%% Equation 29
M1=[P,PA,PB];
M2=[A’P,P,zeros(FirOrder+filLen,1)];
M3=[B’*P,zeros(1,FirOrder+filLen),1];
mof29=[M1;M2;M3];
%%%% Equation 30
C=[Cr,Ch];
M1=[u2,C,D];
M2=[C’,P,zeros(FirOrder+filLen,1)];
M3=[D’,zeros(1,FirOrder+filLen),1];
mof30=[M1;M2;M3];
%%% equation 44
M1=[-Pr,Pr
Ar, Pr*Br,zeros(FirOrder,1)];
M2=[Ar’*Pr, -Pr,zeros(FirOrder,1),Cr’];
M3=[Br’*Pr,0,-jita^2,ones(1,FirOrder)];
M4=[zeros(1,FirOrder),Cr,1,-1];
mof44=[M1;M2;M3;M4];

minimize (u2);
subject to
mof29>=0;
mof30 >= 0;
mof44 <= 0;
% Cr(filLen)==1;
cvx_end

OUTPUT OF CVX

## Calling SDPT3 4.0: 7247 variables, 1419 equality constraints For improved efficiency, SDPT3 is solving the dual problem.

num. of constraints = 1419
dim. of sdp var = 72, num. of sdp blk = 2
dim. of linear var = 5860
dim. of free var = 39
2978 linear variables from unrestricted variable.
*** convert ublk to lblk

SDPT3: Infeasible path-following algorithms

## number of iterations = 13 Total CPU time (secs) = 2.17 CPU time per iteration = 0.17 termination code = 3 DIMACS: 1.5e+02 0.0e+00 4.1e+01 0.0e+00 -1.0e+00 1.3e-05

Status: Failed
Optimal value (cvx_optval): NaN

Most likely your problem is primal infeasible. Mosek and SeDuMi is likely to be better than SDPT3 to deal with such problem since they employ a different alg. than SDPT3…

## Thank you for your reply. I tried SeDuMi as suggested but I get the following : Calling SeDuMi 1.34: 7247 variables, 1419 equality constraints For improved efficiency, SeDuMi is solving the dual problem.

SeDuMi 1.34 (beta) by AdvOL, 2005-2008 and Jos F. Sturm, 1998-2003.
Alg = 2: xz-corrector, Adaptive Step-Differentiation, theta = 0.250, beta = 0.500
Split 39 free variables
eqs m = 1419, order n = 6011, dim = 8563, blocks = 3
nnz(A) = 8303 + 0, nnz(ADA) = 951495, nnz(L) = 476459
it : by gap delta rate t/tP t/tD* feas cg cg prec
0 : 4.78E+00 0.000
1 : 0.00E+00 2.96E+00 0.000 0.6197 0.9000 0.9000 1.03 1 1 1.9E+02
2 : 0.00E+00 2.81E+00 0.000 0.9468 0.9000 0.9000 0.56 1 1 1.8E+02
3 : 0.00E+00 2.65E+00 0.000 0.9461 0.9000 0.9000 0.49 1 1 1.7E+02
4 : 0.00E+00 2.51E+00 0.000 0.9454 0.9000 0.9000 0.42 1 1 1.7E+02
5 : 0.00E+00 2.37E+00 0.000 0.9446 0.9000 0.9000 0.35 1 1 1.6E+02
6 : 0.00E+00 2.24E+00 0.000 0.9438 0.9000 0.9000 0.27 1 1 1.6E+02
7 : 0.00E+00 2.11E+00 0.000 0.9431 0.9000 0.9000 0.20 1 1 1.5E+02
8 : 0.00E+00 1.99E+00 0.000 0.9423 0.9000 0.9000 0.13 1 1 1.5E+02
9 : 0.00E+00 1.87E+00 0.000 0.9415 0.9000 0.9000 0.05 1 1 1.5E+02
10 : 0.00E+00 1.76E+00 0.000 0.9408 0.9000 0.9000 -0.02 1 1 1.4E+02
11 : 0.00E+00 1.66E+00 0.000 0.9400 0.9000 0.9000 -0.09 1 1 1.4E+02
12 : 0.00E+00 1.55E+00 0.000 0.9392 0.9000 0.9000 -0.16 1 1 1.4E+02
13 : 0.00E+00 1.46E+00 0.000 0.9385 0.9000 0.9000 -0.22 1 1 1.3E+02
14 : 0.00E+00 1.37E+00 0.000 0.9377 0.9000 0.9000 -0.28 1 1 1.3E+02
15 : 0.00E+00 1.28E+00 0.000 0.9369 0.9000 0.9000 -0.34 1 1 1.3E+02
16 : 0.00E+00 1.20E+00 0.000 0.9362 0.9000 0.9000 -0.39 1 1 1.3E+02
17 : 0.00E+00 1.12E+00 0.000 0.9354 0.9000 0.9000 -0.44 1 1 1.2E+02
18 : 0.00E+00 1.05E+00 0.000 0.9346 0.9000 0.9000 -0.49 1 1 1.2E+02
19 : 0.00E+00 9.80E-01 0.000 0.9339 0.9000 0.9000 -0.53 1 1 1.2E+02
20 : 0.00E+00 9.14E-01 0.000 0.9331 0.9000 0.9000 -0.57 1 1 1.2E+02
21 : 0.00E+00 8.52E-01 0.000 0.9323 0.9000 0.9000 -0.61 1 1 1.2E+02
22 : 0.00E+00 7.94E-01 0.000 0.9315 0.9000 0.9000 -0.64 1 1 1.2E+02
23 : 0.00E+00 7.39E-01 0.000 0.9307 0.9000 0.9000 -0.67 1 1 1.2E+02
24 : 0.00E+00 6.87E-01 0.000 0.9299 0.9000 0.9000 -0.70 1 1 1.1E+02
25 : 0.00E+00 6.38E-01 0.000 0.9291 0.9000 0.9000 -0.73 1 1 1.1E+02
26 : 0.00E+00 5.93E-01 0.000 0.9282 0.9000 0.9000 -0.75 1 1 1.1E+02
27 : 0.00E+00 5.50E-01 0.000 0.9274 0.9000 0.9000 -0.77 1 1 1.1E+02
28 : 0.00E+00 5.09E-01 0.000 0.9265 0.9000 0.9000 -0.79 1 1 1.1E+02
29 : 0.00E+00 4.71E-01 0.000 0.9256 0.9000 0.9000 -0.81 1 1 1.1E+02
30 : 0.00E+00 4.36E-01 0.000 0.9247 0.9000 0.9000 -0.83 1 1 1.1E+02
31 : 0.00E+00 4.03E-01 0.000 0.9238 0.9000 0.9000 -0.84 1 1 1.1E+02
32 : 0.00E+00 3.71E-01 0.000 0.9228 0.9000 0.9000 -0.86 1 1 1.1E+02
33 : 0.00E+00 3.42E-01 0.000 0.9218 0.9000 0.9000 -0.87 1 1 1.1E+02
34 : 0.00E+00 3.15E-01 0.000 0.9208 0.9000 0.9000 -0.88 1 1 1.1E+02
35 : 0.00E+00 2.90E-01 0.000 0.9197 0.9000 0.9000 -0.89 1 1 1.1E+02
36 : 0.00E+00 2.66E-01 0.000 0.9186 0.9000 0.9000 -0.90 1 1 1.1E+02
37 : 0.00E+00 2.44E-01 0.000 0.9175 0.9000 0.9000 -0.91 1 1 1.1E+02
38 : 0.00E+00 2.24E-01 0.000 0.9163 0.9000 0.9000 -0.92 1 1 1.1E+02
39 : 0.00E+00 2.05E-01 0.000 0.9151 0.9000 0.9000 -0.93 1 1 1.1E+02
40 : 0.00E+00 1.87E-01 0.000 0.9138 0.9000 0.9000 -0.93 1 1 1.1E+02
41 : 0.00E+00 1.71E-01 0.000 0.9124 0.9000 0.9000 -0.94 1 1 1.1E+02
42 : 0.00E+00 1.05E-01 0.000 0.6151 0.9000 0.9613 -0.95 1 1 1.1E+02
43 : 0.00E+00 9.44E-02 0.000 0.8982 0.9000 0.0000 -0.35 1 1 1.1E+02
44 : 0.00E+00 8.42E-02 0.000 0.8920 0.9000 0.0000 -0.53 1 1 1.1E+02
45 : 0.00E+00 7.45E-02 0.000 0.8850 0.9000 0.0000 -0.66 1 1 1.1E+02
46 : 0.00E+00 6.53E-02 0.000 0.8769 0.9000 0.0000 -0.75 1 1 1.1E+02
47 : 0.00E+00 5.67E-02 0.000 0.8678 0.9000 0.0000 -0.83 1 1 1.1E+02
48 : 0.00E+00 4.86E-02 0.000 0.8576 0.9000 0.0000 -0.88 1 1 1.1E+02
49 : 0.00E+00 4.11E-02 0.000 0.8461 0.9000 0.0000 -0.93 1 1 1.1E+02
50 : 0.00E+00 3.43E-02 0.000 0.8330 0.9000 0.0000 -0.97 1 1 1.1E+02
51 : 0.00E+00 3.03E-02 0.000 0.8853 0.9000 0.1006 -1.00 1 1 1.1E+02
52 : 0.00E+00 2.71E-02 0.000 0.8940 0.9000 0.9000 -1.00 1 1 1.1E+02
53 : 0.00E+00 2.42E-02 0.000 0.8924 0.9000 0.9000 -1.00 1 1 1.1E+02
54 : 0.00E+00 2.16E-02 0.000 0.8907 0.9000 0.9000 -1.00 1 1 1.1E+02
55 : 0.00E+00 1.92E-02 0.000 0.8889 0.9000 0.9000 -1.00 1 1 1.1E+02
56 : 0.00E+00 1.70E-02 0.000 0.8871 0.9000 0.9000 -1.00 1 1 1.1E+02
57 : 0.00E+00 1.50E-02 0.000 0.8851 0.9000 0.9000 -1.00 1 1 1.1E+02
58 : 0.00E+00 1.33E-02 0.000 0.8830 0.9000 0.9000 -1.00 1 1 1.1E+02
59 : 0.00E+00 1.17E-02 0.000 0.8808 0.9000 0.9000 -1.00 1 1 1.2E+02
60 : 0.00E+00 1.03E-02 0.000 0.8784 0.9000 0.9000 -1.00 1 1 1.2E+02
61 : 0.00E+00 9.00E-03 0.000 0.8759 0.9000 0.9000 -1.00 1 1 1.2E+02
62 : 0.00E+00 7.86E-03 0.000 0.8732 0.9000 0.9000 -1.00 1 1 1.2E+02
63 : 0.00E+00 6.84E-03 0.000 0.8703 0.9000 0.9000 -1.00 1 1 1.2E+02
64 : 0.00E+00 5.93E-03 0.000 0.8672 0.9000 0.9000 -1.00 1 1 1.2E+02
65 : 0.00E+00 5.13E-03 0.000 0.8639 0.9000 0.9000 -1.00 1 1 1.2E+02
66 : 0.00E+00 4.41E-03 0.000 0.8603 0.9000 0.9000 -1.00 1 1 1.2E+02
67 : 0.00E+00 3.78E-03 0.000 0.8565 0.9000 0.9000 -1.00 1 1 1.2E+02
68 : 0.00E+00 3.22E-03 0.000 0.8523 0.9000 0.9000 -1.00 1 1 1.2E+02
69 : 0.00E+00 2.73E-03 0.000 0.8478 0.9000 0.9000 -1.00 1 1 1.2E+02
70 : 0.00E+00 2.30E-03 0.000 0.8429 0.9000 0.9000 -1.00 1 1 1.2E+02
71 : 0.00E+00 1.93E-03 0.000 0.8375 0.9000 0.9000 -1.00 1 1 1.2E+02
72 : 0.00E+00 1.60E-03 0.000 0.8317 0.9000 0.9000 -1.00 1 1 1.2E+02
73 : 0.00E+00 1.32E-03 0.000 0.8253 0.9000 0.9000 -1.00 1 1 1.2E+02
74 : 0.00E+00 1.08E-03 0.000 0.8183 0.9000 0.9000 -1.00 1 1 1.2E+02
75 : 0.00E+00 8.77E-04 0.000 0.8106 0.9000 0.9000 -1.00 1 1 1.2E+02
76 : 0.00E+00 7.03E-04 0.000 0.8022 0.9000 0.9000 -1.00 1 1 1.2E+02
77 : 0.00E+00 5.58E-04 0.000 0.7929 0.9000 0.9000 -1.00 1 1 1.2E+02
78 : 0.00E+00 4.37E-04 0.000 0.7828 0.9000 0.9000 -1.00 1 1 1.2E+02
79 : 0.00E+00 3.37E-04 0.000 0.7717 0.9000 0.9000 -1.00 1 1 1.2E+02
80 : 0.00E+00 2.56E-04 0.000 0.7595 0.9000 0.9000 -1.00 1 1 1.2E+02
81 : 0.00E+00 1.91E-04 0.000 0.7462 0.9000 0.9000 -1.00 1 1 1.2E+02
82 : 0.00E+00 1.40E-04 0.000 0.7318 0.9000 0.9000 -1.00 1 1 1.2E+02
83 : 0.00E+00 1.00E-04 0.000 0.7163 0.9000 0.9000 -1.00 1 1 1.2E+02
84 : 0.00E+00 7.01E-05 0.000 0.7002 0.9000 0.9000 -1.00 1 4 1.2E+02
85 : 0.00E+00 4.78E-05 0.000 0.6825 0.9000 0.9000 -1.00 1 1 1.2E+02
86 : 0.00E+00 3.18E-05 0.000 0.6640 0.9000 0.9000 -1.00 1 1 1.2E+02
87 : 0.00E+00 2.05E-05 0.000 0.6449 0.9000 0.9000 -1.00 1 1 1.2E+02
88 : 0.00E+00 1.28E-05 0.000 0.6252 0.9000 0.9000 -1.00 1 1 1.2E+02
89 : 0.00E+00 7.75E-06 0.000 0.6052 0.9000 0.9000 -1.00 1 1 1.2E+02
90 : 0.00E+00 4.54E-06 0.000 0.5853 0.9000 0.9000 -1.00 1 1 1.2E+02
91 : 0.00E+00 2.57E-06 0.000 0.5665 0.9000 0.9000 -1.00 1 1 1.2E+02
92 : 0.00E+00 1.42E-06 0.000 0.5532 0.9000 0.9000 -1.00 1 1 1.2E+02
93 : 0.00E+00 7.97E-07 0.000 0.5606 0.9000 0.9000 -1.00 1 1 1.2E+02
94 : 0.00E+00 4.57E-07 0.000 0.5735 0.9000 0.9000 -1.00 3 3 1.2E+02
95 : 0.00E+00 2.33E-07 0.000 0.5090 0.9000 0.9000 -1.00 3 3 1.2E+02
96 : 0.00E+00 1.04E-07 0.000 0.4471 0.9000 0.9000 -1.00 3 3 1.2E+02
97 : 0.00E+00 4.39E-08 0.000 0.4218 0.9000 0.9000 -1.00 3 3 1.2E+02
98 : 0.00E+00 1.79E-08 0.000 0.4082 0.9000 0.9000 -1.00 3 3 1.2E+02
99 : 0.00E+00 7.11E-09 0.000 0.3969 0.9000 0.9000 -1.00 3 3 1.2E+02
100 : 0.00E+00 2.75E-09 0.000 0.3870 0.9000 0.9000 -1.00 3 5 1.2E+02
101 : 0.00E+00 1.04E-09 0.000 0.3783 0.9000 0.9000 -1.00 3 5 1.2E+02
102 : 0.00E+00 3.84E-10 0.000 0.3691 0.9000 0.9000 -1.00 3 3 1.2E+02
103 : 0.00E+00 1.38E-10 0.000 0.3600 0.9000 0.9000 -1.00 3 3 1.2E+02

Dual infeasible, primal improving direction found.
iter seconds |Ax| [Ay]_+ |x| |y|
103 17.4 1.5e-08 4.9e-11 6.3e+01 6.6e+01

## Detailed timing (sec) Pre IPM Post 3.250E-01 1.284E+01 1.600E-02 Max-norms: ||b||=0, ||c|| = 2.250000e+00, Cholesky |add|=1, |skip| = 0, ||L.L|| = 3.84649e+07.

Status: Infeasible
Optimal value (cvx_optval): +Inf

Would you please have a look and suggest?

It says

Status: Infeasible

so your problem is likely to be infeasible i.e. has no solution.