Petrov-Galerkin Tau for General Fractional Derivative using inner product#
Created on Fri Sep 6 15:38:04 2024
@author: ppranjiv
- PG_tau_gen_fractional_der.gm(x)#
- Convolution Spectral methods for General 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 : Outer convolution orthogonality is used, instead of inner product. - To fix : Jacobi Quadture weights and quad points. 
 
- PG_tau_gen_fractional_der.exp(x, a1, b, degree, alpha)#
- Reconsturct the function f (x) = SUM_n a_n (k * P_n), - where,
- P_n is shifted homogenous basis over the interval [0,1], a_n are the coeffcients for Galerkin projection, and k is the sonin kernel, kappa 
 - Parameters#- xarray
- x in [0, 1] 
- a1array
- coeffiencts for Galerkin projection 
- barray
- coeffiencts for sonin kernel, kappa 
- degreeint
- max. degree for the polynomial 
 - Returns#- fxarray
- function values at x in [0,1] 
 
- PG_tau_gen_fractional_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_gen_fractional_der.kappa_cov(x, b, alpha, n, degree)#
- Computes the convolution, kappa * Pn, where, - P_n is shifted homogenous basis over the interval [0,1], and k is the sonin kernel, kappa - Parameters#- xarray
- x in [0, 1] 
- barray
- coeffiencts for sonin kernel, kappa 
- alphafloat
- fractional order 
- degreeint
- max. degree for the polynomial 
 - Returns#- fxarray
- conolution values at x in [0,1] 
 - Note#- Sonine kernel, kapaa = SUM_k b_k x^{k+alpha-1} / Gamma (alpha) where, Gamma is Euler gamma fucntion 
- PG_tau_gen_fractional_der.kappa_cov_at_x(x, b, alpha, n, degree)#
- Computes the convolution, kappa * Pn, where, - P_n is shifted homogenous basis over the interval [0,1], and k is the sonin kernel, kappa - Parameters#- xarray
- x in [0, 1] 
- barray
- coeffiencts for sonin kernel, kappa 
- alphafloat
- fractional order 
- degreeint
- max. degree for the polynomial 
 - Returns#- fxarray
- conolution values at x in [0,1] 
 - Note#- Sonine kernel, kapaa = SUM_k b_k x^{k+alpha-1} / Gamma (alpha) where, Gamma is Euler gamma fucntion 
- PG_tau_gen_fractional_der.k_inner(a, k1, alpha, n, degree)#
- Computes the convolution, k * Pn, at x = 1 where, - P_n is shifted homogenous basis over the interval [0,1], and k is the sonin kernel, k - Parameters#- aarray
- coeffiencts for sonin kernel, k 
- k1int
- parameter for convolution, k * x^^k1 
- alphafloat
- fractional order 
- degreeint
- max. degree for the polynomial 
 - Returns#- fxarray
- conolution values at x = 1 
 - Note#- Sonine kernel, k = SUM_k a_k x^{k - alpha} / Gamma (1-alpha) where, Gamma is Euler gamma fucntion 
- PG_tau_gen_fractional_der.rhs_inner(n, degree, a, k1, alpha)#
- Computes the outer-convolution from [0,1] of - rhs = g * P_n,
- where,
- P_n is shifted homogenehous Legendre polynomial and g = ddx (k * f) is a function 
 
 - Parameters#- degreeint
- degree for the polynomial 
 - k1 : int - k2 : int - alpha : float - Returns#- rhsfloat
- convolution in [0,1] 
 
- PG_tau_gen_fractional_der.apply_bc(M, rhs, b, k1, alpha)#
- PG_tau_gen_fractional_der.main(degree, k1, alpha)#
- PG_tau_gen_fractional_der.plot_err(degree, k1, alpha)#