This problem has to do with proper scaling (again) of an LP.
It seems like CVX is extremely sensitive to different scaling. I provide example code which happens to mimic my own problem to illustrate the issue. Note that I have checked the condition number and it should be considered low already (<10).
The tall matrix C included as part of the optimization problem (Cx<=b) is full column rank. Note that it is random since I need to perform Monte Carlo simulations.
The wanted order of magnitude for the largest matrix element can be changed with a parameter (wantedPowerOf10) in the example code. Please note that the optimization variables model power, so the solution should not be negative (though it sometimes does, and I am not sure how to deal with this).
Please advise. Your help is utmost appreciated. Thank you.
Edit:
% ---------------------------------------------------
clear all
n = 3; m = 5;
% Lower and upper bounds on opt. variables
bMax = 0.1;
b = bMaxones(m,1);
l = zeros(n,1);
u = bMaxones(n,1);
wantedPowerOf10 = 0;
% Example 1
rng(0,‘twister’);
A = (1e-5)rand(n,m);
B = (A.’) * inv(A(A.’));
C = abs(B).^2;
largestPowerOf10 = max(max(floor(log10©), [], 2));
scalar1 = 10^(largestPowerOf10 - wantedPowerOf10);
Cscaled = C/scalar1;
bscaled = b/scalar1;
uscaled = u/scalar1; % The lower bound is all-zeros and need not be scaled
cvx_begin quiet
variable x(n)
maximize( sum(x) )
subject to
Cscaledx <= bscaled
l <= x <= uscaled
cvx_end
x = xscalar1
% Example 2
rng(2,‘twister’);
A = (1e-5)rand(n,m);
B = (A.’) * inv(A(A.’));
C = abs(B).^2;
largestPowerOf10 = max(max(floor(log10©), [], 2));
scalar2 = 10^(largestPowerOf10 - wantedPowerOf10);
Cscaled = C/scalar2;
bscaled = b/scalar2;
uscaled = u/scalar2; % The lower bound is all-zeros and need not be scaled
cvx_begin quiet
variable x(n)
maximize( sum(x) )
subject to
Cscaledx <= bscaled
l <= x <= uscaled
cvx_end
x = xscalar2
% ---------------------------------------------------