필터 지우기
필터 지우기

How to avoid using det, when looking for the complex root w with det(M(w)) = 0

조회 수: 3 (최근 30일)
ma Jack
ma Jack 2022년 7월 6일
댓글: Torsten 2024년 4월 9일
Hi all,
I want to find a complex number w such that det(M(w)) converges to 0 (note that M is a matrix and it is a function of w), but the det function seems to have a large error, how can I avoid using it?M is an 8*8 matrix, so it would be very complicated to write out its determinant expression.
Thanks in advance.
  댓글 수: 6
Walter Roberson
Walter Roberson 2022년 7월 6일
As discussed in your previous question, you have the difficulty that you are working with a matrix whose determinant is on the order of 10^250
On the first ModeXY matrix that is generated, there are only four unique values. If you construct a representative symbolic matrix in terms of the pattern of unique values, and take det() of it, and substitute in the unique values, then that is a lot faster than calculating det() of the original matrix symbolically. The idea of calculating it symbolically being to reduce the error in the calculation of det()
ModeXY = [M1,M2,M2,M2;...
M2,M1,M2,M2;...
M2,M2,M1,M2;...
M2,M2,M2,M1];%size:(2*4,2*4)
That promises that the pattern continues of there being only 4 unique elements in the matrix, so you can
pre-calculate the determinant as
(V1 + V2 - V3 - V4)^3*(V1 - V2 - V3 + V4)^3*(V1 + V2 + 3*V3 + 3*V4)*(V1 - V2 + 3*V3 - 3*V4)
which would be 0 if and only if any one of the sub-expressions is 0, which happens if
V1 + V2 = V3 + V4
V1 + V4 = V2 + V3
V1 + 3*V3 = V2 + 3*V4
V1 + V2 + 3*V3 + 3*V4 == 0
You might be able to take advantage of those to seek for a zero with a lower range.
ma Jack
ma Jack 2022년 7월 7일
Sir thank you for your suggestion, but I think Mr. Matt J's answer is better.

댓글을 달려면 로그인하십시오.

답변 (1개)

Matt J
Matt J 2022년 7월 6일
편집: Matt J 2022년 7월 7일
Because your matrix appears to be symmetric, I suggest minimizing instead norm(M(w)) which is the maximum absolute eigenvalue of M. This is the same as forcing M to be singular.
EDIT: rcond(M) is probably more appropriate than norm(M)
Additionally, I suggest using fminsearch instead of lsqnonlin, since you only have a small number of variables and a non-differentiable cost function. Be mindful, however, that you must express your objective function in terms of a vector z of real variables.
w=@(z) complex(z(1),z(2));
zopt=fminsearch(@(z) norm(M(w(z))) ,z0)
wopt=w(zopt)
  댓글 수: 21
Rosalinda
Rosalinda 2024년 4월 9일
hello ma jack..i encounter the same problem for 8by 8 matrix..if you could please tell me how you resolve your issue
Torsten
Torsten 2024년 4월 9일
Since @ma Jack 's problem description was very poor until the end, maybe you could again describe what you consider as "the same problem".

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by