The fact that the solver even began to work suggests that CVX agrees your problem is convex. (It would not have even begun if it did not). What it is saying is that the problem is infeasible: that there are no points that satisfy all the constraints.
If you are certain that the problem is feasible, then you’ve entered it into CVX incorrectly. However, you haven’t offered any source code, so there’s no way anyone can help you. Do look at this post to see how to format source code you include in your post.
Thanks Michael, I am having a look at the link you provided. Meanwhile, here is the code that I wrote:
function [A, W, obj] = algo3(X, U, S, delta, Rprime, Ebs, Beta)
n = size(X,1);
m = size(X,2);
A = zeros(n,n);
W = ones(n,n);
for t = 1:500
cvx_begin
variable eta(n,m)
expression constr;
for k = 1 : m
constr = constr + eta(:,k)'*Rprime(:,:,k)*eta(:,k);
end
obj = 0;
for i=1:n
for j=1:n
obj = obj + W(i,j)*abs(A(i,j));
end
end
minimize obj;
subject to
eta == A*X + U
for i = 1:n
for j = 1:m
if (isnan(S(i,j)) == 0)
if S(i,j) ~= 0
A(i,j) * S(i,j) >= delta;
else
-delta/2 <= A(i,j) <= delta/2
end
end
end
end
constr <= Beta*Ebs;
cvx_end
W = update(W,A);
end
end
I see nothing obviously wrong with how you’ve entered the model, so my only conclusion is that it is indeed infeasible. You can try other solvers to see if they agree.
Now that you mentioned it, I am trying to understand the problem with my code. So I want my objective function to solve for A iteratively (for a fixed number of iterations, lets say 500 times). I multiply absolute value of A(i,j) with W(i,j), and update W after each iteration of CVX solving the optimization problem. Should I be declaring A as a CVX variable? If yes, then can I initialize all elements of the CVX variable A to be zero before the first iteration even begins?
Every optimization variable must be declared as a variable in CVX, no exceptions. CVX does not consider initial values, so initializing A to be zero at the beginning does absolutely nothing. The value of A is determined entirely by the solution of the convex optimization problem.
I would suggest you go through the user’s guide and browse the examples so you can get a proper idea of how to use CVX.
You are absolutely right, the value of A is determined by the solution. I declared A as an n x n variable (but not W). But the problem still seems to be infeasible. I guess I should read more CVX examples to get a better understanding.