Пример #1
0
 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))
Пример #2
0
 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))
Пример #3
0
 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)
Пример #4
0
 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)
Пример #5
0
 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)
Пример #6
0
 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)
Пример #7
0
 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.]))
Пример #8
0
 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.]))