Stop: progress is bad Status: Inaccurate/Solved

Hello, I encountered the following problem when using CVX to solve, please help me, my running result and code are as follows.

Calling SDPT3 4.0: 2737 variables, 1198 equality constraints
For improved efficiency, SDPT3 is solving the dual problem.

num. of constraints = 1198
dim. of sdp var = 1436, num. of sdp blk = 718
dim. of linear var = 579
dim. of free var = 4 *** convert ublk to lblk


SDPT3: Infeasible path-following algorithms


version predcorr gam expon scale_data
HKM 1 0.000 1 0
it pstep dstep pinfeas dinfeas gap prim-obj dual-obj cputime

0|0.000|0.000|2.7e+03|3.6e+00|8.0e+14|-1.721937e+12 0.000000e+00| 0:0:00| spchol 1 2
1|0.000|0.000|2.7e+03|3.6e+00|8.0e+14|-1.719450e+12 -1.750268e+09| 0:0:01| spchol 1 2
2|0.000|0.001|2.7e+03|3.6e+00|8.0e+14|-1.712777e+12 -1.030160e+10| 0:0:01| spchol 1 2
3|0.001|0.001|2.7e+03|3.5e+00|8.0e+14|-1.703278e+12 -2.851072e+10| 0:0:01| spchol 1 2
4|0.012|0.005|2.7e+03|3.5e+00|7.9e+14|-1.522982e+12 -1.078142e+11| 0:0:01| spchol 1 2
5|0.021|0.031|2.6e+03|3.4e+00|7.9e+14|-1.232288e+12 -5.321735e+11| 0:0:01| spchol 1 2
6|0.136|0.114|2.3e+03|3.0e+00|7.6e+14| 5.240341e+11 -1.887901e+12| 0:0:01| spchol 1 1
7|0.211|0.138|1.8e+03|2.6e+00|6.9e+14| 2.957219e+12 -3.161553e+12| 0:0:01| spchol 1 1
8|0.112|0.083|1.6e+03|2.4e+00|6.5e+14| 4.322290e+12 -3.804446e+12| 0:0:01| spchol 1 1
9|0.207|0.153|1.3e+03|2.0e+00|5.9e+14| 6.649379e+12 -4.847236e+12| 0:0:02| spchol 1 1
10|0.830|0.393|2.1e+02|1.2e+00|3.2e+14| 1.462691e+13 -6.218034e+12| 0:0:02| spchol 2 2
11|0.866|0.850|2.9e+01|1.8e-01|6.4e+13| 1.293633e+13 -2.844298e+12| 0:0:02| spchol 2 2
12|0.645|0.663|1.0e+01|6.2e-02|3.1e+13| 8.879237e+12 -1.764887e+12| 0:0:02| spchol 1 2
13|0.412|0.505|6.0e+00|3.1e-02|2.2e+13| 7.101976e+12 -1.266861e+12| 0:0:02| spchol 1 1
14|0.731|0.463|1.6e+00|1.6e-02|1.4e+13| 4.713261e+12 -9.388972e+11| 0:0:02| spchol 1 2
15|0.788|0.250|3.4e-01|1.2e-02|9.8e+12| 2.965894e+12 -7.805639e+11| 0:0:02| spchol 2 2
16|0.462|0.503|1.8e-01|6.1e-03|6.4e+12| 2.376495e+12 -4.767798e+11| 0:0:02| spchol 1 2
17|0.561|0.278|8.1e-02|4.4e-03|4.8e+12| 1.719915e+12 -3.787636e+11| 0:0:02| spchol 2 2
18|0.545|0.226|3.7e-02|3.4e-03|4.2e+12| 1.288020e+12 -3.142670e+11| 0:0:02| spchol 1 1
19|0.478|0.225|1.9e-02|2.7e-03|3.9e+12| 1.066915e+12 -2.620579e+11| 0:0:02| spchol 1 1
20|0.492|0.234|9.8e-03|2.0e-03|3.6e+12| 8.911277e+11 -2.168234e+11| 0:0:02| spchol 1 1
21|0.518|0.178|4.7e-03|1.7e-03|3.5e+12| 7.621685e+11 -1.892159e+11| 0:0:02| spchol 1 1
22|0.536|0.347|2.2e-03|1.1e-03|2.9e+12| 6.882062e+11 -1.441650e+11| 0:0:02| spchol 1 1
23|0.942|0.201|1.3e-04|8.7e-04|2.9e+12| 5.098702e+11 -1.243094e+11| 0:0:03| spchol 1 1
24|1.000|0.373|3.4e-11|5.5e-04|2.2e+12| 3.371025e+11 -8.857446e+10| 0:0:03| spchol 1 1
25|1.000|0.469|3.7e-11|2.9e-04|1.2e+12| 1.560154e+11 -5.211160e+10| 0:0:03| spchol 1 1
26|1.000|0.479|3.3e-11|1.5e-04|5.9e+11| 7.623513e+10 -2.895295e+10| 0:0:03| spchol 1 1
27|1.000|0.378|2.3e-11|9.4e-05|3.5e+11| 4.875882e+10 -1.873233e+10| 0:0:03| spchol 1 1
28|1.000|0.355|1.9e-11|6.1e-05|2.1e+11| 3.529628e+10 -1.247802e+10| 0:0:03| spchol 1 1
29|1.000|0.335|1.9e-11|4.0e-05|1.2e+11| 2.627138e+10 -8.547292e+09| 0:0:03| spchol 1 1
30|1.000|0.285|1.6e-11|2.9e-05|7.5e+10| 2.051661e+10 -6.286162e+09| 0:0:03| spchol 1 1
31|1.000|0.383|1.8e-11|1.8e-05|3.7e+10| 1.300532e+10 -4.006937e+09| 0:0:03| spchol 1 1
32|1.000|0.361|1.4e-11|1.1e-05|1.7e+10| 7.313618e+09 -2.632545e+09| 0:0:03| spchol 1 1
33|1.000|0.462|1.6e-11|6.1e-06|6.1e+09| 2.979396e+09 -1.450613e+09| 0:0:03| spchol 1 1
34|1.000|0.569|1.3e-11|2.6e-06|1.6e+09| 7.194788e+08 -6.347741e+08| 0:0:03| spchol 1 1
35|1.000|0.810|1.1e-11|5.0e-07|1.8e+08| 5.509373e+07 -1.215313e+08| 0:0:03| spchol 1 1
36|0.986|0.977|4.8e-12|1.1e-08|3.8e+06| 9.627000e+05 -2.768796e+06| 0:0:03| spchol 1 1
37|0.988|0.989|7.4e-13|1.3e-10|4.4e+04| 1.157266e+04 -3.132430e+04| 0:0:03| spchol 1 1
38|0.939|0.976|3.2e-12|3.8e-12|1.5e+03| 6.707232e+02 -7.870694e+02| 0:0:03| spchol 1 1
39|0.980|0.973|1.0e-12|3.6e-13|4.1e+01|-6.199716e+01 -5.875287e+01| 0:0:03| spchol 1 1
40|0.981|0.986|9.4e-13|1.8e-14|7.2e-01|-7.691361e+01 -3.864828e+01| 0:0:04| spchol 1 1
41|0.964|0.953|9.4e-13|1.3e-14|3.7e-02|-7.673854e+01 -3.830215e+01| 0:0:04| spchol 1 1
42|1.000|0.042|1.0e-12|1.4e-14|2.7e-02|-7.648537e+01 -3.829809e+01| 0:0:04| spchol 1 1
43|0.995|0.970|9.2e-13|1.3e-14|1.0e-03|-7.642355e+01 -3.820390e+01| 0:0:04| spchol 1 1
44|0.915|0.749|9.2e-13|1.4e-14|6.2e-04|-7.629441e+01 -3.814059e+01| 0:0:04| spchol 1 1
45|0.775|0.688|9.4e-13|1.3e-14|5.1e-04|-7.617377e+01 -3.808298e+01| 0:0:04| spchol 1 1
46|0.519|0.898|1.1e-12|1.1e-14|5.5e-04|-7.605891e+01 -3.800859e+01| 0:0:04| spchol 1 1
47|0.172|0.694|1.0e-12|1.3e-14|6.2e-04|-7.598588e+01 -3.795169e+01| 0:0:04|
stop: progress is bad

number of iterations = 47
primal objective value = -7.61737739e+01
dual objective value = -3.80829803e+01
gap := trace(XZ) = 5.14e-04
relative gap = 4.46e-06
actual relative gap = -3.30e-01
rel. primal infeas (scaled problem) = 9.38e-13
rel. dual " " " = 1.27e-14
rel. primal infeas (unscaled problem) = 0.00e+00
rel. dual " " " = 0.00e+00
norm(X), norm(y), norm(Z) = 3.7e+08, 5.1e+07, 6.5e+07
norm(A), norm(b), normΒ© = 5.3e+03, 4.5e+06, 8.4e+05
Total CPU time (secs) = 3.96
CPU time per iteration = 0.08
termination code = -5
DIMACS: 8.4e-12 0.0e+00 7.6e-14 0.0e+00 -3.3e-01 4.5e-06


Status: Inaccurate/Solved
Optimal value (cvx_optval): +38.083

indent preformatted text by 4 spaces
K=4;
N=20;
delta=1;
alpha_k_n=0.5;             %offload ratio
V_max=30;
B=1*10^6;                  %bandwidth=1MHZ
beta0=1*10^(-6);           %-60dB
P=1;                       %user power=1W
noise_p=1*10^(-14);        %noise power=-110dBm
H=50;
w_k=[50,70,330,350;180,210,210,180];          %user location
w_e=[200,50];              %eavesdropper location
L=1*10^6;                  %task size
M=30;

%SCA local point q_r
q_r=zeros([2,N]);
c_ini_x=200;
c_ini_y=80;
r_ini=80;
ang=2*pi/(N-1);
for n=1:N
    q_r(1,n)=c_ini_x+r_ini*cos((n-1)*ang-pi/2);
    q_r(2,n)=c_ini_y+r_ini*sin((n-1)*ang-pi/2);
end

%SCA local point v1_r,v2_r
v1_r=zeros([K,N]);
v2_r=zeros([1,N]);
for k=1:K
    for n=1:N
        v1_r(k,n)=sqrt((q_r(1,n)-w_k(1,k))^2+(q_r(2,n)-w_k(2,k))^2+H^2);
    end
end

for n=1:N
    v2_r(n)=sqrt((q_r(1,n)-w_e(1))^2+(q_r(2,n)-w_e(2))^2+H^2);
end

%constant dke,A_k,B_k,C
dke=zeros([1,K]);                %||wk-we||
A_k=zeros([1,K]);
B_k=zeros([1,K]);
for k=1:K
    dke(k)=sqrt((w_k(1,k)-w_e(1))^2+(w_k(2,k)-w_e(2))^2);
    A_k(k)=beta0/(dke(k)^4);
    B_k(k)=(2*M*beta0^(1.5))/(dke(k)^2);
end
C=(M^2)*(beta0^2);

%SCA local point eta_r
eta_r=zeros([K,N]);
for k=1:K
    for n=1:N
        eta_r(k,n)=log(1+(P/noise_p)*(A_k(k)-B_k(k)/(v1_r(k,n)*v2_r(n))+C/((v1_r(k,n)^2)*(v2_r(n)^2))));
    end
end

%constant D_l,E_l,dku_l_horizon2,due_l_horizon2
D_r=zeros([K,N]);
E_r=zeros([K,N]);
dku_r_horizon2=zeros([K,N]);    %||qr[n]-wk||2
due_r_horizon2=zeros([1,N]);    %||qr[n]-we||2
for k=1:K
    for n=1:N
        dx_uav_ue2=(q_r(1,n)-w_k(1,k))^2;
        dy_uav_ue2=(q_r(2,n)-w_k(2,k))^2;
        dku_r_horizon2(k,n)=dx_uav_ue2+dy_uav_ue2;

        d_uav_ue2=H^2+dx_uav_ue2+dy_uav_ue2;
        D_r(k,n)=B*log2(1+(P*beta0)/(noise_p*(H^2+dku_r_horizon2(k,n))));
        E_r(k,n)=(B*P*beta0)/(log(2)*d_uav_ue2*(noise_p*d_uav_ue2+P*beta0));
    end
end
for n=1:N
    due_r_horizon2(n)=(q_r(1,n)-w_e(1))^2+(q_r(2,n)-w_e(2))^2;
end

cvx_begin
    variable Q(2,N) nonnegative          %trajectory
    variable omega(K,N) nonnegative    %slack variable omega
    variable eta(K,N)                  %slack variable eta
    variable v1(K,N)                   %slack variable v1
    variable v2(1,N)                   %slack variable v2
    variable v3(K,N)                   %slack variable v3
    variable v4(1,N)                   %slack variable v4

    expressions R_lb(K,N) nonnegative          %lower boundary of Rk[n]
    for k=1:K
        for n=1:N
            dku_horizon2=(Q(1,n)-w_k(1,k))^2+(Q(2,n)-w_k(2,k))^2;
            R_lb(k,n)=D_r(k,n)-E_r(k,n)*(dku_horizon2-dku_r_horizon2(k,n));
        end
    end

    expressions F_lb(K,N)       %lower boundary of 1/v1k[n]v2[n] 
    for k=1:K
         for n=1:N
             F_lb(k,n)=3/(v1_r(k,n)*v2_r(n))-v1(k,n)/(v2_r(n)*v1_r(k,n)^2)...
                 -v2(n)/(v1_r(k,n)*v2_r(n)^2);
         end
    end

    G_lb=exp(eta_r)+(exp(eta_r).*(eta-eta_r));      %lower boundary of exp(eta)

    energy=P*L*alpha_k_n*inv_pos(omega);

    minimize(sum(sum(energy)))
    subject to
        Q(1,1)==q_r(1,1);
        Q(2,1)==q_r(2,1);
        Q(1,N)==Q(1,1);
        Q(2,N)==Q(2,1);

        for n=1:N-1
            (Q(1,n+1)-Q(1,n))^2+(Q(2,n+1)-Q(2,n))^2<=(delta*V_max)^2;
        end

        omega<=R_lb-eta*B/log(2);

        for k=1:K
            for n=1:N
                1+P*(A_k(k)-B_k(k)*F_lb(k,n)+C*prod_inv([v3(k,n),v4(1,n)]))/noise_p<=G_lb(k,n);

                (Q(1,n)-w_k(1,k))^2+(Q(2,n)-w_k(2,k))^2+H^2<=2*v1_r(k,n)*v1(k,n)-v1_r(k,n)^2;

                v3(k,n)<=H^2+dku_r_horizon2(k,n)+...
                    2*((q_r(1,n)-w_k(1,k))*(Q(1,n)-q_r(1,n))+(q_r(2,n)-w_k(2,k))*(Q(2,n)-q_r(2,n)));
            end
        end

        for n=1:N
            (Q(1,n)-w_e(1))^2+(Q(2,n)-w_e(2))^2+H^2<=2*v2_r(n)*v2(n)-v2_r(n)^2;

            v4(1,n)<=H^2+due_r_horizon2(n)+...
                2*((q_r(1,n)-w_e(1))*(Q(1,n)-q_r(1,n))+(q_r(2,n)-w_e(2))*(Q(2,n)-q_r(2,n))); 
        end
cvx_end
cvx_clear

see

thanks for your reply,i tried to use mosek,but it failed.this is result of its operation
Calling Mosek 9.1.9: 2737 variables, 1198 equality constraints
For improved efficiency, Mosek is solving the dual problem.

MOSEK Version 9.1.9 (Build date: 2019-11-21 11:34:40)
Copyright Β© MOSEK ApS, Denmark. WWW: mosek.com
Platform: Windows/64-X86

MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col β€˜β€™ (582) of matrix β€˜A’.
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 1198
Cones : 718
Scalar variables : 2737
Matrix variables : 0
Integer variables : 0

Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 387
Eliminator terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries : 2 time : 0.00
Lin. dep. - tries : 1 time : 0.00
Lin. dep. - number : 0
Presolve terminated. Time: 0.00
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 1198
Cones : 718
Scalar variables : 2737
Matrix variables : 0
Integer variables : 0

Optimizer - threads : 16
Optimizer - solved problem : the primal
Optimizer - Constraints : 725
Optimizer - Cones : 716
Optimizer - Scalar variables : 2364 conic : 2148
Optimizer - Semi-definite variables: 0 scalarized : 0
Factor - setup time : 0.00 dense det. time : 0.00
Factor - ML order time : 0.00 GP order time : 0.00
Factor - nonzeros before factor : 3385 after factor : 4438
Factor - dense dim. : 0 flops : 5.43e+04
ITE PFEAS DFEAS GFEAS PRSTATUS POBJ DOBJ MU TIME
0 3.5e+05 2.0e+05 2.0e+07 0.00e+00 1.896008213e+03 -2.000000000e+07 1.0e+00 0.05
1 9.7e+04 5.4e+04 1.0e+07 -1.00e+00 1.141997884e+07 -8.581758914e+06 2.7e-01 0.05
2 4.9e+04 2.7e+04 7.5e+06 -1.00e+00 1.033093224e+07 -9.670207220e+06 1.4e-01 0.05
3 1.6e+04 8.6e+03 4.2e+06 -1.00e+00 1.090390748e+07 -9.093915246e+06 4.4e-02 0.05
4 3.8e+03 2.1e+03 2.1e+06 -9.99e-01 1.189373959e+07 -8.086780825e+06 1.1e-02 0.05
5 7.6e+02 4.2e+02 9.2e+05 -9.98e-01 1.459900599e+07 -5.281119985e+06 2.2e-03 0.05
6 2.5e+02 1.4e+02 5.2e+05 -9.87e-01 1.484694708e+07 -4.779386795e+06 7.1e-04 0.05
7 1.3e+02 7.1e+01 3.7e+05 -9.62e-01 1.488994974e+07 -4.389152597e+06 3.6e-04 0.06
8 3.7e+01 2.0e+01 1.8e+05 -9.28e-01 1.417578031e+07 -3.496229778e+06 1.0e-04 0.06
9 1.6e+01 9.1e+00 1.1e+05 -7.61e-01 1.258036743e+07 -2.733002846e+06 4.6e-05 0.06
10 4.8e+00 2.7e+00 3.7e+04 -5.02e-01 8.002566727e+06 -1.411123248e+06 1.4e-05 0.06
11 8.0e-01 4.5e-01 3.8e+03 1.59e-01 2.050085952e+06 -2.716410305e+05 2.3e-06 0.06
12 1.2e-01 6.9e-02 2.2e+02 8.21e-01 3.408535123e+05 -4.465794100e+04 3.5e-07 0.06
13 2.7e-02 1.5e-02 2.3e+01 9.47e-01 7.372789117e+04 -1.118212410e+04 7.5e-08 0.06
14 5.9e-03 3.3e-03 2.4e+00 9.85e-01 1.557258972e+04 -3.416023605e+03 1.7e-08 0.06
15 1.2e-03 6.7e-04 2.3e-01 9.77e-01 2.484230192e+03 -1.434980271e+03 3.4e-09 0.06
16 3.4e-04 1.9e-04 3.6e-02 9.50e-01 4.479458176e+02 -6.992134973e+02 9.7e-10 0.08
17 1.6e-04 9.1e-05 1.3e-02 8.86e-01 1.547263278e+02 -4.401473392e+02 4.6e-10 0.08
18 6.7e-05 3.7e-05 3.5e-03 9.95e-01 -1.394174315e+02 -3.881598473e+02 1.9e-10 0.08
19 4.4e-05 5.5e-05 2.3e-03 5.79e-01 -1.714680176e+01 -2.244252630e+02 1.2e-10 0.08
20 1.2e-05 3.3e-05 3.6e-04 8.93e-01 -1.444806131e+02 -2.064728042e+02 3.5e-11 0.08
21 5.6e-06 2.1e-04 1.6e-04 4.85e-01 -7.180036644e+01 -1.122565891e+02 1.6e-11 0.08
22 1.7e-06 2.5e-04 2.9e-05 7.83e-01 -8.199319561e+01 -9.546821730e+01 4.7e-12 0.08
23 7.5e-07 1.5e-03 1.3e-05 4.46e-01 -4.716349701e+01 -5.610532683e+01 2.1e-12 0.08
24 2.3e-07 1.2e-03 2.6e-06 7.25e-01 -4.423225783e+01 -4.745833101e+01 6.5e-13 0.08
25 1.1e-07 6.4e-03 1.2e-06 3.62e-01 -2.573900429e+01 -2.800605340e+01 3.0e-13 0.08
26 3.2e-08 5.1e-03 2.2e-07 7.00e-01 -2.294567850e+01 -2.372082336e+01 8.7e-14 0.08
27 1.4e-08 2.1e-03 9.3e-08 3.60e-01 -1.390969831e+01 -1.441013353e+01 3.6e-14 0.09
28 4.7e-09 1.9e-02 1.9e-08 6.43e-01 -1.156324237e+01 -1.174259106e+01 1.1e-14 0.09
29 2.5e-09 8.3e-03 7.1e-09 3.59e-01 -7.378595741e+00 -7.486044728e+00 4.3e-15 0.09
30 1.7e-09 9.4e-02 1.7e-09 6.32e-01 -6.196545707e+00 -6.239822448e+00 1.5e-15 0.09
31 2.0e-09 2.6e-01 3.4e-10 5.54e-01 -4.698341532e+00 -4.713944426e+00 4.1e-16 0.09
32 1.5e-09 2.0e-01 8.1e-11 7.59e-01 -4.253918973e+00 -4.260198080e+00 1.5e-16 0.09
33 1.4e-09 2.4e-01 1.8e-11 8.78e-01 -4.053705360e+00 -4.056073102e+00 5.6e-17 0.09
34 1.6e-09 2.6e-01 4.2e-12 9.13e-01 -3.968855107e+00 -3.969745085e+00 2.1e-17 0.11
35 2.0e-09 1.2e-01 1.4e-12 9.03e-01 -3.908236428e+00 -3.908661418e+00 1.2e-17 0.11
36 2.0e-09 1.2e-01 1.4e-12 9.45e-01 -3.908236428e+00 -3.908661418e+00 1.2e-17 0.11
37 2.0e-09 1.2e-01 1.4e-12 9.91e-01 -3.908236428e+00 -3.908661418e+00 1.2e-17 0.13
Optimizer terminated. Time: 0.13

Interior-point solution summary
Problem status : UNKNOWN
Solution status : UNKNOWN
Primal. obj: -3.9082364281e+00 nrm: 5e+05 Viol. con: 2e-06 var: 4e-11 cones: 2e-10
Dual. obj: -3.8886931052e+00 nrm: 2e+07 Viol. con: 0e+00 var: 3e+05 cones: 8e-09
Optimizer summary
Optimizer - time: 0.13
Interior-point - iterations : 38 time: 0.13
Basis identification - time: 0.00
Primal - iterations : 0 time: 0.00
Dual - iterations : 0 time: 0.00
Clean primal - iterations : 0 time: 0.00
Clean dual - iterations : 0 time: 0.00
Simplex - time: 0.00
Primal simplex - iterations : 0 time: 0.00
Dual simplex - iterations : 0 time: 0.00
Mixed integer - relaxations: 0 time: 0.00


Status: Failed
Optimal value (cvx_optval): NaN

This

means some of your data are too small (but not zero, like noise_p=1*10^(-14) or too big, solvers cannot handle them stably. see Handling numerical issues section of


By the way, I’m wondering if CVX2.2 supports SCS solver.

thank you,i will try it.I only have sdpt3, sedumi, mosek and gurobi in my list of CVX solvers

I believe SCS is only supported in CVX 3.0beta. But that version of CVX is riddled with bugs, including not honoring some constraints, so i don’t recommend using it.

As for warnings about nearly zero numbers, you need to improve the scaling of your input data. Change the units to avoid such small numbers as 10^(-14),. 10^(-6) is not very wonderful, but you might get away with it.

2 Likes