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

1 vue (au cours des 30 derniers jours)
ma Jack
ma Jack le 6 Juil 2022
Commenté : Torsten le 9 Avr 2024
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 commentaires
Walter Roberson
Walter Roberson le 6 Juil 2022
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 le 7 Juil 2022
Sir thank you for your suggestion, but I think Mr. Matt J's answer is better.

Connectez-vous pour commenter.

Réponses (1)

Matt J
Matt J le 6 Juil 2022
Modifié(e) : Matt J le 7 Juil 2022
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 commentaires
Rosalinda
Rosalinda le 9 Avr 2024
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 le 9 Avr 2024
Since @ma Jack 's problem description was very poor until the end, maybe you could again describe what you consider as "the same problem".

Connectez-vous pour commenter.

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by