# How to solve this problem

(z_x) #1

POW_Pr=linspace(0.1,1,500);
for k=1:length(POW_Pr)

``````cvx_begin
variable Ps(k)
expressions  S_sd S_rd S_sr S_mrc
S_sd=((abs(H_sd))^2./POW_N).*Ps;
S_rd=POW_Pr(k).*((abs(H_rd))^2./POW_N) ;
S_sr=((abs(H_sr))^2./POW_N).*Ps;

S_mrc=S_sd+(S_rd.*S_sr).*inv_pos((S_rd+S_sr+1));

maximize (S_mrc)
subject to
Ps(k)>0;
Ps(k)+POW_Pr(k)<=p0;
cvx_end
``````

end

Disciplined convex programming error:
Cannot perform the operation: {real affine} .* {convex}

S_mrc=S_sd+(S_rd.*S_sr).*inv_pos((S_rd+S_sr+1));

(Mark L. Stone) #2

You have violated CVX’s rules.

`S_src` appears to be a linear fractional form, so I think you ought to be able to handle this problem per section 4.3.2 “Linear-fractional programming” of “Convex Optimization” by Boyd and Vandenberghe https://web.stanford.edu/~boyd/cvxbook/ . You should probably also read the material earlier in that book on linear fractional functions.

(z_x) #3

Sincerely thank you for your suggestion, I have read the relevant books and found the problem.