quadrature {rjacobi} | R Documentation |
Builds a data structure with every quadrature related stuff such as integrals, derivatives and interpolations
quad <- quadrature(Q, type=c('GJ', 'GLJ', 'GRJM', 'GRJP', a=0, b=0, xinterp=NULL))
Q |
Number of quadrature points |
type |
A string specifying the quadrature type |
a |
α weight |
b |
β weight |
xinterp |
Points where the interpolation matrix should be calculated |
This function is a wrapper around the various functions
zerosXXX
weightsXXX
diffmatXXX
interpmatXXX
lagrangeXXX
It returns a list of class quadrature
with all the above
fields.
The interpolation points can be modified with the
xinterp
function.
x |
Quadrature zeros |
a |
α weight |
b |
β weight |
w |
Quadrature weights |
D |
Derivative matrix |
type |
Quadrature type |
lagrange |
Lagrange interpolants |
xinterp |
Interpolation points |
imat |
Interpolation matrix at xinterp |
Abramowitz, Milton and Stegun, Irene (editors); "Handbook of Mathematical functions", Dover Publications 1965.
Karniadakis, George Em and Sherwin, Spencer; "Spectral/hp Element Methods for Computational Fluid Dynamics", Oxford Science Publications, 2nd edition, 2005.
lagrangeGJ
zerosGJ
weightsGJ
diffmatGJ
xinterp
interpmatGJ
## Calculates the numerical derivative of jacobi(x,4) q = quadrature(5) f <- jacobi(q$x, 4) df <- q$D %*% f x <- seq(-1, 1, len=51) ff <- djacobi(x, 4) plot(x, ff, ty='l', xlab="x", ylab="dP_4^(0,0)/dx", main="Analytical and Numerical derivative") points(q$x,df)