Skip to content
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

hquadrature and pquadrature do not match for a simple 1d example #53

Closed
rsantet opened this issue Jul 26, 2022 · 2 comments
Closed

hquadrature and pquadrature do not match for a simple 1d example #53

rsantet opened this issue Jul 26, 2022 · 2 comments

Comments

@rsantet
Copy link

rsantet commented Jul 26, 2022

MWE:

using Cubature

function V(x)
       return cos(4*π*x)
end
function μ(x)
       return exp(-V(x))
end

pquadrature(μ,0,1)
#(0.3678794411714423, 5.551115123125783e-17)

hquadrature(μ,0,1)
#(1.2660658777520202, 1.6177162823726988e-9)

I tried to change the absolute/relative error in the function calls, but it did not matter. I was expecting the two outputs to be approximately the same.
Cubature version: 1.5.1
Julia version: 1.6.3

@mzaffalon
Copy link

It is probably the same as #24. Can you try to integrate on the interval [0,0.99]?

@stevengj
Copy link
Member

Yes, it's a duplicate of #24.

julia> pquadrature(μ,0,0.99)
(1.262377385849127, 4.4584338443343086e-9)

julia> hquadrature(μ,0,0.99)
(1.2623773858491294, 4.341954891329778e-9)

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

No branches or pull requests

3 participants