def dgen1(**kwargs): from spyctral.laguerre.eval import laguerre_function from spyctral.laguerre.weights import sqrt_weight [x,w] = pgq(**kwargs) ps = laguerre_function(x,range(2*N),alpha=alpha,scale=scale,shift=shift) ps[:,0] = 0 ps = (ps.T*sqrt_weight(x,alpha=alpha,scale=scale,shift=shift)).T return [w,ps]
def laguerre_function(x,n,alpha=0.,scale=1.,shift=0.): """ Evaluates the L^2-orthonormalized Laguerre functions: i.e. the Laguerre polynomials with the weight function multiplicatively distributed to the polynomials. """ from spyctral.laguerre.weights import sqrt_weight lpolys = laguerre_polynomial(x=x,n=n,alpha=alpha,scale=scale,shift=shift) w = sqrt_weight(x=x,alpha=alpha,shift=shift,scale=scale) return (lpolys.T*w).T
def laguerre_function_derivative(x,n,alpha=0.,scale=1.,shift=0.): """ Evaluates the derivative of the L^2-orthonormalized Laguerre functions: i.e. the Laguerre polynomials with the weight function multiplicatively distributed to the polynomials. """ from spyctral.laguerre.weights import sqrt_weight, dsqrt_weight w = sqrt_weight(x=x,alpha=alpha,shift=shift,scale=scale) dw = dsqrt_weight(x=x,alpha=alpha,shift=shift,scale=scale) ps = laguerre_polynomial(x=x,n=n,alpha=alpha,scale=scale,shift=shift) dps = laguerre_polynomial(x=x,n=n,d=1,alpha=alpha,scale=scale,shift=shift) # Yay product rule return (w*dps.T + dw*ps.T).T