quadrature.nodes.weights: Calculate quadrature nodes and weights

View source: R/quadrature.nodes.weights.R

quadrature.nodes.weightsR Documentation

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)

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.

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.

Value

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

Author(s)

Sven Knoth

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.sc.fsu.edu/~jburkardt/f_src/quadrule/quadrule.html

See Also

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

Examples

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

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

spc documentation built on Oct. 24, 2022, 5:07 p.m.