Learn R Programming

spc (version 0.7.1)

quadrature.nodes.weights: Calculate quadrature nodes and weights

Description

Computation of the nodes and weights to enable numerical quadrature.

Usage

quadrature.nodes.weights(n, type="GL", x1=-1, x2=1)

Value

Returns two vectors which hold the needed quadrature nodes and weights.

Arguments

n

number of nodes (and weights).

type

quadrature type -- currently Gauss-Legendre, "GL", and Radau, "Ra", are supported.

x1

lower limit of the integration interval.

x2

upper limit of the integration interval.

Author

Sven Knoth

Details

A more detailed description will follow soon. The algorithm for the Gauss-Legendre quadrature was delivered by Knut Petras to me, while the one for the Radau quadrature was taken from John Burkardt.

References

H. Brass and K. Petras (2011), Quadrature Theory. The Theory of Numerical Integration on a Compact Interval, Mathematical Surveys and Monographs, American Mathematical Society.

John Burkardt (2015), https://people.math.sc.edu/Burkardt/c_src/quadrule/quadrule.c

See Also

Many of the ARL routines use the Gauss-Legendre nodes.

Examples

Run this code
# GL
n <- 10
qnw <-quadrature.nodes.weights(n, type="GL")
qnw

# Radau
n <- 10
qnw <-quadrature.nodes.weights(n, type="Ra")
qnw

Run the code above in your browser using DataLab