clenshaw_curtis: Clenshaw-Curtis Quadrature Formula

Description Usage Arguments Details Value References See Also Examples

View source: R/clenshaw_curtis.R

Description

Clenshaw-Curtis Quadrature Formula

Usage

1
clenshaw_curtis(f, a = -1, b = 1, n = 1024, ...)

Arguments

f

function, the integrand, without singularities.

a, b

lower and upper limit of the integral; must be finite.

n

Number of Chebyshev nodes to account for.

...

Additional parameters to be passed to the function

Details

Clenshaw-Curtis quadrature is based on sampling the integrand on Chebyshev points, an operation that can be implemented using the Fast Fourier Transform.

Value

Numerical scalar, the value of the integral.

References

Trefethen, L. N. (2008). Is Gauss Quadrature Better Than Clenshaw-Curtis? SIAM Review, Vol. 50, No. 1, pp 67–87.

See Also

gaussLegendre, gauss_kronrod

Examples

1
2
3
4
##  Quadrature with Chebyshev nodes and weights
f <- function(x) sin(x+cos(10*exp(x))/3)
## Not run: ezplot(f, -1, 1, fill = TRUE)
cc <- clenshaw_curtis(f, n = 64)  #=>  0.0325036517151 , true error > 1.3e-10

pracma documentation built on May 19, 2017, 8:50 a.m.

Search within the pracma package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.