I am fairly new to cvx and optimization an I am having a bit of a hard time getting the constraints of my problem right.
I am trying to optimize the input charge and discharge power to a battery, whose product needs to be zero for physical reasons (cannot simultaneously charge and discharge).
My problem is set up as follows:
cvx_begin quiet
variables u(10,2)
expressions y_bar(10) C1(10) C2(10)
reshape_u = reshape(u',2*length(u),1);
%gets my input from 2 columns to 1 column
g_t = P_g*y_ini + Q_g*[u_ini; reshape_u];
y_bar = Yf*g_t - Gamma*(Yp*g_t - y_ini); % ny*10 x 1
norm_g = norm(g_t);
C1 = mu_p*(sqrt(diag(temp_1)) + norm(g_t)*sqrt(sigma*diag(temp_2)));
C2 = mu_p*( sqrt(diag(temp_1)) + norm_g*sqrt(sigma*diag(temp_2)));
minimize R*norm(u(:,1) + u(:,2),1) + gamma_1 * sum(pos(-upper_y_bound + y_bar + C1)) + gamma_2 * sum(pos(-y_bar + lower_y_bound + C2)) + norm(g_t)
subject to
zeros(10,2) <= u <= 65*ones(10,2);
**u(:,1).*u(:,2) == zeros(10,1);**
cvx_end
The problem is with the constraint in bold, which is non-convex. In fact if I run the algorithm like this I get the disciplined convex error. Is it possible to express it in a form solvable with mixed integer programming?