Two equivalent codes getting different answer

2 次查看(过去 30 天)
Code 1:
AD=[1 8 4;5 6 3;2 7 6];
dd=[1 6 7;3 6 8;2 6 5];
cvx_begin
variables QM(3,3)
maximize log_det(eye(3)+dd*QM)
subject to
norm(QM*AD,'fro')<=10;
cvx_end
Code 2:
AD=[1 8 4;5 6 3;2 7 6];
dd=[1 6 7;3 6 8;2 6 5];
[RU,RS,RV]=svd(inv(AD)*dd);
cvx_begin
variables QM(3,3)
maximize log_det(eye(3)+RS*QM)
subject to
norm(QM,'fro')<=10;
cvx_end
Code 2 is obtained from Code 1 by change of variables so I believe that these two codes are equivalent. However, I am getting different answers i.e. the maximum value of objective function. Is there something wrong with the change of variables?
Following are the change in variables
det(I+dd QM)=det(ADAD^(-1)+dd QM AD AD^(-1) )
=det(AD(I+AD^(-1) dd QM AD)AD^(-1))
det(I+dd QM)=det(I+AD^(-1) dd QM AD)=det(I+UΣV^T QM AD)=det(I+ΣV^T QM AD U)=det(I+ΣR)
norm(QM AD)=norm(VV^T QM AD U U^T )=norm(V R U^T )=trace(V R U^T U R^T V^T )=trace(R R^T)
  1 个评论
Alan Weiss
Alan Weiss 2017-7-16
Please mark your coed using the {} Code button so that we can read it.
Alan Weiss
MATLAB mathematical toolbox documentation

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by