本文整理汇总了Python中scipy.interpolate.BPoly._construct_from_derivatives方法的典型用法代码示例。如果您正苦于以下问题:Python BPoly._construct_from_derivatives方法的具体用法?Python BPoly._construct_from_derivatives怎么用?Python BPoly._construct_from_derivatives使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scipy.interpolate.BPoly
的用法示例。
在下文中一共展示了BPoly._construct_from_derivatives方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_make_poly_2
# 需要导入模块: from scipy.interpolate import BPoly [as 别名]
# 或者: from scipy.interpolate.BPoly import _construct_from_derivatives [as 别名]
def test_make_poly_2(self):
c1 = BPoly._construct_from_derivatives(0, 1, [1, 0], [1])
assert_allclose(c1, [1., 1., 1.])
# f'(0) = 3
c2 = BPoly._construct_from_derivatives(0, 1, [2, 3], [1])
assert_allclose(c2, [2., 7./2, 1.])
# f'(1) = 3
c3 = BPoly._construct_from_derivatives(0, 1, [2], [1, 3])
assert_allclose(c3, [2., -0.5, 1.])
示例2: test_make_poly_3
# 需要导入模块: from scipy.interpolate import BPoly [as 别名]
# 或者: from scipy.interpolate.BPoly import _construct_from_derivatives [as 别名]
def test_make_poly_3(self):
# f'(0)=2, f''(0)=3
c1 = BPoly._construct_from_derivatives(0, 1, [1, 2, 3], [4])
assert_allclose(c1, [1., 5./3, 17./6, 4.])
# f'(1)=2, f''(1)=3
c2 = BPoly._construct_from_derivatives(0, 1, [1], [4, 2, 3])
assert_allclose(c2, [1., 19./6, 10./3, 4.])
# f'(0)=2, f'(1)=3
c3 = BPoly._construct_from_derivatives(0, 1, [1, 2], [4, 3])
assert_allclose(c3, [1., 5./3, 3., 4.])
示例3: test_make_poly_12
# 需要导入模块: from scipy.interpolate import BPoly [as 别名]
# 或者: from scipy.interpolate.BPoly import _construct_from_derivatives [as 别名]
def test_make_poly_12(self):
np.random.seed(12345)
ya = np.r_[0, np.random.random(5)]
yb = np.r_[0, np.random.random(5)]
c = BPoly._construct_from_derivatives(0, 1, ya, yb)
pp = BPoly(c[:, None], [0, 1])
for j in range(6):
assert_allclose([pp(0.), pp(1.)], [ya[j], yb[j]])
pp = pp.derivative()
示例4: test_make_poly_1
# 需要导入模块: from scipy.interpolate import BPoly [as 别名]
# 或者: from scipy.interpolate.BPoly import _construct_from_derivatives [as 别名]
def test_make_poly_1(self):
c1 = BPoly._construct_from_derivatives(0, 1, [2], [3])
assert_allclose(c1, [2., 3.])