MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (1) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (4) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (10) of matrix ‘A’.
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 25
Cones : 8
Scalar variables : 54
Matrix variables : 5
Integer variables : 0
Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries : 1 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 : 25
Cones : 8
Scalar variables : 54
Matrix variables : 5
Integer variables : 0
Per the Mosek warning messages, look for near zero (small magnitude) non-zero numbers in input data. if they are “junk” values which really should be exactly zero, then make them exactly zero, i.e., eliminate them. If they are “legitimately” non-zero, improve the numerical scaling of your problem by changing units, or something, so that all non-zero input data is within a small number of orders of magnitude of 1,
That may or may not resolve the issue. If it does not, your optimization model may need improvement. Because it’s not clear to me whether there may have been a preceding line of output indicating whether CVX provided the dual to the solver, I don 't know whether the Mosek output log reflects ill-posedness in your primal problem or in its dual.
Thanks for your reply.Here are my codes
[NT, K] = size(H);
cvx_begin
cvx_solver mosek
variable Wc(NT, NT) complex hermitian semidefinite
Wp = cell(K, 1);
for k = 1:K
Wp{k} = hermitian_semidefinite(NT);
end
expression W_tide
W_tide = Wc;
for k = 1:K
W_tide = W_tide+Wp{k};
end
variable t
variable r(K) nonnegative
variable alpha_p(K) nonnegative
variable beta_p(K)
variable alpha_c(K) nonnegative
variable beta_c(K)
expression const_p(K)
for k = 1:K
const_p(k) = log(1+1/((alpha_p_old(k)*beta_p_old(k))))/log(2);
end
expression first_order_alpha_p(K)
for k = 1:K
first_order_alpha_p(k) = -(alpha_p(k)-alpha_p_old(k))/((alpha_p_old(k)+(alpha_p_old(k))^2 * (beta_p_old(k)))*log(2));
% first_order_alpha_p(k) = -(alpha_p(k)-alpha_p_old(k))*inv_pos(((alpha_p_old(k)+((alpha_p_old(k))^2) * (beta_p_old(k)))*log(2)));
end
expression first_order_beta_p(K)
for k = 1:K
first_order_beta_p(k) =-(beta_p(k)-beta_p_old(k))/((beta_p_old(k)+(beta_p_old(k)^2) *(alpha_p_old(k)))log(2));
% first_order_beta_p(k) =-(beta_p(k)-beta_p_old(k))inv_pos(((beta_p_old(k)+(beta_p_old(k)^2)(alpha_p_old(k)))log(2)));
end
expression const_c(K)
for k = 1:K
const_c(k) = log(1+(1/(alpha_c_old(k)beta_c_old(k))))/log(2);
% const_c(k) = log(1+inv_pos((alpha_c_old(k)beta_c_old(k))))/log(2);
end
expression first_order_alpha_c(K)
for k = 1:K
first_order_alpha_c(k) = -(alpha_c(k)-alpha_c_old(k))/((alpha_c_old(k)+(alpha_c_old(k))^2 * (beta_c_old(k)))log(2));
% first_order_alpha_c(k) = -(alpha_c(k)-alpha_c_old(k))inv_pos(((alpha_c_old(k)+(alpha_c_old(k))^2 * (beta_c_old(k)))log(2)));
end
expression first_order_beta_c(K)
for k = 1:K
first_order_beta_c(k) =-(beta_c(k)-beta_c_old(k))/((beta_c_old(k)+(beta_c_old(k)^2) (alpha_c_old(k)))log(2));
% first_order_beta_c(k) =-(beta_c(k)-beta_c_old(k))inv_pos(((beta_c_old(k)+(beta_c_old(k)^2) (alpha_c_old(k)))log(2)));
end
maximize(t);
subject to
trace(W_tide) <= P_mW;
for k = 1:K
% r(k)+log(1+(1/(alpha_p(k)beta_p(k))))/log(2) >=t;
r(k)+const_p(k)+ first_order_alpha_p(k)+first_order_beta_p(k) >= t;
end
for k = 1:K
hk = H(:,k);
inv_pos(alpha_p(k)) <= real(trace(Wp{k}(hkhk’)));
% (alpha_p(k)) >=inv_pos(real(trace(Wp{k}(hkhk’))));
% alpha_p(k) >=1/trace(Wp{k}(hkhk’));
end
for k = 1:K
hk = H(:,k);
beta_p(k) >=real(trace((W_tide-Wc-Wp{k})(hkhk’))+sigma2_mW)+1e-8;
end
for k = 1:K
% sum(r) <=log(1+(1/(alpha_c(k)beta_c(k))))/log(2);
sum(r) <=const_c(k)+first_order_alpha_c(k)+first_order_beta_c(k);
end
% sum(r) <=min(const_c+first_order_alpha_c+first_order_beta_c);
for k = 1:K
hk = H(:,k);
% (alpha_c(k)) >= inv_pos(real(trace(Wc(hkhk’))));
inv_pos(alpha_c(k)) <= real(trace(Wc(hkhk’)));
end
for k = 1:K
hk = H(:,k);
beta_c(k) >=real(trace((W_tide-Wc)(hkhk’))+sigma2_mW);
end
cvx_end
In my model,the channel matrix 's order of magnitude is 1e-6,I don’t know if it’s the channel matrix that caused the input to be a very small number.
If i change the code
variable t
variable r(K) nonnegative
variable alpha_p(K) nonnegative
variable beta_p(K) nonnegative
variable alpha_c(K) nonnegative
variable beta_c(K) nonnegative
expression const_p(K) ,the problem can be “solved”,but in my constraint
beta_p(k) >=real(trace((W_tide-Wc-Wp{k})(hkhk’))+sigma2_mW)+1e-8
beta_c(k) >=real(trace((W_tide-Wc)(hkhk’))+sigma2_mW);Here RHS is always greater than 0 ,so why variable beta_p(K) nonnegative variable beta_c(K) nonnegative can lead to different answer?
You haven’t told us how the answers differ. if there is not a numerically significant difference in the optimal objective value, then it may be that the optimal solution is not unique, or is very sensitive to small changes in the problem.
But until you fix the numerical scaling and get rid of the Mosek warning messages, it may be that none of the solutions are reliable. So do that first.
Ok thanks for your reply.i have a new problem.When cvx got ‘solved’,i check the variable and constraint
beta_p(k)-real(trace((W_tide-Wc-Wp{k})(hkhk’))+sigma2_mW);
beta_p(1) is -2.5818e-05 and RHS is 1.7269e-05, so
beta_p(k)-real(trace((W_tide-Wc-Wp{k})(hkhk’))+sigma2_mW)>=0 is not satisfied,and
beta_p(k)-real(trace((W_tide-Wc-Wp{k})(hkhk’))+sigma2_mW) =-4.3087e-05. So Why cvx_status is ‘solved’,but can’t satisfy constraint? Looking forward to your reply.
Calling Mosek 9.1.9: 142 variables, 33 equality constraints
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (29) of matrix ‘A’.
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 33
Cones : 8
Scalar variables : 62
Matrix variables : 5
Integer variables : 0
Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries : 1 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 : 33
Cones : 8
Scalar variables : 62
Matrix variables : 5
Integer variables : 0
There is still a Mosek warning message. You have not adequately addressed that. Perhaps it is due to the 1e-8 in the constraint on beta_p(k)? Try changing that to 1e-5.
It appears that the constraint violation may be due to feasibility tolerance. You have to keep in mind that Mosek solves within feasibility tolerance for the constraints it is provided. However, CVX does transformations from the constraints you provide it to produce the constraints it sends to the solver (Mosek). When the transformation is reversed by CVX after solution by the solver, a constraint violation could become somewhat larger in terms of the original constraint provided to CVX. And the near zero input data might potentially exacerbate that.
Thanks for your reply! My real constraint is beta_p(k)-real(trace((W_tide-Wc-Wp{k})(hkhk’))+sigma2_mW)>=0,and sigma2_mW is the power of noise,sigma2_mW=1e-8,that is a classical value.I change to beta_p(k)-real(trace((W_tide-Wc-Wp{k})(hkhk’))+sigma2_mW)>=1e-8 in order to let beta_p(k)>=real(trace((W_tide-Wc-Wp{k})(hkhk’))+sigma2_mW) but it still can’t work.If **beta_p(k)**got a negative value,and i use sca next iteration *const_p(k) = log(1+1/((alpha_p_old(k)beta_p_old(k))))/log(2) will be wrong.And i will address the Mosek warning.
Yes, try to get the elements of `H’ to be close to magnitude 1.
I think that you need adequate scaling of everything else so that 1e-5, or maybe 1e-6 is adequate to ensure you get the strict nonnegativity you need in that constraint… Your other option is to adjust the solution from CVX prior to feeding them into your next iteration.
If you use SCA. there may be a risk that even if the 1st SCA iteration is well-scaled, some later iteration may not be. See