josdejong / josdejong/mathjs

3x3 matrix where eigenvalues fail to converge

Open
#3,036 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
15.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Exercise 7.7.103 of https://web.uvic.ca/~tbazett/diffyqs/sec_multeigen.html produces "The eigenvalues failed to converge" error. I feel mathjs should be able to handle elementary textbook examples, especially for such a small matrix. Admittedly, this is a case where all three eigenvalues are equal, and the current method relies on differences of eigenvalues to converge, so it was sort of doomed, but really mathjs should have alternate methods to use in such a case.

**To Reproduce**
math.eigs([[2, 0, 0], [-1, -1, 9], [0, -1, 5]])

Note further that although this is a case of a defective matrix (the algebraic multiplicity of eigenvalue 2 is three, but its geometric multiplicity is only one), this error is independent of #2879: it occurs before eigenvalues have even been determined, and so the code to search for eigenvectors is never even invoked. If we can get mathjs to realize that 2 is an eigenvalue of algebraic multiplicity three, then the findEigenvectors code might (or might not) properly discover the unique eigenvector proportional to [0, 3, 1].

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.