Пример #1
0
 def test_interrelations_kh2_bessel(self):
     n = 8
     x = 1.464478579484278
     left = np.complex(sph_kn_bessel(n, x))
     right = np.complex(-pi / 2 * mpc(0, 1)**(-n) *
                        sph_h2n_bessel(n, -1j * x))
     assert_allclose(left, right)
Пример #2
0
 def test_interrelations_k_bessel(self):
     n = 7
     x = 5.746161870059113
     left = np.complex(sph_kn_bessel(n, x))
     right = np.complex((-1)**(n + 1) * pi / 2 *
                        (sph_i1n_bessel(n, x) - sph_i2n_bessel(n, x)))
     assert_allclose(left, right)
Пример #3
0
 def test_interrelations_kh2_bessel(self):
     n = 8
     x = 1.464478579484278
     left = np.complex(sph_kn_bessel(n, x))
     right = np.complex(-pi / 2 * mpc(0, 1) ** (-n) * sph_h2n_bessel(n, -1j * x))
     assert_allclose(left, right)
Пример #4
0
 def test_interrelations_kh1_bessel(self):
     n = 4
     x = 4.403387573037941
     left = np.complex(sph_kn_bessel(n, x))
     right = np.complex(-pi / 2 * mpc(0, 1) ** n * sph_h1n_bessel(n, 1j * x))
     assert_allclose(left, right)
Пример #5
0
 def test_interrelations_k_bessel(self):
     n = 7
     x = 5.746161870059113
     left = np.complex(sph_kn_bessel(n, x))
     right = np.complex((-1) ** (n + 1) * pi / 2 * (sph_i1n_bessel(n, x) - sph_i2n_bessel(n, x)))
     assert_allclose(left, right)
Пример #6
0
 def test_sph_k2_bessel(self):
     x = 12.806013305135048
     desired = (1 / x + 3 / x ** 2 + 3 / x ** 3) * np.exp(-x) * np.pi / 2
     actual = np.complex(sph_kn_bessel(2, x))
     assert_allclose(actual, desired)
Пример #7
0
 def test_sph_k1_bessel(self):
     x = 8.853399925289201
     desired = (1 / x + 1 / x ** 2) * np.exp(-x) * np.pi / 2
     actual = np.complex(sph_kn_bessel(1, x))
     assert_allclose(actual, desired)
Пример #8
0
 def test_sph_k0_bessel(self):
     x = 7.547480927635526
     desired = np.pi * np.exp(-x) / (2 * x)
     actual = np.complex(sph_kn_bessel(0, x))
     assert_allclose(actual, desired)
Пример #9
0
 def test_interrelations_kh1_bessel(self):
     n = 4
     x = 4.403387573037941
     left = np.complex(sph_kn_bessel(n, x))
     right = np.complex(-pi / 2 * mpc(0, 1)**n * sph_h1n_bessel(n, 1j * x))
     assert_allclose(left, right)
Пример #10
0
 def test_sph_k2_bessel(self):
     x = 12.806013305135048
     desired = (1 / x + 3 / x**2 + 3 / x**3) * np.exp(-x) * np.pi / 2
     actual = np.complex(sph_kn_bessel(2, x))
     assert_allclose(actual, desired)
Пример #11
0
 def test_sph_k1_bessel(self):
     x = 8.853399925289201
     desired = (1 / x + 1 / x**2) * np.exp(-x) * np.pi / 2
     actual = np.complex(sph_kn_bessel(1, x))
     assert_allclose(actual, desired)
Пример #12
0
 def test_sph_k0_bessel(self):
     x = 7.547480927635526
     desired = np.pi * np.exp(-x) / (2 * x)
     actual = np.complex(sph_kn_bessel(0, x))
     assert_allclose(actual, desired)