-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Odd EigenVector calculation #13
Comments
Hi, thanks for the report, this is very useful. It seems to be a numerical problem. One of the eigenvalues became 4.4e-16 instead of 0. However, that value then caused the SVD in the solve function used to find the eigenvectors to return a much more incorrect value, resulting in that -50, and that is of course a bug. So I tried a quick fix now, in which before solving the eigenvectors, it sets eigenvalues that are near 0, to 0. This is a very hacky and unstable fix, it would require much more numerical care and investigation to fix for sure, but I hope it helps at least in cases like this. |
Hi, I'm also getting a weird output for this: Jmat.eig([[1,-0.3,-0.5],[-0.3,1,-0.6],[-0.5,-0.6,1]]).l.toString() If I change some value a tiny bit it becomes correct: Jmat.eig([[1.000001,-0.3,-0.5],[-0.3,1,-0.6],[-0.5,-0.6,1]]).l.toString() |
Thanks minkkilaukku! I found and fixed the issue |
Hi,
Jmat.eig([[-1,0,1],[3,0,-3],[1,0,-1]]).v.toString() gives us the following:
answer: [[-1.0000000000000002, 1.0000000000000113, 0], [2.9999999999999987, -50.64166161063003, 1], [1, 1, 0]]
(as tested here: http://lodev.org/jmat/jmat_demo.html and in the browser)
Everything is close enough except that -50.64166161063003 should be 0. (See: http://www.wolframalpha.com/input/?i=%7B%7B-1,0,1%7D,%7B3,0,-3%7D,%7B1,0,-1%7D%7D)
I just kind of wandered into this so I thought that I might report it. I recognize that this is probably not very helpful as to what the problem is, but tis what I have.
The text was updated successfully, but these errors were encountered: