Use P676 Eqn 11/12 and integrate.quad to simplify code and resolve w… #50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…hat to do when h1 > 0
Basically use the code in -12 Eqn 11/12 rather than the approximation.
As the footnote says:
"Equation (11) can be evaluated using various methods depending on the implementation: e.g. a) the integral
function in Matlab, b) the quad function in Octave, c) the quad function in Python, d) several Numerical
Recipes functions, and other equivalent methods"
This has multiple advantages
If you use this new method and compare to the (fixed as above) old method for a test input at h1 = 0 then I think the delta is circa 1e-6 which is acceptable I think.
Question is what to do for -11/-10. I think you could backport this fix or at least use the midpoint and come up with a way to handle the h1>0 case.