Petrov-Galerkin Tau for Fractional Derivative using inner product#
Created on Fri Sep 6 13:30:01 2024
@author: ppranjiv
- PG_tau_frac_der.gm(x)#
- Petrov-Galerkin methods for fractional derivative,
exmaple Power function : x^k1 - x^k2. Since the function is homogenous, we use Sifted Homogeneuos Legendre Basis, where,
Trial function : phi_n = kappa * (L_n+2 - L_n ), Test function : (L_n+2 - L_n );
where L_n is nth order legendre polynomial and Kappa is a sonine kernel, assocaited with integral - in this case fractional
Note : Innner product is used, instead of outer convolution orthogonality.
To fix : Jacobi Quadture weights and quad points.
- PG_tau_frac_der.legendre_conv_basis(x, n, degree, alpha)#
- PG_tau_frac_der.legendre_conv_basis_at_x(x, n, degree, alpha)#
- PG_tau_frac_der.exp(x, a1, degree, alpha)#
Reconsturct the function f (x) = SUM_n a_n P_n,
- where,
P_n is shifted Legendre polynomails over the interval [0,1] and, a_n are the coeffcients.
Parameters#
- xarray
x in [0, 1]
- a1array
coeffiencts for Galerkin projection
- degreeint
max. degree for the polynomial
Returns#
- fxarray
function values at x in [0,1]
- PG_tau_frac_der.func1(x, k1)#
Test function
Parameters#
- xarray
x in [0, 1]
k1 : int
k2 : int
Returns#
- fxarray
function values at x in [0,1]
- PG_tau_frac_der.rhs_inner(degree, k1, alpha)#
Computes the inner porduct from [0,1] of
- rhs = g * P_n,
- where,
P_n is shifted homogenehous Legendre polynomial and f is the function
Parameters#
- degreeint
degree for the polynomial
k1 : int
k2 : int
alpha : float
Returns#
- rhsfloat
inner porduct in [0,1]
- PG_tau_frac_der.apply_bc(M, rhs, k1, alpha)#
- PG_tau_frac_der.main(degree, k1, alpha)#
- PG_tau_frac_der.plot_err(degree, k1, alpha)#