資源簡介
Boyd凸優化資料(內含中英文課本教材、習題、PPT、Matlab習題)建議大家配合官網上的視頻食用,效果更佳喲~
代碼片段和文件信息
%?Generates?figures?10.1?10.2?10.3?10.4?of?Boyd?&?Vandenberghe
%?Convex?Optimization
%
%?Infeasible?start?Newton?method?for?solving
%
%?????minimize???-sum_i?log?x_i
%?????subject?to?Ax?=?b
%?Generate?a?feasible?problem.
rand(‘state‘3);???
randn(‘state‘4);
n?=?100;????????
m?=?50;????????
A?=?randn(mn);
x0?=?rand(n1);
b?=?A*x0;????????
%?Apply?infeasible?Newton?method?to?KKT?conditions
%
%?????-1./x?+?A‘*w?=?0?
%??????A*x?=?b
alpha?=?0.011;
beta??=?0.5;
tol?=?1e-12;
maxiters?=?20;
x?=?ones(n1);??
w?=?zeros(m1);?
resp?=?zeros(1?maxiters);
resd?=?zeros(1?maxiters);
steps?=?zeros(1?maxiters);
for?k=1:maxiters
????rp?=?A*x-b;??rd?=?-1./x?+?A‘*w;??
????resp(k)?=?norm(rp);??resd(k)?=?norm(rd);
????normr?=?norm([rd;?rp]);
????if?normr?1e-12?break;?end;
????dw?=?-?(A?*?diag(x.^2)?*?A‘)?\?(A*((x.^2).*rd)?-?rp);?
????dx?=?-?(x.^2)?.*?(rd?+?A‘*dw);
????s?=?1;
????while?min(x+s*dx)?<=?0??s?=?s*beta;?end;
????while?norm([?-1./(x+s*dx)?+?A‘*(w+s*dw);??A*(x+s*dx)-b?])?>?...
????????(1-alpha*s)?*?normr
????????s?=?s*beta;
????end;
????steps(k)?=?s;
????x?=?x?+?s*dx;
????w?=?w?+?s*dw;
end;
%?Figure?10.1
figure(1)
semilogy([0:k-1]?resp(1:k)?‘o‘?[0:k-1]?resp(1:k)?‘-‘?...
????[0:k-1]?resd(1:k)?‘o‘?[0:k-1]?resd(1:k)?‘--‘);
xlabel(‘iteration?number‘)
ylabel(‘residuals‘)
%?Figure?10.2?
figure(2);
plot([1:k-1]?steps(1:k-1)?‘o‘?[1:k-1]?steps(1:k-1)?‘-‘);
xlabel(‘iteration?number‘)
ylabel(‘step?length‘)
axis([0?12?0.4?1.1]);
%?Generate?an?infeasible?problem.
rand(‘state‘3);
randn(‘state‘4);
A?=?randn(mn);
x0?=?randn(n1);?
b?=?A*x0;???????
%?Apply?infeasible?Newton?method?to?KKT?conditions
%
%?????-1./x?+?A‘*w?=?0?
%??????A*x?=?b
alpha?=?0.011;
beta??=?0.5;
tol?=?1e-12;
maxiters?=?21;
x?=?ones(n1);??
w?=?zeros(m1);?
resp?=?zeros(1?maxiters);
resd?=?zeros(1?maxiters);
steps?=?zeros(1?maxiters);
for?k=1:maxiters
????rp?=?A*x-b;??rd?=?-1./x?+?A‘*w;??
????resp(k)?=?norm(rp);??resd(k)?=?norm(rd);
????normr?=?norm([rd;?rp]);
????if?normr?1e-12?break;?end;
????dw?=?-?(A?*?diag(x.^2)?*?A‘)?\?(A*((x.^2).*rd)?-?rp);?
????dx?=?-?(x.^2)?.*?(rd?+?A‘*dw);
????s?=?1;
????while?min(x+s*dx)?<=?0??s?=?s*beta;?end;
????while?norm([?-1./(x+s*dx)?+?A‘*(w+s*dw);??A*(x+s*dx)-b?])?>?...
????????(1-alpha*s)?*?normr
????????s?=?s*beta;
????end;
????steps(k)?=?s;
????x?=?x?+?s*dx;
????w?=?w?+?s*dw;
end;
%?Figure?10.3
figure(3)
semilogy([0:k-1]?resp(1:k)?‘o‘?[0:k-1]?resp(1:k)?‘-‘?...
????[0:k-1]?resd(1:k)?‘o‘?[0:k-1]?resd(1:k)?‘--‘);
xlabel(‘iteration?number‘)
ylabel(‘residuals‘)
%?Figure?10.4?
figure(4);
plot([1:k-1]?steps(1:k-1)?‘o‘?[1:k-1]?steps(1:k-1)?‘-‘);
xlabel(‘iteration?number‘)
ylabel(‘step?length‘)
axis([0?20?0?0.3]);
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????????0??2018-12-05?17:31??Boyd鍑鎬紭鍖栬祫鏂?
?????文件?????1737448??2018-11-29?16:25??Boyd鍑鎬紭鍖栬祫鏂?slides-Convex?Optimization.pdf
?????目錄???????????0??2018-12-05?17:31??__MACOSX\
?????文件???????????0??2018-12-05?17:31??__MACOSX\Boyd鍑鎬紭鍖栬祫鏂?
?????文件?????????558??2018-11-29?16:25??__MACOSX\Boyd鍑鎬紭鍖栬祫鏂?._slides-Convex?Optimization.pdf
?????文件?????1121365??2018-11-29?16:24??Boyd鍑鎬紭鍖栬祫鏂?bv_cvxbook_extra_exercises.pdf
?????文件?????????530??2018-11-29?16:24??__MACOSX\Boyd鍑鎬紭鍖栬祫鏂?._bv_cvxbook_extra_exercises.pdf
?????目錄???????????0??2018-11-29?11:39??Boyd鍑鎬紭鍖栬祫鏂?chapter?9\
?????文件????????4525??2018-11-29?11:39??Boyd鍑鎬紭鍖栬祫鏂?chapter?9\figure_9_25.m
?????目錄???????????0??2018-12-05?17:31??__MACOSX\Boyd鍑鎬紭鍖栬祫鏂?chapter?9\
?????文件?????????628??2018-11-29?11:39??__MACOSX\Boyd鍑鎬紭鍖栬祫鏂?chapter?9\._figure_9_25.m
?????文件????????2488??2018-11-29?11:39??Boyd鍑鎬紭鍖栬祫鏂?chapter?9\figure_9_7.m
?????文件?????????627??2018-11-29?11:39??__MACOSX\Boyd鍑鎬紭鍖栬祫鏂?chapter?9\._figure_9_7.m
?????文件????????9320??2018-11-29?11:39??Boyd鍑鎬紭鍖栬祫鏂?chapter?9\figure_9_3.m
?????文件?????????627??2018-11-29?11:39??__MACOSX\Boyd鍑鎬紭鍖栬祫鏂?chapter?9\._figure_9_3.m
?????文件????????5007??2018-11-29?11:39??Boyd鍑鎬紭鍖栬祫鏂?chapter?9\figure_9_6.m
?????文件?????????627??2018-11-29?11:39??__MACOSX\Boyd鍑鎬紭鍖栬祫鏂?chapter?9\._figure_9_6.m
?????文件?????????553??2018-11-29?11:39??Boyd鍑鎬紭鍖栬祫鏂?chapter?9\figure_9_2.m
?????文件?????????627??2018-11-29?11:39??__MACOSX\Boyd鍑鎬紭鍖栬祫鏂?chapter?9\._figure_9_2.m
?????文件????????1473??2018-11-29?11:39??Boyd鍑鎬紭鍖栬祫鏂?chapter?9\figure_9_23.m
?????文件?????????628??2018-11-29?11:39??__MACOSX\Boyd鍑鎬紭鍖栬祫鏂?chapter?9\._figure_9_23.m
?????文件?????????176??2018-11-29?11:39??__MACOSX\Boyd鍑鎬紭鍖栬祫鏂?._chapter?9
?????目錄???????????0??2018-11-29?11:40??Boyd鍑鎬紭鍖栬祫鏂?chapter?10\
?????文件????????3802??2018-11-29?11:40??Boyd鍑鎬紭鍖栬祫鏂?chapter?10\figure_10_6.m
?????目錄???????????0??2018-12-05?17:31??__MACOSX\Boyd鍑鎬紭鍖栬祫鏂?chapter?10\
?????文件?????????629??2018-11-29?11:40??__MACOSX\Boyd鍑鎬紭鍖栬祫鏂?chapter?10\._figure_10_6.m
?????文件????????1570??2018-11-29?11:40??Boyd鍑鎬紭鍖栬祫鏂?chapter?10\figure_10_5.m
?????文件?????????629??2018-11-29?11:40??__MACOSX\Boyd鍑鎬紭鍖栬祫鏂?chapter?10\._figure_10_5.m
?????文件????????2702??2018-11-29?11:39??Boyd鍑鎬紭鍖栬祫鏂?chapter?10\figure_10_1.m
?????文件?????????629??2018-11-29?11:39??__MACOSX\Boyd鍑鎬紭鍖栬祫鏂?chapter?10\._figure_10_1.m
?????文件?????????176??2018-11-29?11:40??__MACOSX\Boyd鍑鎬紭鍖栬祫鏂?._chapter?10
............此處省略23個文件信息
評論
共有 條評論