# How do I resolve the vector problem of cvx but the constraint is variable value?

I want to resolve the cvx problem like as below
p = (p1, p2, p3 … pk);

=============================================================================
cvx_begin
variable p(K) nonnegative

``````        fp_1_sum = 0;
Lp_1_sum = 0;
Lp_2_sum = 0;
for pk = 1:K
fp_interference_sum = 0;
Lp_interference_sum = 0;
for pj = 1:K
fp_interference = abs( H_sum * w(:,pj) )^2 * p(pj);   % fp_interference
fp_interference_sum = fp_interference_sum + fp_interference;

if pj ~= pk
Lp_interference = abs( H_sum * w(:,pj) )^2 * p0(pj);
Lp_interference_sum = Lp_interference_sum + Lp_interference;
end
end
fp_1 = log(fp_interference_sum + noise) / log(2);
fp_1_sum = fp_1_sum + fp_1;

Lp_1 = log(Lp_interference_sum + noise) / log(2);
Lp_1_sum = Lp_1_sum + Lp_1;

Lp_2_right_sum = 0;
for pjj = 1:K
if pjj ~= pk
Lp_2_right = ( abs( H_sum * w(:,pjj) )^2 * ( p(pjj) - p0(pjj) ) ) / ( Lp_interference_sum * log(2) );
Lp_2_right_sum = Lp_2_right_sum + Lp_2_right;
end
end
Lp_2_sum = Lp_2_sum + Lp_2_right_sum;
end
fp = fp_1_sum - lambda * P_sum;
Lp = Lp_1_sum + Lp_2_sum;

maximize (fp - Lp)
subject to
sum(p) <= Pmax

for pks = 1:K
p_qos_3_sum = 0;
for pjs = 1:K
if pjs ~= pks
p_qos_3 = abs( H_sum * w(:,pjs) )^2 * p(pjs);
p_qos_3_sum = p_qos_3_sum + p_qos_3;
end
end
p(pks) * abs( H_sum * w(:,pks) )^2 + ( 1 - 2^(Rmin) ) * ( p_qos_3_sum + noise ) >= 0
end
``````

# cvx_end

Error using + (line 83)
Disciplined convex programming error:
Illegal operation: {concave} - {complex affine}

Error in - (line 21)
z = plus( x, y, true, cheat );

Error in P_Optimize (line 163)
maximize (fp - Lp)

I do not have any idea to resolve the issue…
could you help me if you find some bugs? thanks

Apparently, some of the input data is complex. One way or another, the objective function must evaluate to real. How that should be accomplished for your problem is for you to determine, because forum readers don’t know what your optimization problem is supposed to do, or what kind of input data is suitable for it.

1 Like

Thank you very much.