Skip to content

Conversation

@Josiah-Murray
Copy link

Hi!

Just a small change: looks like the Gaver functionals are being added to the array in the wrong place, meaning f_1 is being assigned in place of f_0 etc, and f_M is ending up as zero, rather than having f_0=0. (Compare equation 4 from Abate and Valkó, Multi-precision Laplace transform inversion, 2004)

Did some testing against the 35 test functions from Cohen (Numerical methods for Laplace transform inversion, 2007) just to confirm and it generally does better after the change.
Sometimes does slightly worse, but generally this is for problems where the GWR method isn't working very well anyway (i.e. square wave, unshifted sinh, etc.) or else its only worse for a particular values of M on a given problem (since M+2 doesn't necessarily give a better approximation than M, I'm guessing).

Here are some results for $t=9.9$

Error comparisons

ErrorComparisonM15
(Plotting $$\frac{|error_{old}| - |error_{new}|}{|error_{old}| + |error_{new}|}$$ so that a value of 1 means the new code is doing better, conversely for -1. A value of zero means they're both doing about the same, and no value means both errors are zero.)

Fixed entry of Gaver functionals into wrong position in array G0
@Josiah-Murray
Copy link
Author

Admittedly new to pull requests and testing; it looks like the test hardcodes a particular output for the GWR algorithm to ensure there aren't unexpected effects from changing other parts of the code? Hence changing the GWR algorithm causes the tests to fail?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant