How to extract specific matrix after implemeting svd function

62 次查看(过去 30 天)
I want to solve PEB minimization problem in sort of RIS problem. So I have formulated SDP problem via 'CVX' and at the end of the CVX formulation, using built-in svd(or svds) function to extract RIS phase profile matrix F(with size M times T, M=# of RIS elements and T is # of transmissions). Optimal solution of CVX is X which has size M by M. And X is FF^H. From X F is extracted by using svds as size of M by T.
The code is below,
M = signal.M;
T = signal.T;
% k-th column of identity matrix
e1 = [1; 0; 0];
e2 = [0; 1; 0];
e3 = [0; 0; 1];
% define optimization problem
cvx_begin sdp
variable X(M, M) hermitian
variable u(3, 1)
minimize(sum(u))
subject to
[J_car(1:3, 1:3), e1; e1', u(1)] >= 0;
[J_car(1:3, 1:3), e2; e2', u(2)] >= 0;
[J_car(1:3, 1:3), e3; e3', u(3)] >= 0;
trace(X) == M * T;
X >= 0;
cvx_end
optimX = X;
[U, S, V] = svds(optimX, T);
num_singular_values = min(size(S, 1), T);
optimF = U(:, 1:num_singular_values) * sqrt(S(1:num_singular_values, 1:num_singular_values));
end
and the optimization problem is:
Then my questions are:
  1. Is it correct method using 'svd' to extract F(size M by T) from optimal solution X?
  2. If not, what method can I try to? If possible, comment breif code for it.
  3. It is not programming issue, but about mathematical, Is sum of all elements in auxiliary variable(objective for (12)) same as objective for (11)?

采纳的回答

Ayush
Ayush 2024-8-13,8:21
Hi Yun Sub Tae,
I understand you are formulating an "SDP" problem using "CVX" package and your goal is to solve for a matrix "X" such that "X" can be factored into "F*F^H" where "F" represents the "RIS" phase profile matrix.
Let’s address your questions one by one:
  1. Is Using “SVD to Extract “F from “X Correct?
Your approach to use Singular Value Decomposition (SVD) to extract "F" from "X" is generally correct, but there are some details to consider:
SVD Method
Here’s a brief overview of why SVD works and some points of consideration:
SVD for Factorization:
  • The SVD of a matrix "X" (where X=F*F^H) gives you matrices "U", "S", and "V" such that X=U*S*V^H. For X=F*F^H, U and "V" are unitary matrices, and "S" is a diagonal matrix with singular values.
  • Since "X" is Hermitian (and positive semidefinite), "U" and "V" will be the same (up to a permutation of columns), and "X" can be factored as U*S*U^H.
  • Extracting F:
  • The matrix "F" can be obtained as F= U \sqrt{S}, where \sqrt{S}S represents the matrix of square roots of the singular values. This method works because F*FH=U*S*U^H, which matches "X".
  • Here’s the refined version of your code to ensure "F" is correctly extracted:
[U, S, V] = svd(optimX);
num_singular_values = min(size(S, 1), T);
optimF = U(:, 1:num_singular_values) * sqrt(S(1:num_singular_values, 1:num_singular_values));
  • Note: use ‘svdinstead of “svds” as “svdis for full decomposition while “svds is for partial decomposition which might be less accurate depending on matrix size.
2. Alternative Method to Extract F
  • Another approach to factorize "X" if you want to avoid SVD is to use Cholesky decomposition, which works if "X" is positive semidefinite:
% Cholesky decomposition
L = chol(optimX, 'lower');
optimF = L'; % If L = F, then F = L'
  • Cholesky decomposition directly gives you a lower triangular matrix "L" such that X=L*L^H. Taking the transpose of “L” gives you "F" if L=F.
3. Objective Function Comparison
  • Objective Function in (11):
  • This is the objective of your SDP problem, which is to minimize the sum of the auxiliary variable "u".
  • Objective Function in (12):
  • If this involves the trace or sum of elements of "X" and is related to the trace constraint trace(X) == M * T, then indeed, the sum of the elements of "u" (the auxiliary variable in the objective) should correspond to the constraint enforced on "X".
You can read more about these functions here:
Hope it is clear.
  1 个评论
Yun Sub Tae
Yun Sub Tae 2024-8-14,5:30
First of all, sincerely big thank you for your kind and detailed explanation. I'm really touched about it.
Feel sorry to say again, I'm still confused with questions 2 & 3.
For questions 2,
The reason I used 'svds' instead of svd, when I implemented code with 'svd', It makes error that 'svd' cannot be applied to sparse matrix 'optimX'. So I used 'svds'. (It did not make any error still)
For questions 3,
In summary, optimized value of objective function of (11) and (12) could not be same?
(object to optimize is still the same between (11) and (12) nevertheless its shape or formation is different)
Thank you.

请先登录,再进行评论。

更多回答(0 个)

类别

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

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by