the same value resulted from the linear optimization problem
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello everyone,
I'd like to get the optimized value of w_k for a number of " k" users.. in objfun_25 as shown below. I got the value of " w_k" for all k users equal to zero (w_optimized in the below code).. and this is not logic..
can anyone help me to know ehere is the error in my code ?
w_k = optimvar('w_k',10,'Type','continuous','LowerBound',-Inf,'UpperBound',0);
k_=[1,1,1,1,1,1,1,1,1,1];
Pt=1;
lamda=[ 1.4856,0.4647,0.0276,1.1583,0.9820,0.2113,0.5524,0.6909,0.1797,0.3763];
beta=[ 0.3414,0.1707,0.1138,0.0854,0.0683,0.0569,0.0488,0.0427,0.0379,0.0341];
tau=0.1;
segma_squared=10^-9;
v_k=[0.0145,0.0461,0.6900,0.0194,0.0227,0.0989,0.0394,0.0318,0.1154,0.0569];
for k=1:10
eita_wk(k)=-k_(k) *w_k(k)-k_(k)*log2(lamda(k)*(1-tau^2))*Pt + 2*k_(k)*log2(sqrt(segma_squared))-v_k(k);
w(k)=beta(k)*eita_wk(k);
end
objfun_25=sum(w);
ProCach3=optimproblem; % create an optimization problem
ProCach3.Objective=objfun_25; %minimization equation
opts3=optimoptions('linprog','Display','off','MaxTime',3600*12);
[sol3,fval3,exitflag3,output3]=solve(ProCach3,'Options',opts3)
w_optimized=sol3.w_k;
Thank you very much
0 commentaires
Réponses (1)
Torsten
le 28 Nov 2022
Modifié(e) : Torsten
le 28 Nov 2022
You define
w(k)=beta(k)*(-k_(k) *w_k(k)-k_(k)*log2(lamda(k)*(1-tau^2))*Pt + 2*k_(k)*log2(sqrt(segma_squared))-v_k(k));
and want to minimize the sum over k of this expression with respect to w_k where you set the constraint as -Inf < w_k(k) <= 0.
Now if you multiply out the expression for w(k), you can write
w(k) = beta(k)*(-k_(k)) w_k(k) + beta(k)*(-k_(k)*log2(lamda(k)*(1-tau^2))*Pt + 2*k_(k)*log2(sqrt(segma_squared))-v_k(k))
= T1 + T2
with
T1 = beta(k)*(-k_(k)) w_k(k)
and
T2 = beta(k)*(-k_(k)*log2(lamda(k)*(1-tau^2))*Pt + 2*k_(k)*log2(sqrt(segma_squared))-v_k(k))
T2 does not depend on w_k(k), so it can be discarded in the optimization for w_k.
So you try to find w_k such that
sum(beta(k)*(-k_(k))*w_k(k))
is minimized where -Inf < w_k <=0.
Now beta and k_ are both >=0 and w_k is constrained to be <= 0.
Thus the sum is minimized (with value 0) if w_k(k) = 0 for all k.
4 commentaires
Voir également
Catégories
En savoir plus sur Get Started with Optimization Toolbox 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!