Beispiel #1
0
 def test_interrelations_kh2_exact(self):
     n = 8
     x = 1.464478579484278
     left = np.complex(sph_kn_exact(n, x))
     right = np.complex(-pi / 2 * mpc(0, 1)**(-n) *
                        sph_h2n_exact(n, -1j * x))
     assert_allclose(left, right)
Beispiel #2
0
 def test_interrelations_k_exact(self):
     n = 7
     x = 5.746161870059113
     left = np.complex(sph_kn_exact(n, x))
     right = np.complex((-1)**(n + 1) * pi / 2 *
                        (sph_i1n_exact(n, x) - sph_i2n_exact(n, x)))
     assert_allclose(left, right)
Beispiel #3
0
 def test_interrelations_kh2_exact(self):
     n = 8
     x = 1.464478579484278
     left = np.complex(sph_kn_exact(n, x))
     right = np.complex(-pi / 2 * mpc(0, 1) ** (-n) * sph_h2n_exact(n, -1j * x))
     assert_allclose(left, right)
Beispiel #4
0
 def test_interrelations_kh1_exact(self):
     n = 4
     x = 4.403387573037941
     left = np.complex(sph_kn_exact(n, x))
     right = np.complex(-pi / 2 * mpc(0, 1) ** n * sph_h1n_exact(n, 1j * x))
     assert_allclose(left, right)
Beispiel #5
0
 def test_interrelations_k_exact(self):
     n = 7
     x = 5.746161870059113
     left = np.complex(sph_kn_exact(n, x))
     right = np.complex((-1) ** (n + 1) * pi / 2 * (sph_i1n_exact(n, x) - sph_i2n_exact(n, x)))
     assert_allclose(left, right)
Beispiel #6
0
 def test_sph_k2_exact(self):
     x = 12.806013305135048
     desired = (1 / x + 3 / x ** 2 + 3 / x ** 3) * np.exp(-x) * np.pi / 2
     actual = np.complex(sph_kn_exact(2, x))
     assert_allclose(actual, desired)
Beispiel #7
0
 def test_sph_k1_exact(self):
     x = 8.853399925289201
     desired = (1 / x + 1 / x ** 2) * np.exp(-x) * np.pi / 2
     actual = np.complex(sph_kn_exact(1, x))
     assert_allclose(actual, desired)
Beispiel #8
0
 def test_sph_k0_exact(self):
     x = 7.547480927635526
     desired = np.pi * np.exp(-x) / (2 * x)
     actual = np.complex(sph_kn_exact(0, x))
     assert_allclose(actual, desired)
Beispiel #9
0
 def test_sph_k1_exact(self):
     x = 8.853399925289201
     desired = (1 / x + 1 / x**2) * np.exp(-x) * np.pi / 2
     actual = np.complex(sph_kn_exact(1, x))
     assert_allclose(actual, desired)
Beispiel #10
0
 def test_sph_k0_exact(self):
     x = 7.547480927635526
     desired = np.pi * np.exp(-x) / (2 * x)
     actual = np.complex(sph_kn_exact(0, x))
     assert_allclose(actual, desired)
Beispiel #11
0
 def test_interrelations_kh1_exact(self):
     n = 4
     x = 4.403387573037941
     left = np.complex(sph_kn_exact(n, x))
     right = np.complex(-pi / 2 * mpc(0, 1)**n * sph_h1n_exact(n, 1j * x))
     assert_allclose(left, right)
Beispiel #12
0
 def test_sph_k2_exact(self):
     x = 12.806013305135048
     desired = (1 / x + 3 / x**2 + 3 / x**3) * np.exp(-x) * np.pi / 2
     actual = np.complex(sph_kn_exact(2, x))
     assert_allclose(actual, desired)