# Semidefinite Programming Problem

Hi
I am solving the following SDP beamforming design problem
For each user, I generate the channel gain
for u = 1 : size(UELocations,1)
Distance = norm(FAPLocations - UELocations(u,:)); % Distance between UE and BS.
PL = -((140.7 + 36.7log10(Distance10^-3))); % Distance based Pathloss.
Channel_Matrix = sqrt((10^(PL/10)))(randn(1,No_antennas)+1irandn(1,No_antennas));
Scaled_Channel_Gain(:,u) = Channel_Matrix./sqrt(Target_SNR*Noise_Power);
end
Then, I applied SDP to solve the problem
cvx_begin sdp
variable W(No_antennas,No_antennas) symmetric
minimize(trace(W))
for n = 1 : No_UE
Q = [Channel_Gain(:,n)Channel_Gain(:,n)’];
trace(Q
W) >= 1;
end
W == semidefinite(No_antennas)
cvx_end

The channel gain is a complex matrix. The following error appears and I cannot figure out what is wrong .

Error using cvxprob/newcnstr (line 192)
Disciplined convex programming error:
Invalid constraint: {complex affine} >= {real constant}

Error in >= (line 21)
b = newcnstr( evalin( ‘caller’, ‘cvx_problem’, ‘[]’ ), x, y, ‘>=’ );

Error in Beamforming_Design (line 21)
trace(Q*W) >= 1;

If you need W to be complex, this should be `complex symmetric` (but I guess you meaned ` hermitian`). Also, complex number cann’t be ojective or compared, you might need to add a `real()` to them. And `W == semidefinite(No_antennas)` can just be written as `W >= 0` in sdp mode.

1 Like

Thank you for the clarification. The error appears in this line “trace(QW) >= 1” inside the CVX I think Q needs to be real and symmetric but according to the reference paper Q is the multiplication of the channel gain vector and its hermitian.

Try `real(trace(QW)) >= 1`

1 Like

Thank you it works now