Пример #1
0
 def test_airyai_prime(self):
     # oscillating function, limit range
     assert_mpmath_equal(lambda z: sc.airy(z)[1], lambda z:
                         mpmath.airyai(z, derivative=1),
                         [Arg(-1e8, 1e8)], 
                         rtol=1e-6)
     assert_mpmath_equal(lambda z: sc.airy(z)[1], lambda z:
                         mpmath.airyai(z, derivative=1),
                         [Arg(-1e3, 1e3)])
Пример #2
0
 def test_airyai_prime(self):
     # oscillating function, limit range
     assert_mpmath_equal(lambda z: sc.airy(z)[1],
                         lambda z: mpmath.airyai(z, derivative=1),
                         [Arg(-1e8, 1e8)],
                         rtol=1e-6)
     assert_mpmath_equal(lambda z: sc.airy(z)[1],
                         lambda z: mpmath.airyai(z, derivative=1),
                         [Arg(-1e3, 1e3)])
Пример #3
0
def make_airy_vals():
    from mpmath import airyai, airybi

    x = linspace(-5, 15, 21)
    ai = [airyai(val) for val in x]
    aip = [airyai(val, 1) for val in x]
    bi = [airybi(val) for val in x]
    bip = [airybi(val, 1) for val in x]

    aibi = zip(zip(ai, aip), zip(bi, bip))

    return make_special_vals('airy_vals', ('x', x), ('aibi', aibi))
Пример #4
0
def make_airy_vals():
    from mpmath import airyai, airybi

    x = linspace(-5, 15, 21)
    ai = [airyai(val) for val in x]
    aip = [airyai(val, 1) for val in x]
    bi = [airybi(val) for val in x]
    bip = [airybi(val, 1) for val in x]

    aibi = list(zip(list(zip(ai, aip)), list(zip(bi, bip))))

    return make_special_vals('airy_vals', ('x', x), ('aibi', aibi))
Пример #5
0
def f6(x):
    # airy_Ai_deriv_scaled
    scale = mpmath.exp(mpmath.mpf(2) / mpmath.mpf(3) * mpmath.sqrt(x) * x)
    y = mpmath.airyai(x, derivative=1)
    if x > 0.0:
        y = y * scale
    return y
Пример #6
0
def f2(x):
    # airy_Ai_scaled
    scale = mpmath.exp(mpmath.mpf(2) / mpmath.mpf(3) * mpmath.sqrt(x) * x)
    y = mpmath.airyai(x)
    if x > 0.0:
        y = y * scale
    return y
Пример #7
0
 def get_mpmath_function(self, args):
     return lambda x: mpmath.airyai(x, derivative=1)
Пример #8
0
 def test_airyai_prime_complex(self):
     assert_mpmath_equal(lambda z: sc.airy(z)[1], lambda z:
                         mpmath.airyai(z, derivative=1),
                         [ComplexArg()])
Пример #9
0
 def test_airyai_prime_complex(self):
     assert_mpmath_equal(lambda z: sc.airy(z)[1],
                         lambda z: mpmath.airyai(z, derivative=1),
                         [ComplexArg()])
Пример #10
0
def f0(x):
    # airy_Ai
    return mpmath.airyai(x)
Пример #11
0
def f4(x):
    # airy_Ai_deriv
    return mpmath.airyai(x, derivative=1)
Пример #12
0
 def get_mpmath_function(self, args):
     return lambda x: mpmath.airyai(x, derivative=1)