Timeline for LinearSolve on a singular matrix
Current License: CC BY-SA 4.0
16 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 1, 2018 at 21:55 | vote | accept | Chris K | ||
Aug 1, 2018 at 13:18 | comment | added | Hector | My bad. It is not a bug. I do not remember what I was thinking when I added the tag and when I wrote my answer. It was just a bunch of non-sense. | |
Aug 1, 2018 at 12:14 | history | edited | Hector |
edited tags
|
|
Aug 1, 2018 at 7:42 | comment | added | Henrik Schumacher | @Hector I also don't think that it's a bug. It is caused just by the way LU-decomposition and backward/forward substitution work. At some point one devidides by (almost) zero which results in the humongous length of the "solution". Since you get warned by Mathematica that strange things are bound to happen, it appears entirely sane to me. | |
Jul 31, 2018 at 23:01 | comment | added | Daniel Lichtblau |
If you work with larger matrices, it might be faster to shift in such a way that it corresponds to the largest eigenvalue. Could be done as below. In[6]:= Eigenvectors[m + Total[Flatten[Abs[m]]]*IdentityMatrix[3], 1] Out[6]= {{0.998599821251, 0.0499299910625, 0.0174754968719}}
|
|
Jul 31, 2018 at 21:01 | history | tweeted | twitter.com/StackMma/status/1024399742330195968 | ||
Jul 31, 2018 at 20:48 | comment | added | Michael E2 |
I don't think it's a bug. Note that x does depend on b , while x/Norm[x] (almost) does not.
|
|
Jul 31, 2018 at 20:46 | answer | added | Michael E2 | timeline score: 4 | |
Jul 31, 2018 at 20:11 | answer | added | Henrik Schumacher | timeline score: 4 | |
Jul 31, 2018 at 20:07 | comment | added | Chris K | @Hector If they do fix this bug, I hope they keep the broken version for me as an option :) | |
Jul 31, 2018 at 20:06 | comment | added | Chris K | @Coolwater That works too, although slower for my real, larger problem. | |
Jul 31, 2018 at 19:59 | history | edited | Chris K | CC BY-SA 4.0 |
added a bit more info on my matrices
|
Jul 31, 2018 at 19:25 | comment | added | Hector |
I have added the tag 'bugs'. After all, solving m.x+b=0 should depend on b ; but for badly conditioned matrices, Mathematica returns an answer that does not depend on b .
|
|
Jul 31, 2018 at 19:23 | history | edited | Hector |
edited tags
|
|
Jul 31, 2018 at 18:59 | comment | added | Coolwater |
You could also try x = With[{i = 1}, Normalize[Insert[LeastSquares[Drop[m, 0, {i, i}], m[[All, i]]], -1, i]]] . However there is a chance it will be wrong for some particular i s so confirmation is needed m.x
|
|
Jul 31, 2018 at 16:39 | history | asked | Chris K | CC BY-SA 4.0 |