Hello,

my code is that

cvx_begin

expressions sum_rate(num_user, 1)

```
expressions objective_1(num_user, 1)
expressions objective_1_tmp(num_user, 1)
expressions tmp(num_user, 1)
expressions tmp_tmp(num_user, 1)
expressions objective_2(num_user, 1)
expressions objective_2_tmp(num_user, 1)
variable W(num_antenna, num_antenna, num_user) complex;
variable R(num_antenna, num_antenna) complex;
for k = 1:num_user
for i = 1:num_user
objective_1_tmp(k) = objective_1_tmp(k) + real(trace(channel(:,k) * channel_her(k,:) * W(:,:,i)));
if i == k
continue;
end
alpha_tmp(k) = alpha_tmp(k) + real(trace(channel(:,k) * channel_her(k,:) * W_t(:,:,i)));
end
alpha(k) = alpha_tmp(k) + real(trace(channel(:,k) * channel_her(k,:) * R_t)) + noise_power;
alpha(k) = log(alpha(k)) / log(2);
B(:,:,k) = channel(:,k) * channel_her(k,:);
B(:,:,k) = B(:,:,k) / (alpha_tmp(k) + real(trace(channel(:,k) * channel_her(k,:) * R_t)) + noise_power);
B(:,:,k) = B(:,:,k) / log(2);
for i = 1:num_user
if i == k
continue;
end
objective_2_tmp(k) = objective_2_tmp(k) + real(trace(B(:,:,k) * (W(:,:,i) - W_t(:,:,i))));
end
tmp(k) = objective_1_tmp(k) + real(trace(channel(:,k) * channel_her(k,:) * R)) + noise_power;
tmp_tmp(k) = log(tmp(k));
objective_1(k) = tmp_tmp(k) / log(2);
objective_2(k) = alpha(k) + objective_2_tmp(k) + real(trace(B(:,:,k) * (R - R_t)));
sum_rate(k) = objective_1(k) - objective_2(k);
sensing_constraint_tmp = sensing_constraint_tmp + W(:,:,k);
power_constraint_tmp = power_constraint_tmp + real(trace(W(:,:,k)));
end
maximize(sum(sum_rate));
subject to
for k = 1:num_user
W(:,:,k) == hermitian_semidefinite(num_antenna);
end
R == hermitian_semidefinite(num_antenna);
power_constraint = power_constraint_tmp + real(trace(R));
power_constraint <= p_max;
for j = 1:num_target
distance_target = get_distance(uav, target(j,:));
sterring_target = get_steering(distance_target);
sterring_target_her = transpose(conj(sterring_target));
sensing_constraint = real(sterring_target_her * (sensing_constraint_tmp + R) * sterring_target);
sensing_constraint >= sensing_th * distance_target^2;
end
cvx_end
among them,
tmp(k) = objective_1_tmp(k) + real(trace(channel(:,k) * channel_her(k,:slight_smile: * R)) + noise_power;
tmp_tmp(k) = log(tmp(k));
tmp(k) is cvx real affine expression (scalar)
tmp_tmp(k) is cvx concave expression (scalar)
but after cvx_end
tmp(1) is 3.6746e-11, tmp_tmp(1) is -18.4045 but log(tmp(1)) is -24.0270
It is not same for all k
```