How to avoid using det, when looking for the complex root w with det(M(w)) = 0
2 views (last 30 days)
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.
Matt J on 6 Jul 2022
Edited: Matt J on 7 Jul 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.
zopt=fminsearch(@(z) norm(M(w(z))) ,z0)