当前位置: 首页>>代码示例>>Python>>正文


Python KroghInterpolator.derivative方法代码示例

本文整理汇总了Python中scipy.interpolate.KroghInterpolator.derivative方法的典型用法代码示例。如果您正苦于以下问题:Python KroghInterpolator.derivative方法的具体用法?Python KroghInterpolator.derivative怎么用?Python KroghInterpolator.derivative使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在scipy.interpolate.KroghInterpolator的用法示例。


在下文中一共展示了KroghInterpolator.derivative方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_wrapper

# 需要导入模块: from scipy.interpolate import KroghInterpolator [as 别名]
# 或者: from scipy.interpolate.KroghInterpolator import derivative [as 别名]
 def test_wrapper(self):
     P = KroghInterpolator(self.xs, self.ys)
     assert_almost_equal(P(self.test_xs), krogh_interpolate(self.xs, self.ys, self.test_xs))
     assert_almost_equal(P.derivative(self.test_xs, 2), krogh_interpolate(self.xs, self.ys, self.test_xs, der=2))
     assert_almost_equal(
         P.derivatives(self.test_xs, 2), krogh_interpolate(self.xs, self.ys, self.test_xs, der=[0, 1])
     )
开发者ID:BioSoundSystems,项目名称:scipy,代码行数:9,代码来源:test_polyint.py

示例2: test_int_inputs

# 需要导入模块: from scipy.interpolate import KroghInterpolator [as 别名]
# 或者: from scipy.interpolate.KroghInterpolator import derivative [as 别名]
    def test_int_inputs(self):
        # Check input args are cast correctly to floats, gh-3669
        x = [0, 234,468,702,936,1170,1404,2340,3744,6084,8424,13104,60000]
        offset_cdf = np.array([-0.95, -0.86114777, -0.8147762, -0.64072425, -0.48002351,
                               -0.34925329, -0.26503107, -0.13148093, -0.12988833, -0.12979296,
                               -0.12973574, -0.08582937, 0.05])
        f = KroghInterpolator(x, offset_cdf)

        assert_allclose(abs((f(x) - offset_cdf) / f.derivative(x, 1)), 0, atol=1e-10)
开发者ID:BiosPsucheZoe,项目名称:scipy,代码行数:11,代码来源:test_polyint.py

示例3: test_high_derivative

# 需要导入模块: from scipy.interpolate import KroghInterpolator [as 别名]
# 或者: from scipy.interpolate.KroghInterpolator import derivative [as 别名]
 def test_high_derivative(self):
     P = KroghInterpolator(self.xs,self.ys)
     for i in xrange(len(self.xs),2*len(self.xs)):
         assert_almost_equal(P.derivative(self.test_xs,i),
                             np.zeros(len(self.test_xs)))
开发者ID:hitej,项目名称:meta-core,代码行数:7,代码来源:test_polyint.py

示例4: test_derivative

# 需要导入模块: from scipy.interpolate import KroghInterpolator [as 别名]
# 或者: from scipy.interpolate.KroghInterpolator import derivative [as 别名]
 def test_derivative(self):
     P = KroghInterpolator(self.xs,self.ys)
     m = 10
     r = P.derivatives(self.test_xs,m)
     for i in xrange(m):
         assert_almost_equal(P.derivative(self.test_xs,i),r[i])
开发者ID:hitej,项目名称:meta-core,代码行数:8,代码来源:test_polyint.py


注:本文中的scipy.interpolate.KroghInterpolator.derivative方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。