quadpack icon indicating copy to clipboard operation
quadpack copied to clipboard

Adaptive quadrature method from MATLAB

Open ivan-pi opened this issue 3 years ago • 3 comments

It would be nice to add the MATLAB algorithm, which is described in

Shampine, L. F. (2008). Vectorized adaptive quadrature in MATLAB. Journal of Computational and Applied Mathematics, 211(2), 131-140. https://doi.org/10.1016/j.cam.2006.11.021

I believe the algorithm is similar to those in QUADPACK, but with a few small differences in how the error estimate is constructed.

For simplicity it offers a unified interface for both proper and improper integrals.

See also

  • integral Numerical integration
  • quadgk Numerically evaluate integral — Gauss-Kronrod quadrature

ivan-pi avatar Jan 20 '22 12:01 ivan-pi

Also available in Octave as quadgk.

ivan-pi avatar Jan 20 '22 15:01 ivan-pi

My program shows that it seems with the same absErr and relErr, the Matlab version gives around twice less function evaluations than one from Quadpack. I think that comes from the difference in error estimation (somehow mentioned in Shampine paper).

holetuananh avatar Mar 30 '23 09:03 holetuananh

  • Octave code here: https://github.com/gnu-octave/octave/blob/default/scripts/general/quadgk.m
  • Julia code here: https://github.com/JuliaMath/QuadGK.jl/blob/master/src/adapt.jl

jacobwilliams avatar Apr 01 '23 02:04 jacobwilliams