Beispiel #1
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)
Beispiel #2
0
 def test_interrelations_i1_bessel(self):
     n = 3
     x = 1.9513017144556937
     left = np.complex(sph_i1n_bessel(n, x))
     right = np.complex(mpc(0, 1) ** (-n) * sph_jn_bessel(n, 1j * x))
     assert_allclose(left, right)
Beispiel #3
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)
Beispiel #4
0
 def test_sph_i12_bessel(self):
     x = 9.810801919951345
     desired = (1 / x + 3 / x ** 3) * np.sinh(x) - 3 / x ** 2 * np.cosh(x)
     actual = np.complex(sph_i1n_bessel(2, x))
     assert_allclose(actual, desired)
Beispiel #5
0
 def test_sph_i11_bessel(self):
     x = 6.802805007381322
     desired = -np.sinh(x) / x ** 2 + np.cosh(x) / x
     actual = np.complex(sph_i1n_bessel(1, x))
     assert_allclose(actual, desired)
Beispiel #6
0
 def test_sph_i10_bessel(self):
     x = 62.3
     desired = np.sinh(x) / x
     actual = np.complex(sph_i1n_bessel(0, x))
     assert_allclose(actual, desired)
Beispiel #7
0
 def test_interrelations_i1_bessel(self):
     n = 3
     x = 1.9513017144556937
     left = np.complex(sph_i1n_bessel(n, x))
     right = np.complex(mpc(0, 1)**(-n) * sph_jn_bessel(n, 1j * x))
     assert_allclose(left, right)
Beispiel #8
0
 def test_sph_i12_bessel(self):
     x = 9.810801919951345
     desired = (1 / x + 3 / x**3) * np.sinh(x) - 3 / x**2 * np.cosh(x)
     actual = np.complex(sph_i1n_bessel(2, x))
     assert_allclose(actual, desired)
Beispiel #9
0
 def test_sph_i11_bessel(self):
     x = 6.802805007381322
     desired = -np.sinh(x) / x**2 + np.cosh(x) / x
     actual = np.complex(sph_i1n_bessel(1, x))
     assert_allclose(actual, desired)
Beispiel #10
0
 def test_sph_i10_bessel(self):
     x = 62.3
     desired = np.sinh(x) / x
     actual = np.complex(sph_i1n_bessel(0, x))
     assert_allclose(actual, desired)