I’m trying to maximize the sum rate of all users, however, CVX gives me this error
Illegal operation: log( {convex} ).
cvx_begin
variables P1 P2 Puav T
variable y1
variable y2
variable y3
% Define y1, y2, and y3 using valid convex expressions
A1=Abs_Channel_squared(1,1);
A2=Abs_Channel_squared(1,2);
A3=Abs_Channel_squared(1,3);
A4=Abs_Channel_squared(2,1);
A5=Abs_Channel_squared(2,2);
A6=Abs_Channel_squared(2,3);
y1 = quad_over_lin(P1 * A1, P2 * A1 + Puav * A4 + square_pos(abs(noise)));
y2 = quad_over_lin(P2 * A2, Puav * A5 + square_pos(abs(noise)));
y3 = quad_over_lin(Puav * A6, P1 * A3 + P2 * A3 + square_pos(abs(noise)));
maximize(log(1 + y1) + log(1 + y2) + log(1 + y3))
subject to
% Constraint: Power of each user should be greater than or equal to 0
P1 >= 0
P2 >= 0
Puav >= 0
P1 + P2 + Puav <= Pmax
cvx_end