-
Notifications
You must be signed in to change notification settings - Fork 7
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
talbotarr yields NaN with single element array argument [0.0] #5
Comments
Investigating a bit further I now notice how sensitive the initial value is to the length of array:
|
talbotarr
yields NaN with single element array argument [0.0]
talbotarr
yields NaN with single element array argument [0.0]
Thanks for the report. The inverse Laplace methods, and the Talbot method in particular, are prone to numerical instabilities. The Talbot method uses Jbar(s) = (1/s^2)*(1 + s^(1//2))/(1 + 1/s+ s^(-1//2)) Rather than Jbar(s) = (1/s^2)*(1 + s^(0.5))/(1 + 1/s+ s^(-0.5)) The latter forces the internal calculations to have at best When evaluating the inverse transforms, you should use The But, even so, your function appears to return julia> Jbar(s) = (1/s^2)*(1 + s^(1//2))/(1 + 1/s+ s^(-1//2));
julia> tJbar = Talbot(Jbar);
julia> tJbar(0)
NaN
julia> Float64(tJbar(1//10000))
0.011283044418011255 |
Many thanks for the thorough and clear reply John. I'll make sure all input is |
Apologies if this is expected behavior (if so I will try and put in a PR to the docs), but it was unexpected to me:
However,
So the 0.0 argument works when the array size > 1, but fails when 0.0 is the only element.
And single-element arrays work fine when the single array element > 0.0.
I've reproduced this behavior on the most up to date versions compatible with Julia 0.6 and Julia 1.0.1. Using Windows 7, 64 bit.
The text was updated successfully, but these errors were encountered: