def test_sph_y2_exact(self): x = 0.321 desired = (1.0 / x - 3 / x ** 3) * np.cos(x) - 3 / x ** 2 * np.sin(x) actual = np.complex(sph_yn_exact(2, x)) assert_allclose(actual, desired)
def test_sph_y0_exact(self): x = 4.3 desired = -np.cos(x) / x actual = np.complex(sph_yn_exact(0, x)) assert_allclose(actual, desired)
def test_sph_y1_exact(self): x = 29.2 desired = -np.cos(x) / x ** 2 - np.sin(x) / x actual = np.complex(sph_yn_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_i2_exact(self): n = 9 x = 6.083765036260925 left = np.complex(sph_i2n_exact(n, x)) right = np.complex(mpc(0, 1) ** (-n - 1) * sph_yn_exact(n, 1j * x)) assert_allclose(left, right)
def test_sph_y2_exact(self): x = 0.321 desired = (1.0 / x - 3 / x**3) * np.cos(x) - 3 / x**2 * np.sin(x) actual = np.complex(sph_yn_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_y1_exact(self): x = 29.2 desired = -np.cos(x) / x**2 - np.sin(x) / x actual = np.complex(sph_yn_exact(1, x)) assert_allclose(actual, desired)
def test_sph_y0_exact(self): x = 4.3 desired = -np.cos(x) / x actual = np.complex(sph_yn_exact(0, x)) assert_allclose(actual, desired)
def test_interrelations_i2_exact(self): n = 9 x = 6.083765036260925 left = np.complex(sph_i2n_exact(n, x)) right = np.complex(mpc(0, 1)**(-n - 1) * sph_yn_exact(n, 1j * x)) assert_allclose(left, right)
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_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)