Borrar filtros
Borrar filtros

Two equivalent codes getting different answer

2 visualizaciones (últimos 30 días)
khushi
khushi el 14 de Jul. de 2017
Editada: Walter Roberson el 16 de Jul. de 2017
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 comentario
Alan Weiss
Alan Weiss el 16 de Jul. de 2017
Please mark your coed using the {} Code button so that we can read it.
Alan Weiss
MATLAB mathematical toolbox documentation

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by