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)
def test_sph_i22_exact(self): x = 6.916886515975276 desired = (1 / x + 3 / x ** 3) * np.cosh(x) - 3 / x ** 2 * np.sinh(x) actual = np.complex(sph_i2n_exact(2, x)) assert_allclose(actual, desired)
def test_sph_i21_exact(self): x = 11.070885074673603 desired = -np.cosh(x) / x ** 2 + np.sinh(x) / x actual = np.complex(sph_i2n_exact(1, x)) assert_allclose(actual, desired)
def test_sph_i20_exact(self): x = 5.807556326907072 desired = np.cosh(x) / x actual = np.complex(sph_i2n_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_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)
def test_sph_i22_exact(self): x = 6.916886515975276 desired = (1 / x + 3 / x**3) * np.cosh(x) - 3 / x**2 * np.sinh(x) actual = np.complex(sph_i2n_exact(2, x)) assert_allclose(actual, desired)
def test_sph_i21_exact(self): x = 11.070885074673603 desired = -np.cosh(x) / x**2 + np.sinh(x) / x actual = np.complex(sph_i2n_exact(1, 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)