Hello,
I want to create an integer variable in my optimization problem, while Matlab raises the warning message:
Invalid matrix structure modifier: integer
Trying to declare multiple variables? Use the VARIABLES keyword instead.
My Matlab version is R2021a, and the solver is gurobi 9.5.0.
And my code is as follows, the warning message raises from the third line.
cvx_begin
variable x(SVC_count+v_count+l_count+P_count+Q_count);
variable OLTC integer
A_obj = [zeros(v_count, SVC_count), diag(ones(v_count, 1)), zeros(v_count,P_count+Q_count+l_count)];
b_obj = ones(v_count, 1);
minimize(norm(A_obj * x - b_obj))
subject to
p_A * x == p_rhs
q_A * x == q_rhs
v1_A * x == v1_rhs * (0.95 + 0.025 * OLTC)
v_A * x == v_rhs
SVC_A * x <= SVC_rhs
SVC_A * x >= 0
vmin_A * x >= vmin_rhs
vmax_A * x <= vmax_rhs
fai_A * x >= fai_rhs
OLTC >= 0
OLTC <= 5
for i = 1:l_count
norm([l_A1(i, :)*x; l_A2(i,:)*x-10; l_A3(i,:)*x-10]) <= l_c(i, :)*x
end
cvx_quiet true
cvx_end