Пример #1
0
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)
Пример #2
0
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