# GP problem is failed

(zy) #1

Hi, I met some GP problems.

My matlab code is follow:

%Consider a rectangular area with DxD m^2
%M distributed APs serves K terminals, they all randomly located in the area
clc; clear all
K=5; %number of terminals
M=30; %number of access points
tau_c=200; % coherence intervals
B=20; %Mhz
D=1; %in kilometer
sigma_shd = 8; %in dB
tau = 5;
noise_p = (B10^6)(1.381*10^-23)290(10^0.9);
Pp=Pu;%pilot power: 100 mW

d0=0.01;%km
d1=0.05;%km
[U,S,V]=svd(randn(tau,tau)); % U includes tau orthogonal sequences

%% The above are some initialization parameters, which are not important

%% Large_scale_uncorrelation
BETAA = Cellfree_Large_scale_uncorrelation(D,M,K,sigma_shd); % Generate BETAA M*K matrix

%% Pilot Asignment: (random choice)
Phii = Random_Pilot_Assignment( U,tau,K ); % Generate Phii tau * K matrix

%% Create Gamma matrix for uncorrelation shadowing
Gammaa = Cellfree_Create_Gamma( BETAA, Phii, M, K ,tau, Pp); % Generate Gammaa M * K matrix

%% CVX_______________________________________________
PC = zeros(K,K);
for ii=1:K
for k=1:K
PC(ii,k)=sum(((Gammaa(:,k)./BETAA(:,k)).*BETAA(:,ii))) * Phii(:,k)’*Phii(:,ii);
end
end
PC1=(abs(PC)).^2;

cvx_begin gp
variable etaa(K)
variable t

for k=1:1
first = 0;
for kk=[1:k-1,k+1:K]
first = first + etaa(kk) * PC1(kk,k);
end
frist = 1 / (sum(Gammaa(:,k)))^2 * t / etaa(k) * first; % The first item in the original denominator

``````ici = 0;
for ii=1:K
ici = ici + etaa(ii) * sum(Gammaa(:,k).*BETAA(:,ii));
end
second = 1 / (sum(Gammaa(:,k)))^2 * t / etaa(k) * ici;

third = 1 / sum(Gammaa(:,k)) / Pu * t / etaa(k);
sb_left = first + second + third;
``````

end

minimize t^(-1)

subject to
sb_left - 1 <= 0;
for k=1:K
0 <= etaa(k) <= 1;
end

cvx_end

Unfortunately, CVX told me this problem is failed.
Successive approximation method to be employed.
** For improved efficiency, SDPT3 is solving the dual problem.**
** SDPT3 will be called several times to refine the solution.**
** Original size: 51 variables, 20 equality constraints**
** 13 exponentials add 104 variables, 65 equality constraints**
-----------------------------------------------------------------
** Cones | Errors |**
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
** 3/ 3 | 8.000e+00 2.611e+01 0.000e+00 | Failed**
** 2/ 2 | 8.000e+00 1.296e+01 0.000e+00 | Inaccurate/Solved**
** 2/ 2 | 8.000e+00s 4.297e+00 2.392e-02 | Solved**
** 1/ 1 | 1.773e+00 3.102e-01 2.229e-08 | Solved**
** 1/ 1 | 5.028e-01 2.168e-02 3.975e-08 | Solved**
** 1/ 1 | 5.231e-01s 2.352e-02s 1.497e-08 | Solved**
** 1/ 1 | 4.429e-01 1.673e-02 4.687e-11 | Solved**
** 1/ 1 | 1.504e-01 1.874e-03 0.000e+00 | Inaccurate/Solved**
** 1/ 1 | 5.093e-02 2.107e-04 0.000e+00 | Inaccurate/Solved**
** 1/ 1 | 1.011e-01s 8.421e-04s 0.000e+00 | Inaccurate/Solved**
** 1/ 1 | 3.861e-01s 1.264e-02s 0.000e+00 | Solved**
** 1/ 1 | 8.795e-01s 6.898e-02s 0.000e+00 | Inaccurate/Solved**
** 2/ 2 | 2.118e+00 4.624e-01 0.000e+00 | Inaccurate/Solved**
** 1/ 1 | 5.844e-01 2.953e-02 0.000e+00 | Inaccurate/Solved**
** 1/ 1 | 1.617e-01 2.167e-03 0.000e+00 | Inaccurate/Solved**
** 1/ 1 | 7.968e-02 5.216e-04 0.000e+00 | Inaccurate/Solved**
** 1/ 1 | 4.664e-02 1.750e-04 0.000e+00 | Inaccurate/Solved**
** 1/ 1 | 1.593e-01s 2.102e-03s 0.000e+00 | Inaccurate/Solved**
-----------------------------------------------------------------
Status: Failed
Optimal value (cvx_optval): NaN
What is ‘Failed’ mean? Is my code wrong? Thanks.

(zy) #2

After uploading, I found that some of the pictures were not clear. Here I uploaded the formula again.

and there are some data in my simulation：

(Mark L. Stone) #3

I haven’t really looked at your problem, and you haven’t provided all input data, but the entries you show in PC1 and Gamma look horrible, and perhaps are contributing to your difficulties. You should try to make your input data elements to CVX be either exactly zero, or much closer to 1 in magnitude than you have. So you ought to look into re-scaling to improve that.

In any event, if you are solving GPs in CVX, I recommend you install CVXQUAD https://github.com/hfawzi/cvxquad and its `exponential.m` replacement for CVX’s version, as described on the CVXQUAD page. Given that you are using GP mode, this will cause CVXQUAD’s Pade approximant to automatically be used instead of CVX’s successive approximation method. It should be more reliable. I don;t know whether it will succeed with your problem’s currently terrible numerics.

(zy) #5

Thanks for your advice. But it still doesn’t work. The error information is :

In exponential (line 17)
In cvx/log_sum_exp (line 97)
In cvx/log (line 111)
In .* (line 270)
In * (line 36)
In Untitled2 (line 52)
=====================================
cone with parameters m=3, k=3
=====================================

In exponential (line 17)
In cvx/log_sum_exp (line 97)
In cvx/log (line 111)
In .* (line 270)
In * (line 36)
In Untitled2 (line 58)
=====================================
cone with parameters m=3, k=3
=====================================

## Cones | Errors | Mov/Act | Centering Exp cone Poly cone | Status --------±--------------------------------±-------- 2/ 2 | 8.000e+00 3.229e+01 0.000e+00 | Inaccurate/Solved 2/ 2 | 8.000e+00s 1.798e+01 0.000e+00 | Inaccurate/Solved 2/ 2 | 8.000e+00s 6.153e+00 2.136e-01 | Solved 1/ 1 | 2.053e+00 4.306e-01 2.014e-08 | Solved 1/ 1 | 4.252e-01 1.539e-02 1.733e-08 | Solved 2/ 2 | 4.582e+00 2.236e+00 1.341e+00 | Solved 1/ 1 | 2.575e-01 5.548e-03 1.433e-08 | Solved 1/ 1 | 5.494e-02 2.477e-04 2.011e-08 | Solved 1/ 1 | 1.177e-01s 1.144e-03s 3.770e-09 | Solved 1/ 1 | 2.954e-01s 7.332e-03s 0.000e+00 | Inaccurate/Solved 1/ 1 | 1.148e+00s 1.211e-01s 0.000e+00 | Inaccurate/Solved 1/ 1 | 2.105e+00s 4.557e-01s 0.000e+00 | Inaccurate/Solved

Status: Failed
Optimal value (cvx_optval): NaN

(zy) #6

other input data are
Pu = 1.571731393785322e+11;

(Mark L. Stone) #7

I don’t know why you are getting the margchk error, which is from the line of code `error( nargchk( 0, 1, nargin ) ); %#ok` . Are you using CVX 2.1? If you are using CVX 3.0, please try using CVX 2.1. Or try reinstalling CVX and CVX QUAD.

I’m not clear whether you are showing all output in order in a single run, but if so, it appears that due to the nargchk error, CVX wound up using the successive approximation method after all (I don’t know whether that cam/did happen).

And you still have the matter of improving the scaling of the problem.

(zy) #8

Dear Stone, thanks for your advice. I eventually found out that this place was wrong：

sb_left - 1 <= 0;

When I wrote it as follows

sb_left <= 1;

I got the right result.

## Cones | Errors | Mov/Act | Centering Exp cone Poly cone | Status --------±--------------------------------±-------- 196/200 | 8.000e+00 2.013e+02 1.320e+02 | Solved 143/144 | 8.000e+00 3.985e+01 1.649e+01 | Solved 136/137 | 8.000e+00 1.238e+01 8.021e+00 | Solved 90/ 98 | 3.059e-01 2.479e+00 2.479e+00 | Solved 0/ 4 | 4.031e-01 1.378e+00 1.350e+00 | Solved

Status: Solved
Optimal value (cvx_optval): +0.555736

Even not use CVXQUAD and any scaling method.

(Mark L. Stone) #9

I don’t understand what happened. Was changing `sb_left - 1 <= 0;` to `sb_left <= 1;` the only change you made between CVX failing and succeeding? If `sb_left - 1 <= 0` was accepted by CVX, then I think it should not be different than `sb_left <= 1;` unless somehow it caused CVX to provide the mathematically equivalent problem to the solver in a slightly different way which, due to luck, worked out better.

Or was `sb_left - 1 <= 0;` rejected vy CVX, so really the constraint was skipped, and that was the wrong model and difficult to solve. And formulating with `sb_left <= 1;` caused the constraint to be accepted by CVX? That could make sense.

(zy) #10

I also found that the robustness of this program is worth considering. It always is wrong. Such as:

## Cones | Errors | Mov/Act | Centering Exp cone Poly cone | Status --------±--------------------------------±-------- 179/179 | 8.000e+00 3.661e+01 0.000e+00 | Solved 97/ 97 | 4.448e+00 1.118e+00 0.000e+00 | Solved 36/ 36 | 1.047e-01 8.928e-04 0.000e+00 | Solved 3/ 3 | 1.296e-02 1.403e-06 0.000e+00 | Solved 2/ 2 | 7.861e-01 4.145e+00 0.000e+00 | Solved 3/ 3 | 8.000e+00 4.330e+00 0.000e+00 | Solved 52/ 52 | 8.000e+00 1.678e+01 0.000e+00 | Solved 52/ 52 | 8.000e+00s 2.853e+01s 0.000e+00 | Solved 51/ 51 | 8.000e+00 3.970e+01 0.000e+00 | Solved 57/ 57 | 6.896e+00 5.243e+01 0.000e+00 | Solved 57/ 57 | 7.471e-01 5.382e+01s 0.000e+00 | Solved 57/ 57 | 8.000e+00s 5.406e+01s 0.000e+00 | Solved 63/ 63 | 8.000e+00 7.713e+01 0.000e+00 | Solved 71/ 72 | 3.783e+00 4.854e+01 0.000e+00 | Solved 60/ 61 | 6.794e-02 5.162e+01 0.000e+00 | Solved 58/ 58 | 1.240e-03 5.171e+01 0.000e+00 | Solved 57/ 57 | 3.060e-04 5.175e+01 0.000e+00 | Solved 57/ 57 | 4.358e-04s 5.038e+01s 0.000e+00 | Solved 57/ 57 | 8.000e+00s 5.169e+01s 0.000e+00 | Solved 135/136 | 8.000e+00 7.908e+01 0.000e+00 | Inaccurate/Solved 137/141 | 8.000e+00 5.225e+01 0.000e+00 | Inaccurate/Solved 144/144 | 8.000e+00 8.834e+01 0.000e+00 | Inaccurate/Solved 200/200 | 4.783e+00 5.228e+01 0.000e+00 | Solved 176/176 | 8.000e+00 5.138e+01 0.000e+00 | Inaccurate/Solved 178/178 | 8.000e+00 8.019e+01 0.000e+00 | Inaccurate/Solved

Status: Failed
Optimal value (cvx_optval): NaN

## Cones | Errors | Mov/Act | Centering Exp cone Poly cone | Status --------±--------------------------------±-------- 184/184 | 8.000e+00 5.707e+01 0.000e+00 | Solved 126/126 | 8.000e+00 1.555e+00 0.000e+00 | Solved 62/ 62 | 8.000e+00 4.481e-02 0.000e+00 | Solved 6/ 7 | 8.000e+00 5.359e-06 0.000e+00 | Solved 2/ 2 | 8.000e+00 6.485e+00 0.000e+00 | Solved 22/ 22 | 8.000e+00 1.624e+01 0.000e+00 | Solved 42/ 42 | 8.000e+00 2.677e+01 0.000e+00 | Solved 113/113 | 8.000e+00 5.403e+01 0.000e+00 | Solved 111/111 | 8.000e+00 3.768e+01 0.000e+00 | Solved 55/ 55 | 8.000e+00 4.864e+01 0.000e+00 | Solved 127/127 | 8.000e+00 8.142e+01 0.000e+00 | Solved 130/130 | 8.000e+00 5.744e+01 0.000e+00 | Solved 134/134 | 8.000e+00 9.156e+01 0.000e+00 | Solved 166/166 | 8.000e+00 7.278e+01 0.000e+00 | Solved 111/111 | 8.000e+00 8.510e+01 0.000e+00 | Solved 167/167 | 8.000e+00 7.275e+01 0.000e+00 | Solved 119/119 | 8.000e+00 9.210e+01 0.000e+00 | Solved 161/161 | 8.000e+00 5.913e+01 0.000e+00 | Solved 135/135 | 8.000e+00 9.800e+01 0.000e+00 | Solved 145/145 | 8.000e+00 7.617e+01 0.000e+00 | Solved 157/157 | 8.000e+00 5.659e+01 0.000e+00 | Solved 129/129 | 8.000e+00 9.554e+01 0.000e+00 | Solved 126/126 | 8.000e+00 8.531e+01 0.000e+00 | Solved 160/160 | 8.000e+00 5.808e+01 0.000e+00 | Solved 126/126 | 8.000e+00 9.518e+01 0.000e+00 | Solved

Status: Failed
Optimal value (cvx_optval): NaN

and I really don’t know why. The correct result can always be given by a few iterations, vice versa.