本文整理汇总了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)