CVX binary variable declaration problem

조회 수: 12 (최근 30일)
Rupa
Rupa 2023년 11월 21일
댓글: Rupa 2023년 11월 22일
i am trying to solve the below code using cvx. my variables are a and b which will be stored in L_ac and L_de as required.but it seems like it's not doing so, and i am getting inf optimized value and NaN for variables. did i declare the variables worng? anyone can help?
%Initialization of ac and de set
L_ac= ones(L,1);
L_de= zeros(L,1);
cvx_begin
cvx_solver mosek
variable a(L, 2) binary % status of ap l in t_c and t_c+t_s time
variable b(L) binary % Serving set of AP
for l = 1:L
L_ac(l) >= a(l, 1); % If a(l, 1) == 1, then L_ac(l) must be 1
L_de(l) >= 1 - a(l, 1); % If a(l, 1) == 0, then L_de(l) must be 1
1 <= b(l) <= L_ac(l); % b(l) is 1 when L_ac(l) == 1
end
*rest of the code for obj and constraint (if needed i can add)

답변 (1개)

Angelo Yeo
Angelo Yeo 2023년 11월 22일
I suggest you go to CVX forum to ask questions related to CVX.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by