>>> help(scipy.integrate.simps)
Help on function simps in module scipy.integrate.quadrature:
simps(y, x=None, dx=1, axis=-1, even='avg')
Integrate y(x) using samples along the given axis and the composite
Simpson's rule. If x is None, spacing of dx is assumed.
If there are an even number of samples, N, then there are an odd
number of intervals (N-1), but Simpson's rule requires an even number
of intervals. The parameter 'even' controls how this is handled.
2条答案
按热度按时间7cwmlq891#
这取决于问题的陈述。一个粗鲁的方法是这样的
wvyml7n52#
你可以使用“辛普森法则”。可以为您执行此操作的例程是
scipy.integrate
中的simps
。如果要积分的数据之间没有规则的间隔,则应选择与scipy.integrate
不同的方法,例如梯形规则trapz
。