Exemple #1
0
def make_hankel_h2_vals():
    from mpmath import hankel2

    nu = [
        mpf('0.5'),
        mpf('1.25'),
        mpf('1.5'),
        mpf('1.75'),
        mpf(2),
        mpf('2.75'),
        mpf(5),
        mpf(10),
        mpf(20)
    ]
    x = [
        mpf('0.2'),
        mpf(1),
        mpf(2),
        mpf('2.5'),
        mpf(3),
        mpf(5),
        mpf(10),
        mpf(50)
    ]

    nu, x = zip(*outer(nu, x))
    h2 = [hankel2(*vals) for vals in zip(nu, x)]

    return make_special_vals('hankel_h2_vals', ('nu', nu), ('x', x),
                             ('h2', h2))
def make_hankel_h2_vals():
    from mpmath import hankel2

    nu = [mpf('0.5'), mpf('1.25'), mpf('1.5'), mpf('1.75'), mpf(2), mpf('2.75'),
        mpf(5), mpf(10), mpf(20)]
    x = [mpf('0.2'), mpf(1), mpf(2), mpf('2.5'), mpf(3), mpf(5), mpf(10), mpf(50)]

    nu, x = zip(*outer(nu, x))
    h2 = [hankel2(*vals) for vals in zip(nu, x)]

    return make_special_vals('hankel_h2_vals', ('nu', nu), ('x', x), ('h2', h2))
Exemple #3
0
 def test_hankel2(self):
     assert_mpmath_equal(sc.hankel2,
                         _exception_to_nan(lambda v, x: mpmath.hankel2(v, x, **HYPERKW)),
                         [Arg(-1e20, 1e20), Arg()])
Exemple #4
0
 def test_hankel2(self):
     assert_mpmath_equal(
         sc.hankel2,
         _exception_to_nan(lambda v, x: mpmath.hankel2(v, x, **HYPERKW)),
         [Arg(-1e20, 1e20), Arg()])
Exemple #5
0
def sph_h2n_bessel(n, z):
    return hankel2(n + mpf(1)/2, z)*sqrt(pi/(2*z))
Exemple #6
0
def sph_h2n_bessel(n, z):
    return hankel2(n + mpf(1) / 2, z) * sqrt(pi / (2 * z))