trapezoid(function,
interval,
numtraps)
|
|
Numerical integration using the trapezoidal
rule
Example:
>>>from Scientific.Functions.Romberg import trapezoid
>>>from Scientific.N import pi, tan
>>>trapezoid(tan, (0.0, pi/3.0), 100)
yields 0.69317459482518262
- Parameters:
function (callable) - a function of one variable
interval (sequence of two float s) - the lower and upper limit of the integration interval
numtraps (int ) - the number of trapezoids
- Returns: number
- the numerical integral of the function over the interval
|