def jacobi_function(x,ns,s=1.,t=1.,scale=1.,shift=0.): from spyctral.jacobi.eval import jpoly from spyctral.mapjpoly.maps import x_to_r, st_to_ab [alpha,beta] = st_to_ab(s,t) return jpoly(x_to_r(x,scale=scale,shift=shift), ns,alpha=alpha,beta=beta)
def djacobi_function(x,ns,s=1.,t=1.,scale=1.,shift=0.): from spyctral.jacobi.eval import djpoly from spyctral.mapjpoly.maps import x_to_r, st_to_ab, dr_dx [alpha,beta] = st_to_ab(s,t) jac = dr_dx(x,scale=scale,shift=shift) r = x_to_r(x,scale=scale,shift=shift) ps = djpoly(r,ns,alpha=alpha,beta=beta) return (ps.T*jac).T
def gq(N,s=1.,t=1.,scale=1.,shift=0.): from spyctral.common.maps import physical_scaleshift as pss from spyctral.mapjpoly.maps import st_to_ab, r_to_x from spyctral.jacobi.quad import gq [alpha,beta]=st_to_ab(s,t) [r,w] = gq(N,alpha=alpha,beta=beta) x = r_to_x(r) #x *= scale #x += shift pss(x,scale=scale,shift=shift) return [x,w]