Please see my problem below: the problem has 51 variables when I assume the variable of number 51 (u(51))is given I get a solution.

When I assume the variable number 51 is not given and try to solve for all 51 variables, I get the following message “Disciplined convex programming error: Cannot perform the operation: {real affine} .* {convex}”

I guess it is b/c in db equation the Cap which is u(51) is multiplied by the other variables (u)

```
N=51
L = 0.5*tril(ones(50))
cvx_begin
variables u(N)
Cap=u(51)
E0=Cap/2
db = 1000*Cap*max(1/eta*u(1:50),eta*u(1:50));
Es = E0+Cap*L*u(1:50);
N_PV=100
minimize sum(Load+db'-N_PV*PV)/(2*1000)*rate+rate_max*max((Load+db'
N_PV*PV)/1000)
u(1:50) <= 0.4;
u(1:50) >= -1;
u(51)>=0
u(51)<=100
Es <= Cap;
Es >= 0;
cvx_end
```