quad module#
Created on Thu Aug 31 13:56:13 2023
@author: Pavan Pranjivan Mehta
- class quad.quad_pts_weights#
Bases:
object
Computes Quadrature Points and weights
- legendre()#
Qudrature points and weights of Legendre Polynomials in [-1,1]
Parameters#
- degreeint
degree of the polynomial
Returns#
Qudrature points and weights of Legendre polynomials within the interval [-1,1]
- q: float
quadrature points
- w: float
weights
- jacobi(beta, degree)#
Qudrature points and weights of Jacobi Polynomials, P_n^{alpha, beta} in [-1,1]; alpha, beta > -1.
Parameters#
- alphafloat
Paramter for Jacobi polynomial, alpha > -1
- betafloat
Paramter for Jacobi polynomial, beta > -1
- degreeint
degree of the polynomial
Returns#
Qudrature points and weights of Jacobi polynomials within the interval [-1,1]
- q: float
quadrature points
- w: float
weights
- shift_legendre()#
Shifted Qudrature points and weights of Legendre Polynomials in [0,1]
Parameters#
- degreeint
degree of the polynomial
Returns#
Qudrature points and weights of Legendre polynomials within the interval [0,1]
- q: float
quadrature points
- w: float
weights
- shift_jacobi(beta, degree)#
Shifted Qudrature points and weights of Jacobi Polynomials in [0,1]
Parameters#
- alphafloat
Paramter for Jacobi polynomial, lpha > -1
- betafloat
Paramter for Jacobi polynomial, eta > -1
- degreeint
degree of the polynomial
Returns#
Qudrature points and weights of Jacobi polynomials within the interval [0,1]
- q: float
quadrature points
- w: float
weights
- Q_poly(beta, degree)#
Qudrature points and weights of Q Polynomials in [0,1]
Q := P_n (1 - 2x)
Parameters#
- alphafloat
Paramter for Jacobi polynomial, lpha > -1
- betafloat
Paramter for Jacobi polynomial, eta > -1
- degreeint
degree of the polynomial
Returns#
Qudrature points and weights of Q polynomials within the interval [0,1]
- q: float
quadrature points
- w: float
weights
- shift_arbitary_legendre(b, degree)#
Shifted Qudrature points in arbitary domain and weights of Legendre Polynomials in [a,b]
Parameters#
- afloat
min of interval [a, b]
- bfloat
max of interval [a, b]
- degreeint
degree of the polynomial
Returns#
Qudrature points and weights in arbitary domain of Legendre polynomials within the interval [a,b]
- q: float
quadrature points
- w: float
weights
- shift_arbitary_jacobi(b, alpha, beta, degree)#
Shifted Qudrature points in arbitary domain and weights of Jacobi Polynomials in [a,b]
Parameters#
- afloat
min of interval [a, b]
- bfloat
max of interval [a, b]
- alphafloat
Parameter for Jacobi polynomial, lpha > -1
- betafloat
Parameter for Jacobi polynomial, eta > -1
- degreeint
degree of the polynomial
Returns#
Qudrature points and weights in arbitary domain of Jacobi polynomials within the interval [a,b]
- q: float
quadrature points
- w: float
weights
- homogenous_legendre()#
Qudrature points and weights of Homogenous basis using Legendre Polynomials in [-1,1]
phi_i = l_{k+2} - l_{k}, where l is legendre polynomial in [-1,1] of degree k
Parameters#
- degreeint
degree of the polynomial
Returns#
Qudrature points and weights of Homogenous basis using Legendre polynomials within the interval [-1,1]
- q2: float
quadrature points associted with degree+2 Legendre Polynomial
- w2: float
weights associted with degree+2 Legendre Polynomial
- q0: float
quadrature points associted with degree Legendre Polynomial
- w0: float
weights associted with degree Legendre Polynomial
- homogenous_shift_legendre()#
Qudrature points and weights of Homogenous basis using Shited Legendre Polynomials in [0,1]
phi_i = l_{k+2} - l_{k}, where l is shifted legendre polynomial in [0,1] of degree k
Parameters#
- degreeint
degree of the polynomial
Returns#
Qudrature points and weights of Homogenous basis using Legendre polynomials within the interval [0,1]
- q2: float
quadrature points associted with degree+2 shifted Legendre Polynomial
- q0: float
quadrature points associted with degree shifted Legendre Polynomial
- w2: float
weights associted with degree+2 shifted Legendre Polynomial
- w0: float
weights associted with degree shifted Legendre Polynomial
- class quad.gauss_quad#
Bases:
object
Computes Gauss qundrature
- legendre(degree)#
Gauss Legendre Quadrature in [-1,1]
Parameters#
- f: float array
f(x) at quadrature points
- degreeint
degree of the polynomial
Returns#
Value of Gauss Legendre Quadrature within the interval [-1,1]
- shift_legendre(degree)#
Gauss Legendre Quadrature (shifted) in [0,1]
Parameters#
- f: float array
f(x) at quadrature points
- degreeint
degree of the polynomial
Returns#
Value of Shifted Gauss Legendre Quadrature within the interval [0,1]
- shift_jacobi(alpha, beta, degree)#
Gauss Jacobi Quadrature (shifted) in [0,1]
Parameters#
- f: float array
f(x) at quadrature points
- alphafloat
Parameter for Jacobi polynomial, lpha > -1
- betafloat
Parameter for Jacobi polynomial, eta > -1
- degreeint
degree of the polynomial
Returns#
Value of Shifted Gauss Jacobi Quadrature within the interval [0,1]
- Q_poly(alpha, beta, degree)#
Gauss Q-poly Quadrature in [0,1]
Parameters#
- f: float array
f(x) at quadrature points
- alphafloat
Parameter for Q polynomial, lpha > -1
- betafloat
Parameter for Q polynomial, eta > -1
- degreeint
degree of the polynomial
Returns#
Value of Gauss Q-poly Quadrature within the interval [0,1]
- shift_arbitary_legendre(a, b, degree)#
Gauss Legendre Quadrature (shifted arbitary) in [a,b]
Parameters#
- f: float array
f(x) at quadrature points
a : min of interval [a, b]
b : max of interval [a, b]
- degreeint
degree of the polynomial
Returns#
Value of Shifted arbitary Gauss Legendre Quadrature within the interval [a,b]
- shift_arbitary_jacobi(a, b, alpha, beta, degree)#
Gauss Jacobi Quadrature (shifted arbitary) in [a,b]
Parameters#
- f: float array
f(x) at quadrature points
a : min of interval [a, b]
b : max of interval [a, b]
- alphafloat
Parameter for Jacobi polynomial, lpha > -1
- betafloat
Parameter for Jacobi polynomial, eta > -1
- degreeint
degree of the polynomial
Returns#
Value of Shifted arbitary Gauss Jacobi Quadrature within the interval [a,b]
- homogenous_legendre(f0, degree)#
Gauss Legendre Quadrature for homogenous in [-1,1]
phi_i = l_{k+2} - l_{k}, where l is legendre polynomial in [-1,1] of degree k
Parameters#
- f2: float array
f(x) at quadrature points with associted degree “k+2” legendre polynomials
- f0: float array
f(x) at quadrature points with associted degree “k” legendre polynomials
- degreeint
degree of the polynomial
Returns#
Value of Gauss Legendre Quadrature for homogenous within the interval [-1,1]
- homogenous_shift_legendre(f0, degree)#
Gauss Legendre Quadrature for homogenous in [0,1]
phi_i = l_{k+2} - l_{k}, where l is shifted legendre polynomial in [0,1] of degree k
Parameters#
- f2: float array
f(x) at quadrature points with associted degree “k+2” shifted legendre polynomials
- f0: float array
f(x) at quadrature points with associted degree “k” shifted legendre polynomials
- degreeinf2 = np.sin(q2)
f0 = np.sin(q0)t degree of the polynomial
Returns#
Value of Gauss Legendre Quadrature for homogenous within the interval [0,1]