Lapacian module#

Created on Thu Aug 29 09:36:54 2024

@author: ppranjiv

class laplace_matrix.galerkin#

Bases: object

Computes Lapalician matrix for (d2dx Pn^{lpha, eta}, Pm^{lpha, eta})_w
where,

n, m > 0, Pn-th order polynomail weight, w : coressponds to Jacobi polynomail with alpha , beta of the TEST function

Note#

Here we do NOT use integration by parts, rather take the second derivative of trail function, then compute the inner product with respect to weights associated with test functions.

legendre()#

Computes Mass matrix Legendre Polynomials in [-1,1] of dim = (k) x (k), where k-1 is highest degree

Parameters#

degreeint

degree of the polynomial

Returns#

Matrix Legendre polynomials within the interval [-1,1]

M: numpy array

Matrix of dim (k) X (k), where k-1 is the highest degree of Legengre Polynomials

homogeneous_legendre()#

Computes Lapalce matrix Homogeneus basis using Legendre Polynomials in [-1,1] of dim = (k) x (k), where k-1 is highest degree

Parameters#

degreeint

degree of the polynomial

Returns#

Matrix Homogeneus basis using Legendre polynomials within the interval [-1,1]

M: numpy array

Matrix of dim (k) X (k), where k-1 is the highest degree of Legengre Polynomials

Notes#

phi_n = l_{n+2} - l_{n},

where, l_{n} is an nth order Legendre Polynomial and, phi_n is a homogeneous basis function

shift_legendre()#

Computes Mass matrix Shifted Legendre Lapalcian in [0,1] of dim = (k) x (k), where k-1 is highest degree

Parameters#

degreeint

degree of the polynomial

Returns#

Matrix Legendre Lapalcian within the interval [0,1]

M: numpy array

Matrix of dim (k) X (k), where k-1 is the highest degree of Shifted Legengre Lapalcian

jacobi(beta, degree)#

Computes Mass matrix Jacobi Lapalcian in [-1,1] of dim = (k) x (k), where k-1 is highest degree

Parameters#

alphafloat

paramter assocated with Jacobi Lapalcian, alpha > -1

betafloat

paramter assocated with Jacobi Lapalcian, beta > -1

degreeint

degree of the polynomial

Returns#

Matrix Jacobi Lapalcian within the interval [-1,1]

M: numpy array

Matrix of dim (k) X (k), where k-1 is the highest degree of Jacobi Lapalcian

chebyshev_first_kind()#

Computes Laplacpe chebyshev_first_kind s in [-1,1] of dim = (k) x (k), where k-1 is highest degree

Parameters#

degreeint

degree of the polynomial

Returns#

Laplace martix chebyshev_first_kind within the interval [-1,1]

M: numpy array

Matrix of dim (k) X (k), where k-1 is the highest degree

shift_jacobi(beta, degree)#

Computes Mass matrix Shifted Jacobi Lapalcian in [0,1] of dim = (k) x (k), where k-1 is highest degree

Parameters#

alphafloat

paramter assocated with Jacobi Lapalcian, alpha > -1

betafloat

paramter assocated with Jacobi Lapalcian, beta > -1

degreeint

degree of the polynomial

Returns#

Matrix Jacobi Lapalcian within the interval [0,1]

M: numpy array

Matrix of dim (k) X (k), where k-1 is the highest degree of Shifted Jacobi Lapalcian

Q_poly(beta, degree)#

Computes Mass matrix Q Lapalcian in [0,1] of dim = (k) x (k), where k-1 is highest degree

Parameters#

alphafloat

paramter assocated with Q Lapalcian, alpha > -1

betafloat

paramter assocated with Q Lapalcian, beta > -1

degreeint

degree of the polynomial

Returns#

Matrix Q Lapalcian within the interval [0,1]

M: numpy array

Matrix of dim (k) X (k), where k-1 is the highest degree of Q Lapalcian

Notes#

Q (x) := P_n (1-2x), where P_n is a Jacobi polynomial with paramter, alpha and beta.

shift_arbitary_jacobi(b, alpha, beta, degree)#

Computes Mass matrix Shifted (arbitary) Jacobi Lapalcian in [a,b] of dim = (k) x (k), where k-1 is highest degree

Parameters#

afloat

min of interval [a, b]

bfloat

max of interval [a, b]

alphafloat

paramter assocated with Jacobi Lapalcian, alpha > -1

betafloat

paramter assocated with Jacobi Lapalcian, beta > -1

degreeint

degree of the polynomial

Returns#

Matrix Jacobi Lapalcian within the interval [0,1]

M: numpy array

Matrix of dim (k) X (k), where k-1 is the highest degree of Shifted Jacobi Lapalcian

class laplace_matrix.petrov_galerkin#

Bases: object

Computes Lapalician (Petrov-Galerkin) matrix for (d2dx Pn, Pm^{lpha, eta})_w
where,

n, m > 0, Pn-th order polynomail weight, w : coressponds to Jacobi polynomail with alpha , beta of the TEST function

Note#

  • Here we do NOT use integration by parts, rather take the second derivative of trail function,

then compute the inner product with respect to weights associated with test functions.

  • Computes Lapalce matrix Patrov-Galkerin implies the test and trial functions are different.

homogeneous_legendre()#
Computes Lapalce matrix Patrov-Galkerin

Trial function : Homogeneous Legendre Test function : Legendre

Parameters#

degreeint

degree of the polynomial

Returns#

M: numpy array

Matrix of dim (k) X (k), where k-1 is the highest degree of Legengre Polynomials Lapaciam Matrix within the interval [-1,1]

Notes#

phi_n = l_{n+2} - l_{n},

where, l_{n} is an nth order Legendre Polynomial and, phi_n is a Homogeneous Legendre basis function

homogeneous_shift_legendre()#
Computes Lapalce matrix Patrov-Galkerin

Trial function : Homogeneous Shifted Legendre Test function : Shifted Legendre

Parameters#

degreeint

degree of the polynomial

Returns#

M: numpy array

Matrix of dim (k) X (k), where k-1 is the highest degree of Shifted Legengre Polynomials Lapaciam Matrix within the interval [0,1]

Notes#

phi_n = l_{n+2} - l_{n},

where, l_{n} is an nth order Shifted Legendre Polynomial and, phi_n is a Homogeneous Shifted Legendre basis function