N = 20;%Number of Channels
Pt = 20;%Available Power
Alpha = 1/3 + (1 - 1/3) * rand(N,1);%Alpha is between 1/3 & 1
Itteration = 1;
Lambda_min = 0;
Lambda_star = ( max(Alpha) + min(Alpha) ) / ( 2 * log(2) );
Lambda_max = max(Alpha);
Lambda_temp = Lambda_star;
P_sol = 1 / ( log(2) * Lambda_star ) - 1 ./ Alpha ;
for i = 1 : N %Replacing Negative Calculated Power by 0
if P_sol(i) < 0
P_sol(i) = 0;
end
end
P_sol_opt = sum (P_sol);
while ( abs( P_sol_opt - Pt ) > 0.0001 || P_sol_opt > 20 )
%Searching for Optimum Lambda
if P_sol_opt > Pt
Lambda_min = Lambda_star;
Lambda_star = ( Lambda_star + Lambda_max ) / 2;
Lambda_temp ( Itteration + 1 ) = Lambda_star;
Itteration = Itteration + 1;
P_sol = 1 / ( log(2) * Lambda_star ) - 1 ./ Alpha ;
for i = 1 : N
if P_sol(i) < 0
P_sol(i) = 0;
end
end
P_sol_opt = sum (P_sol);
else
Lambda_max = Lambda_star;
Lambda_star = ( Lambda_min + Lambda_star ) / 2;
Lambda_temp (Itteration+1) = Lambda_star;
Itteration = Itteration + 1;
P_sol = 1 / ( log(2) * Lambda_star ) - 1 ./ Alpha ;
for i = 1 : N
if P_sol(i) < 0
P_sol(i) = 0;
end
end
P_sol_opt = sum (P_sol);
end
end
New-Text-Document.zip_convex_convex optimization
版权申诉
31 浏览量
2022-07-14
02:24:10
上传
评论
收藏 582B ZIP 举报
![avatar](https://profile-avatar.csdnimg.cn/d600a32f29294db1a3be82ec9708491a_weixin_42651887.jpg!1)
weixin_42651887
- 粉丝: 83
- 资源: 1万+
最新资源
- TM3400BGN-VB一款SOT23封装N-Channel场效应MOS管
- matlab大作业1.zip
- MapReduce中实现案例中的排序案例
- Java项目-基于SSM+JSP的毕业生就业信息管理系统的设计与实现(源码+数据库脚本+部署视频+代码讲解视频+全套软件)
- python用requests爬取古代诗人名字
- TM2302N/FN-VB一款SOT23封装N-Channel场效应MOS管
- MapReduce的词频统计JAVA源码
- vtk+C++利用鼠标交互画线
- 基于LCD1602、MCP4161(SPI接口)、STM32F103C8T6的数字电位器应用proteus仿真设计
- Java项目-基于SSM+JSP的列车票务信息管理系统的设计与实现(源码+数据库脚本+部署视频+代码讲解视频+全套软件)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)