当前位置: 首页>>代码示例>>Python>>正文


Python hyper.hyper函数代码示例

本文整理汇总了Python中sympy.functions.special.hyper.hyper函数的典型用法代码示例。如果您正苦于以下问题:Python hyper函数的具体用法?Python hyper怎么用?Python hyper使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了hyper函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: eval

    def eval(cls, n, a, b, x):
        # Simplify to other polynomials
        # P^{a, a}_n(x)
        if a == b:
            if a == -S.Half:
                return RisingFactorial(S.Half, n) / factorial(n) * chebyshevt(n, x)
            elif a == S.Zero:
                return legendre(n, x)
            elif a == S.Half:
                return RisingFactorial(3*S.Half, n) / factorial(n + 1) * chebyshevu(n, x)
            else:
                return RisingFactorial(a + 1, n) / RisingFactorial(2*a + 1, n) * gegenbauer(n, a + S.Half, x)
        elif b == -a:
            # P^{a, -a}_n(x)
            return gamma(n + a + 1) / gamma(n + 1) * (1 + x)**(a/2) / (1 - x)**(a/2) * assoc_legendre(n, -a, x)
        elif a == -b:
            # P^{-b, b}_n(x)
            return gamma(n - b + 1) / gamma(n + 1) * (1 - x)**(b/2) / (1 + x)**(b/2) * assoc_legendre(n, b, x)

        if not n.is_Number:
            # Symbolic result P^{a,b}_n(x)
            # P^{a,b}_n(-x)  --->  (-1)**n * P^{b,a}_n(-x)
            if x.could_extract_minus_sign():
                return S.NegativeOne**n * jacobi(n, b, a, -x)
            # We can evaluate for some special values of x
            if x == S.Zero:
                return (2**(-n) * gamma(a + n + 1) / (gamma(a + 1) * factorial(n)) *
                        hyper([-b - n, -n], [a + 1], -1))
            if x == S.One:
                return RisingFactorial(a + 1, n) / factorial(n)
            elif x == S.Infinity:
                if n.is_positive:
                    # Make sure a+b+2*n \notin Z
                    if (a + b + 2*n).is_integer:
                        raise ValueError("Error. a + b + 2*n should not be an integer.")
                    return RisingFactorial(a + b + n + 1, n) * S.Infinity
        else:
            # n is a given fixed integer, evaluate into polynomial
            return jacobi_poly(n, a, b, x)
开发者ID:ChaliZhg,项目名称:sympy,代码行数:39,代码来源:polynomials.py

示例2: _eval_rewrite_as_hyper

 def _eval_rewrite_as_hyper(self, m, **kwargs):
     return (pi/2)*hyper((S.Half, S.Half), (S.One,), m)
开发者ID:asmeurer,项目名称:sympy,代码行数:2,代码来源:elliptic_integrals.py

示例3: _eval_rewrite_as_hyper

 def _eval_rewrite_as_hyper(self, z):
     return (pi/2)*hyper((S.Half, S.Half), (S.One,), z)
开发者ID:Amo10,项目名称:Computer-Science-2014-2015,代码行数:2,代码来源:elliptic_integrals.py

示例4: _eval_rewrite_as_hyper

 def _eval_rewrite_as_hyper(self, z):
     return pi*z**3/6 * hyper([S(3)/4], [S(3)/2, S(7)/4], -pi**2*z**4/16)
开发者ID:Maihj,项目名称:sympy,代码行数:2,代码来源:error_functions.py

示例5: _eval_rewrite_as_hyper

 def _eval_rewrite_as_hyper(self, z):
     pf1 = S.One / (3 ** (S(2) / 3) * gamma(S(2) / 3))
     pf2 = z / (root(3, 3) * gamma(S(1) / 3))
     return pf1 * hyper([], [S(2) / 3], z ** 3 / 9) - pf2 * hyper([], [S(4) / 3], z ** 3 / 9)
开发者ID:LuckyStrikes1090,项目名称:sympy,代码行数:4,代码来源:bessel.py

示例6: test_sympy__functions__special__hyper__hyper

def test_sympy__functions__special__hyper__hyper():
    from sympy.functions.special.hyper import hyper
    assert _test_args(hyper([1, 2, 3], [4, 5], x))
开发者ID:101man,项目名称:sympy,代码行数:3,代码来源:test_args.py


注:本文中的sympy.functions.special.hyper.hyper函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。