Adding spesific constraint for optimization problem in MATLAB usin fmincon function

조회 수: 1 (최근 30일)
I'm using the fmincon Function of Matlab to find an optimal solution of power assignments of users in a communication system.
An example scenario includes 3 users and the optimization function tries to find optimal power level assignment. The 'x' variable represents the power level assignments of each users.
Total power is equal to 1 and added as Linear equality constraint for the problem. Aeq*x=beq.
The lower bound and upper bound of each user power level is 0 and 1 consecutively.
The script below solves this optimization problem clearly and gives optimal power levels for all three users.
x0=[0.3,0.2,0.5];
lb=[0 0 0];
ub=[1 1 1];
Aeq = [1,1,1];
beq = [1];
options = optimoptions('fmincon','Algorithm','interior-point','Display','iter');
[x,fval,exitflag,output] = fmincon(@myOpt,x0,[],[],Aeq,beq,lb,ub,[],options);
-----------------------------------------------------------------------------
Here is my question.
I want to add a constraint that maximum two users can be assigned power level at the same time (i.e., x1=[0.1,0.9,0], x2=[0.2,0,0.8] or x2=[0,1,0]).
How can enable this constraint in the fmincon function or other functions in optimization toolbox?

답변 (1개)

Matt J
Matt J 2018년 6월 28일
You cannot handle this through constraints. Just solve the problem 3 times corresponding to the three cases x1=0,x2=0, and x3=0. Then see which of the 3 cases leads to the lowest myOpt value.
  댓글 수: 9
omer faruk gemici
omer faruk gemici 2018년 7월 2일
The given parameters 2 active users in given 3 three users are just simplified example of the original problem.
In the original problem we have around 50 users (max 2 active users) for each subcarrier and total number of subcarrier is 20.
In this scenario, for each subcarrier we have C(50,1) + C(50,2) = 1275 possible combinations to determine active users. Then totally we have 20^1275 possible solution which very large search space.
Matt J
Matt J 2018년 7월 2일
편집: Matt J 2018년 7월 2일
No, I don't think so. Firstly, there are only C(50,2)=1225 combinations per sub-carrier. The C(50,1) combinations are already accounted for, as I explained to Stephan.
Secondly, the optimization as you've described it is separable across sub-carriers. There are no constraints which cause pik, k=1...50, for the i-th carrier to interact with pjk,k=1...50 for the j-th carrier. Therefore, you can solve for each carrier separately, as if it is a 50 variable, 1-carrier problem.
So there are 20*1225=24500 combinations. Doesn't seem too bad.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by