Open rzu512 opened 6 years ago
This is still present in develop.
Observations:
Newton-Raphson
method code block where this happens appears to be identical in the C & Cython versions of the codeHere's some debug values from the Cython Newton's Method loop using the above input:
('x2:', 2.250000172635994)
('mxEigenV:', 1.5000000575453303)
('b:', -3.375000388430994)
('a:', -3.375000388430994)
('first term:', 6.750000776861988)
('remaining terms:', -6.750000776861988)
('numerator:', -8.881784197001252e-16)
Some more observations based on the above debug output:
if
statement that checks for numerator below a certain threshold value (i.e., 1e-8) and continues the loop if achieved rather than allowing 0 / denominator to happen resolves the Error in this particular case, but not sure if that would hold for all cases or be appropriate (break is probably more sensible if that does end up working)Something about the dot or cross product of the two intersecting lines or the fact that they are both EXACTLY at the origin to a very high level of precision may be causing some kind of issue. Here's the plot of the lines:
Is this a duplicate of the mysterious issue #945 ?
Does that mean the division by 0 is caused by having a 0 derivative in the Newton-Raphson method? https://www.quora.com/When-does-Newton-Raphson-fail
Expected behaviour
no error
Actual behaviour
Code to reproduce the behaviour
Current version of MDAnalysis:
I tried python 2, and the test code gives the same error.