def test_basis(self, n=4): """ Tn(cos(t)) = cos(nt) """ Tn = Chebfun.basis(n) ts = np.linspace(0, 2 * np.pi, 100) npt.assert_allclose(Tn(np.cos(ts)), np.cos(n * ts))
def test_basis(self, n=4): """ Tn(cos(t)) = cos(nt) """ Tn = Chebfun.basis(n) ts = np.linspace(0, 2*np.pi, 100) npt.assert_allclose(Tn(np.cos(ts)), np.cos(n*ts))
def test_runge(self): """ Test some of the capabilities of operator overloading. """ r = Chebfun.from_function(runge) x = Chebfun.basis(1) rr = 1. / (1 + 25 * x**2) tools.assert_close(r, rr, rtol=1e-13)
def test_runge(self): """ Test some of the capabilities of operator overloading. """ r = Chebfun.from_function(runge) x = Chebfun.basis(1) rr = 1./(1+25*x**2) tools.assert_close(r, rr, rtol=1e-13)
def test_repr(self): """ Repr shows the interpolation values. """ self.skipTest('Representation changed to include domain information') p = Chebfun.basis(1) s = repr(p) expected = '<Chebfun(array([ 1., -1.]))>' self.assertEqual(s, expected)
def test_basis(self, ns=[0, 5]): for n in ns: c = Chebfun.basis(n) npt.assert_array_almost_equal(c.coefficients(), np.array([0] * n + [1.]))
def test_basis(self, ns=[0,5]): for n in ns: c = Chebfun.basis(n) npt.assert_array_almost_equal(c.coefficients(), np.array([0]*n+[1.]))