# DCP less-than inequality expression rule

The DCP less-than inequality expression rule is descriped as
A less-than inequality constraint, using <=, where the left side (f) is convex and the right side(g) is concave. (http://cvxr.com/cvx/doc/dcp.html)
In my function f is convex, while g is affine. When running the function there are no warnings or errors.
I suspect my function is right or not.
What’s more ,the constrain condition is alphaf(x)<g(x), where x is variable ,alpha is known parameter.
f(x)=norm(sum(w_i(x))),g(x)=A
abs(w_j(x)),A is known real vector ，w_i(x) is the expression of x. x is real vevtor , but w_i(x) is complex vector.
I try to change the value of alpha, but the result of x remain unchanged.
f(x) has negative value when the end of cvx, the result is normal if value of x is substituted into f(x).I do not know how to explain this phenomenon.

I try to change the expresion of f(x) or g(x) ,but convex<= convex is also forbidden.
May I convert f(x) into affine type? or approximate f(x) ? But how to do it?
Thanks !

This post is not very clear. Perhaps you can show a complete reproducible example.

If you really try to have abs(…) for g() then it is against DCP rules, it is not a concave function. It is not affine either.

I am sorry for misleading you. Here is my code.

cvx_begin

``````variable t nonnegative
variable x(m,k) nonnegative
expressions f(k,1) nonnegative
expressions g(k,1) nonnegative
for i=1:k;
f(i)= abs(phi(idx_cell{i},i)).'*x(idx_cell{i},i)*norm(u(i,:));
g_sum_tmp=zeros(1,size(u,2));
for j=1:k;
if j~=i;
tmp=(phi(idx_cell{j},i).*rho(idx_cell{j},j)).'*x (idx_cell{j},j)*u(j,:);
g_sum_tmp=g_sum_tmp+tmp;
end;
end;
g(i)=norm(g_sum_tmp);
end;
minimize(t)
subject to
alpha*g-f<=0;
for  ii=1:m;
x(ii,:).^2*(psi(ii,:).')<=t;
end;
t>=0;
t<=1;
``````

cvx_end

Known parameters :

Name Type Size

phi complex matrix m*k

rho complex matrix m*k

idx_cell cell (real vector) k*1

u complex matrix k*n

psi real matrix m*k

alpha positive number 1*1

m positive number 1*1

k positive number 1*1

n postive number 1*1

Output parameter

Name Type Size

x real matrix m*k

Thanks for your kind reminding. Here is my code

cvx_begin

``````variable t nonnegative
variable x(m,k) nonnegative
expressions f(k,1) nonnegative
expressions g(k,1) nonnegative
for i=1:k;
f(i)= abs(phi(idx_cell{i},i)).'*x(idx_cell{i},i)*norm(u(i,:));
g_sum_tmp=zeros(1,size(u,2));
for j=1:k;
if j~=i;
tmp=(phi(idx_cell{j},i).*rho(idx_cell{j},j)).'*x (idx_cell{j},j)*u(j,:);
g_sum_tmp=g_sum_tmp+tmp;
end;
end;
g(i)=norm(g_sum_tmp);
end;
minimize(t)
subject to
alpha*g-f<=0;
for  ii=1:m;
x(ii,:).^2*(psi(ii,:).')<=t;
end;
t>=0;
t<=1;
``````

cvx_end

Known parameters :

Name Type Size

phi complex matrix m*k

rho complex matrix m*k

idx_cell cell (real vector) k*1

u complex matrix k*n

psi real matrix m*k

alpha positive number 1*1

m positive number 1*1

k positive number 1*1

n postive number 1*1

Output parameter

Name Type Size

x real matrix m*k

I haven’t studied your program in its entirety. But I will say that

``````expressions f(k,1) nonnegative
expressions g(k,1) nonnegative
``````

do not do what you think. In each statement, you are declaring `nonnegative` to be an expression. You are not constraining `f` or `g` to be nonnegative. To do that, you need to specify constraints such as `f >= 0`, `g >= 0`. And do that only after you have assigned whatever you want to `f` and `g`