Comments (1)
It is because the tolerances default to different values.
This works:
using Integrals
using QuadGK
using Plots
function integrand(E::Real, eta::Real)
return exp(-E^2/2) / (sqrt(2π) * (exp(E-eta) + 1))
end
function using_quadgk(eta::Real, lim::Real)
iq(x) = integrand(x, eta)
res, err = quadgk(iq, -lim, lim)
return res
end
function using_integrals(eta::Real, lim::Real)
ip = IntegralProblem(integrand, -lim, lim, eta)
return solve(ip, QuadGKJL();abstol=0.0)[1]
end
er = LinRange(-30, 2, 200)
lim = 100
plot(er, using_quadgk.(er, lim), yscale=:log10, label="QuadGK");
plot!(er, using_integrals.(er, lim), yscale=:log10, label="Integrals")
It is not unsurprising that the integral evaluates wrongly when it is a very small number unless you put the abstol
to also be incredibly small.
from integrals.jl.
Related Issues (20)
- keyword arguments passed to specific solvers HOT 6
- Integrals with lb > ub HOT 1
- More types of infinity transformations HOT 2
- Add tests FastGaussQuadrature + AD
- Method definition overwrite of `solve(SciMLBase.IntegralProblem`.
- Integration over general domains
- Nested ForwardDiff.jacobian doesn't work for `AbstractCubatureJLAAlgorithm` subtypes
- Solving coupled system of linear Volterra integral equations of the second kind HOT 2
- Multiple/nested integration error tolerances HOT 2
- Broken inplace integrand for HCubatureJL HOT 8
- Quadrature routines for pre-sampled data HOT 3
- It would be nice to have a `progress` keyword for time estimation HOT 7
- Improve docstrings
- Inconsistent IntegralsCubature Interface
- Example from the first tutorial is broken HOT 5
- Interface error for VEGAS from [email protected]
- Warp MCIntegration.jl
- Issue when Nesting Integrals without Explicit Floats
- Factor out MonteCarloIntegration.jl into extension package HOT 2
- BoundsError: attempt to access Float64 at index [2] when `pi` is passed as limit HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from integrals.jl.