フィルターのクリア

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 Center および File ExchangeLinear Algebra についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by