How to extract specific matrix after implemeting svd function
2 views (last 30 days)
Show older comments
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:
- Is it correct method using 'svd' to extract F(size M by T) from optimal solution X?
- If not, what method can I try to? If possible, comment breif code for it.
- It is not programming issue, but about mathematical, Is sum of all elements in auxiliary variable(objective for (12)) same as objective for (11)?
2 Comments
Angelo Yeo
on 13 Aug 2024
It looks like the question is CVX toolbox specific. I'd like to point out CVX Community to you. Thanks.
Accepted Answer
Ayush
on 13 Aug 2024
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:
- 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 ‘svd’ instead of “svds” as “svd” is 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.
More Answers (0)
See Also
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!