Adding spesific constraint for optimization problem in MATLAB usin fmincon function
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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?
0 commentaires
Réponses (1)
Matt J
le 28 Juin 2018
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 commentaires
Matt J
le 2 Juil 2018
Modifié(e) : Matt J
le 2 Juil 2018
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.
Voir également
Catégories
En savoir plus sur Solver Outputs and Iterative Display dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!