I have written the following code, aiming to find the optimum values of p(1), p(2), l(1), l(2) and r(1), r(2) in order to minimize the sum of z*C^3*pow_p(l,3)/T^2+p*T. However, the constraint for r(2) is not satisfied, therefore resulting in wrong values. Could please someone provide some help, in what might be wrong with my code? My code is provided below:

```
B_sub = 200000;
L = 10^5;
z = 10^-12;
C = 10;
T = 1;
cvx_begin
variable p(2)
variable l(2)
variable r(2)
minimize sum(z*C^3*pow_p(l,3)/T^2+p*T)
subject to
r >= (L-l)/(B_sub*T) % Rate constraint
p >= 0 % Power constraint (low)
p <= z*C^3*L^3/T^3 % Power constraint (high)
l >= 0 % Local data constraint (low)
l <= L % Local data constraint (high)
% MAC contraints
r(1) <= -rel_entr(1,1+p(1)*norm(CG(uiid(1)))^2/(d(uiid(1))^4))/0.6931
r(2) <= -rel_entr(1,1+p(2)*norm(CG(uiid(2)))^2/(d(uiid(2))^4))/0.6931
r(1)+r(2) <= -rel_entr(1,1+p(1)*norm(CG(uiid(1)))^2/(d(uiid(1))^4)+p(2)*norm(CG(uiid(2)))^2/(d(uiid(2))^4))/0.6931
cvx_end
```

In addition, the final result is Inaccurate/Solved, i know this might result in not accurate values, but the results I are way off for just the value of r(2).

Also, can I have an equality constraint in my optimization problem?

i.e. `l == L-r*B_sub*T,`

where l and r are parameters need to be found

I know it’s a lot, but any advice or suggestion would be very much appreciated.