diffmatGJ {rjacobi}R Documentation

Derivative Matrix of Gauss-Jacobi Quadrature

Description

Calculates the derivative matrix of the Q point Gauss-Jacobi quadrature.

Usage

D = diffmatGJ(z, a=0.0, b=0.0)
D = diffmatGLJ(z, a=0.0, b=0.0)
D = diffmatGRJM(z, a=0.0, b=0.0)
D = diffmatGRJP(z, a=0.0, b=0.0)

Arguments

z Quadrature node calculated with zerosGJ (depending on quadrature type)
a α parameter of Jacobi polynomial. Defaults to 0
b β parameter of Jacobi polynomial. Defaults to 0

Details

The derivative matrix is used to calculate derivatives at nodal points of functions known at the same nodal points. It is defined according to the following expression:

(frac{du(x)}{dx})_{x=x_i} = sum_{j=0}^{Q-1} D_{ij} u(x_j)

In this equation,

D_{ij} = (frac{dh_j(x)}{dx})_{x=x_i}

where h_j(x) is the Lagrange polynomial through the jth quadrature node

Different types of quadrature are possible:

With the derivative matrix, the derivative at quadrature points can be calculated:

df = D %*% f(x) where x is a vector containning the quadrature nodes.

Value

The derivative matrix

References

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.

See Also

zerosGJ weightsGJ quadrature

Examples


## Calculates the numerical derivative of jacobi(x,4)
z = zerosGJ(5)
D = diffmatGJ(z)
f <- jacobi(z, 4)
df <- 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(z,df)


[Package rjacobi version 0.9.2 Index]