本文整理匯總了Python中pychebfun.Chebfun.basis方法的典型用法代碼示例。如果您正苦於以下問題:Python Chebfun.basis方法的具體用法?Python Chebfun.basis怎麽用?Python Chebfun.basis使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pychebfun.Chebfun
的用法示例。
在下文中一共展示了Chebfun.basis方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_basis
# 需要導入模塊: from pychebfun import Chebfun [as 別名]
# 或者: from pychebfun.Chebfun import basis [as 別名]
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: test_runge
# 需要導入模塊: from pychebfun import Chebfun [as 別名]
# 或者: from pychebfun.Chebfun import basis [as 別名]
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)
示例3: test_repr
# 需要導入模塊: from pychebfun import Chebfun [as 別名]
# 或者: from pychebfun.Chebfun import basis [as 別名]
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)