最优化理论作业

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
6|0.860|0.441|9.0e-06|1.0e-03|1.2e+01| 6.165978e+01 4.996343e+01| 0:0:00| chol 1 1
7|0.905|0.518|3.3e-06|5.1e-04|5.3e+00| 6.025036e+01 5.499107e+01| 0:0:00| chol 1 1
num. of constraints = 31
dim. of socp var = 101, num. of socp blk = 1
*******************************************************************
SDPT3: Infeasible path-following algorithms
dim. of free var = 30 *** convert ublk to lblk
*******************************************************************
SDPT3: Infeasible path-following algorithms
*******************************************************************
version predcorr gam expon scale_data
NT 1 0.000 1 0
it pstep dstep pinfeas dinfeas gap prim-obj dual-obj cputime
Calling SDPT3 4.0: 230 variables, 100 equality constraints
------------------------------------------------------------
num. of constraints = 100
dim. of socp var = 200, num. of socp blk = 100
14|1.000|0.269|3.8e-10|7.8e-06|6.7e-02| 5.969739e+01 5.963124e+01| 0:0:00| chol 1 1
15|0.859|0.771|1.8e-10|1.8e-06|1.5e-02| 5.969590e+01 5.968070e+01| 0:0:00| chol 1 1
16|0.983|0.966|2.1e-11|2.1e-05|6.8e-04| 5.969550e+01 5.969498e+01| 0:0:00| chol 1 1
17|0.989|0.989|2.4e-13|9.2e-07|1.1e-05| 5.969549e+01 5.969549e+01| 0:0:00| chol 1 1
Solution:
I choose the matrix for all 4problems,andvector with the former 3problems.WhenI try to solve the last problem with thesame ,the problem becomes to “Infeasible”. The reason is that most value of arelarger than 1.After trying many times, finally, Igenerate vector usingtherandn()function,and divide by 1.5.
2)Forℓ2-norm, the object function is ,and using thefollowingcodetosolvethe problem
cvx_begin
variable x(n);
minimize( norm(A*x-b,2));
cvx_end
The running result is as following:
2|1.000|0.990|3.9e-06|9.1e-02|1.5e+03| 1.491205e+03 2.675876e+01| 0:0:00| chol 1 1
3|0.945|1.000|2.6e-06|3.0e-03|8.2e+01| 1.133779e+02 3.184938e+01| 0:0:00| chol 1 1
4|0.817|0.203|3.2e-05|2.5e-03|3.5e+01| 7.128134e+01 3.697355e+01| 0:0:00| chol 1 1
5|0.898|0.243|7.9e-06|1.9e-03|2.2e+01| 6.403791e+01 4.243380e+01| 0:0:00| chol 1 1
-------------------------------------------------------------------
0|0.000|0.000|9.2e-01|5.9e+01|3.0e+05| 2.497247e+02 0.000000e+00| 0:0:00| chol 1 1
1|1.000|0.882|9.9e-06|7.0e+00|1.9e+04| 4.908632e+03 5.514004e+01| 0:0:00| chol 1 1
number of iterations = 18
primal objective value = 5.96954941e+01
dual objective value = 5.96954938e+01
gap := trace(XZ) = 4.62e-07
relative gap = 3.84e-09
-------------------------------------------------------------------
0|0.000|0.000|4.5e+00|1.4e+00|1.2e+02| 0.000000e+00 0.000000e+00| 0:0:00| chol 1 1
1|0.916|1.000|3.8e-01|8.4e-03|1.6e+01|-1.107217e+01 -1.558450e+01| 0:0:00| chol 1 1
*******************************************************************
version predcorr gam expon scale_data
NT 1 0.000 1 0
it pstep dstep pinfeas dinfeas gap prim-obj dual-obj cputime
1
We take a matrix and vector (chosen at random, but the results are typical), and compute theℓ1-norm andℓ2-norm approximate solutions of , as well as the penalty function approximations with a deadzone-linear penalty (witha= 0.5) and log barrier penalty (witha= 1). Figure 6.2 shows the four associated penalty functions,and the amplitude distributions of the optimal residuals for these four penalty approximations.
8|0.929|0.526|4.8e-07|2.4e-04|2.4e+00| 5.984393e+01 5.745881e+01| 0:0:00| chol 1 1
9|1.000|0.508|5.9e-08|1.2e-04|1.1e+00| 5.972690e+01 5.859379e+01| 0:0:00| chol 1 1
actual relative gap = 3.25e-09
rel. primal infeas = 4.14e-14
rel. dual infeas = 1.46e-08
norm(X), norm(y), norm(Z) = 1.3e+01, 9.0e+00, 1.3e+01
norm(A), norm(b), norm(C) = 7.8e+01, 1.2e+01, 1.1e+01
12|0.982|0.754|3.4e-09|1.5e-05|1.3e-01| 5.969978e+01 5.957286e+01| 0:0:00| chol 1 1
13|0.885|0.288|8.6e-10|1.1e-05|9.1e-02| 5.969795e+01 5.960793e+01| 0:0:00| chol 1 1
Homework for
Name:
For do this homework,I downloadthe latest versionCvxMatlab toolbox, and get an academic license from CVX Research, Inc. All the programs below arecompleted with this toolbox, and can running under Matlab R2014a.
---------------------------wenku.baidu.com--------------------------------
Status: Solved
Optimal value (cvx_optval): +59.6955
Figure1Histogram of residual amplitudes forℓ1-norm, with the scaled penalty functions
1)Forℓ1-norm, the object function is ,and using thefollowingcodetosolvethe problem
cvx_begin
variablex(n);
minimize( norm(A*x-b,1) );
cvx_end
The running result is asfollowing:
Total CPU time (secs) = 0.29
CPU time per iteration = 0.02
termination code = 0
DIMACS: 1.4e-13 0.0e+00 8.0e-08 0.0e+00 3.2e-09 3.8e-09
-------------------------------------------------------------------
Calling SDPT3 4.0: 101 variables, 31 equality constraints
For improved efficiency, SDPT3 is solving the dual problem.
------------------------------------------------------------
18|0.833|0.945|4.1e-14|1.5e-08|4.6e-07| 5.969549e+01 5.969549e+01| 0:0:00|
stop: max(relative gap, infeasibilities) < 1.49e-08
-------------------------------------------------------------------
10|1.000|0.172|2.4e-08|1.1e-04|9.7e-01| 5.973848e+01 5.877962e+01| 0:0:00| chol 1 1
11|1.000|0.468|9.5e-09|6.1e-05|5.3e-01| 5.972730e+01 5.920081e+01| 0:0:00| chol 1 1
相关文档
最新文档