예제 #1
0
def make_bessel_y1_vals():
    from mpmath import bessely

    x = [mpf('0.1')] + linspace(1, 15, 15)
    y1 = [bessely(1, val) for val in x]

    return make_special_vals('bessel_y1_vals', ('x', x), ('y1', y1))
예제 #2
0
def make_bessel_y_vals():
    from mpmath import bessely

    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))
    y = [bessely(*vals) for vals in zip(nu, x)]

    return make_special_vals('bessel_y_vals', ('nu', nu), ('x', x), ('y', y))
예제 #3
0
def make_bessel_y1_vals():
    from mpmath import bessely

    x = [mpf('0.1')] + linspace(1, 15, 15)
    y1 = [bessely(1, val) for val in x]

    return make_special_vals('bessel_y1_vals', ('x', x), ('y1', y1))
예제 #4
0
 def mpbessely(v, x):
     r = float(mpmath.bessely(v, x, **HYPERKW))
     if abs(r) > 1e305:
         # overflowing to inf a bit earlier is OK
         r = np.inf * np.sign(r)
     if abs(r) == 0 and x == 0:
         # invalid result from mpmath, point x=0 is a divergence
         return np.nan
     return r
예제 #5
0
 def mpbessely(v, x):
     r = float(mpmath.bessely(v, x, **HYPERKW))
     if abs(r) > 1e305:
         # overflowing to inf a bit earlier is OK
         r = np.inf * np.sign(r)
     if abs(r) == 0 and x == 0:
         # invalid result from mpmath, point x=0 is a divergence
         return np.nan
     return r
예제 #6
0
def make_bessel_y_vals():
    from mpmath import bessely

    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))
    y = [bessely(*vals) for vals in zip(nu, x)]

    return make_special_vals('bessel_y_vals', ('nu', nu), ('x', x), ('y', y))
예제 #7
0
파일: sbf_mp.py 프로젝트: tpudlik/sbf
def sph_yn_bessel(n, z):
    out = bessely(n + mpf(1)/2, z)*sqrt(pi/(2*z))
    if mpmathify(z).imag == 0:
        return out.real
    else:
        return out
예제 #8
0
 def test_bessely(self):
     assert_mpmath_equal(sc.yv,
                         _exception_to_nan(lambda v, z: mpmath.bessely(v, z, **HYPERKW)),
                         [Arg(-1e100, 1e100), Arg()],
                         n=1000)
예제 #9
0
 def test_bessely(self):
     assert_mpmath_equal(
         sc.yv,
         _exception_to_nan(lambda v, z: mpmath.bessely(v, z, **HYPERKW)),
         [Arg(-1e100, 1e100), Arg()],
         n=1000)
예제 #10
0
def f11(x):
    # bessel_Y1
    return mpmath.bessely(1, x)
예제 #11
0
def f10(x):
    # bessel_Y0
    return mpmath.bessely(0, x)
예제 #12
0
 def mpbessely(v, x):
     r = float(mpmath.bessely(v, x))
     if abs(r) == 0 and x == 0:
         # invalid result from mpmath, point x=0 is a divergence
         return np.nan
     return r
예제 #13
0
 def mpbessely(v, x):
     r = complex(mpmath.bessely(v, x, **HYPERKW))
     if abs(r) > 1e305:
         # overflowing to inf a bit earlier is OK
         r = np.inf * np.sign(r)
     return r
예제 #14
0
def mp_spherical_dyn(l, z):
    return mpmath.sqrt(mpmath.pi /
                       (2 * z)) * (mpmath.bessely(l + 0.5, z, 1) -
                                   mpmath.bessely(l + 0.5, z) / (2 * z))
예제 #15
0
def mp_spherical_yn(l, z):
    return mpmath.sqrt(mpmath.pi / 2.0 / z) * mpmath.bessely(l + 0.5, z)
예제 #16
0
def sphbessely(nu, x):
    from mpmath import bessely

    return sqrt(pi / (2 * x)) * bessely(nu + mpf('0.5'), x)
예제 #17
0
 def mpbessely(v, x):
     r = complex(mpmath.bessely(v, x, **HYPERKW))
     if abs(r) > 1e305:
         # overflowing to inf a bit earlier is OK
         r = np.inf * np.sign(r)
     return r
예제 #18
0
 def mpbessely(v, x):
     r = float(mpmath.bessely(v, x))
     if abs(r) == 0 and x == 0:
         # invalid result from mpmath, point x=0 is a divergence
         return np.nan
     return r
예제 #19
0
def sphbessely(nu, x):
    from mpmath import bessely

    return sqrt(pi / (2 * x)) * bessely(nu + mpf('0.5'), x)
예제 #20
0
파일: sbf_mp.py 프로젝트: tpudlik/sbf
def sph_yn_bessel(n, z):
    out = bessely(n + mpf(1) / 2, z) * sqrt(pi / (2 * z))
    if mpmathify(z).imag == 0:
        return out.real
    else:
        return out