def test_sph_j2_exact(self): x = 24.5 desired = (-1.0 / x + 3 / x ** 3) * np.sin(x) - 3 / x ** 2 * np.cos(x) actual = np.complex(sph_jn_exact(2, x)) assert_allclose(actual, desired)
def test_sph_j0_exact(self): x = 52 desired = np.sin(x) / x actual = np.complex(sph_jn_exact(0, x)) assert_allclose(actual, desired)
def test_sph_j1_exact(self): x = 1.3 desired = np.sin(x) / x ** 2 - np.cos(x) / x actual = np.complex(sph_jn_exact(1, x)) assert_allclose(actual, desired)
def test_interrelations_h2_exact(self): n = 5 x = 2.826012588052626 left = np.complex(sph_h2n_exact(n, x)) right = np.complex(sph_jn_exact(n, x) - 1j * sph_yn_exact(n, x)) assert_allclose(left, right)
def test_interrelations_i1_exact(self): n = 3 x = 1.9513017144556937 left = np.complex(sph_i1n_exact(n, x)) right = np.complex(mpc(0, 1) ** (-n) * sph_jn_exact(n, 1j * x)) assert_allclose(left, right)
def test_sph_j2_exact(self): x = 24.5 desired = (-1.0 / x + 3 / x**3) * np.sin(x) - 3 / x**2 * np.cos(x) actual = np.complex(sph_jn_exact(2, x)) assert_allclose(actual, desired)
def test_interrelations_h1_exact(self): n = 6 x = 8.160875740148962 left = np.complex(sph_h1n_exact(n, x)) right = np.complex(sph_jn_exact(n, x) + 1j * sph_yn_exact(n, x)) assert_allclose(left, right)
def test_sph_j1_exact(self): x = 1.3 desired = np.sin(x) / x**2 - np.cos(x) / x actual = np.complex(sph_jn_exact(1, x)) assert_allclose(actual, desired)
def test_interrelations_i1_exact(self): n = 3 x = 1.9513017144556937 left = np.complex(sph_i1n_exact(n, x)) right = np.complex(mpc(0, 1)**(-n) * sph_jn_exact(n, 1j * x)) assert_allclose(left, right)