SciPy 0.6.0 API Documentation Generated by Endo, 2007-10-17
Cumulatively integrate y(x) using samples along the given axis and the composite trapezoidal rule. If x is None, spacing given by dx is assumed.
See also:
quad - adaptive quadrature using QUADPACK romberg - adaptive Romberg quadrature quadrature - adaptive Gaussian quadrature fixed_quad - fixed-order Gaussian quadrature dblquad, tplquad - double and triple integrals romb, trapz - integrators for sampled data cumtrapz - cumulative integration for sampled data ode, odeint - ODE integrators
Compute a definite integral using fixed-order Gaussian quadrature.
Description:
Integrate func from a to b using Gaussian quadrature of order n.
Inputs:
func -- a Python function or method to integrate
(must accept vector inputs)
a -- lower limit of integration
b -- upper limit of integration
args -- extra arguments to pass to function.
n -- order of quadrature integration.
Outputs: (val, None)
val -- Gaussian quadrature approximation to the integral.
See also:
quad - adaptive quadrature using QUADPACK
dblquad, tplquad - double and triple integrals
romberg - adaptive Romberg quadrature
quadrature - adaptive Gaussian quadrature
romb, simps, trapz - integrators for sampled data
cumtrapz - cumulative integration for sampled data
ode, odeint - ODE integrators
Return weights and error coefficient for Netwon-Cotes integration.
Suppose we have (N+1) samples of f at the positions
x_0, x_1, ..., x_N. Then an N-point Newton-Cotes formula for the
integral between x_0 and x_N is:
$\int_{x_0}^{x_N} f(x)dx = \Delta x \sum_{i=0}^{N} a_i f(x_i)
+ B_N (\Delta x)^{N+2} f^{N+1} (\xi)$
where $\xi \in [x_0,x_N]$ and $\Delta x = \frac{x_N-x_0}{N}$ is the
averages samples spacing.
If the samples are equally-spaced and N is even, then the error
term is $B_N (\Delta x)^{N+3} f^{N+2}(\xi)$.
Normally, the Newton-Cotes rules are used on smaller integration
regions and a composite rule is used to return the total integral.
Inputs:
rn -- the integer order for equally-spaced data
or the relative positions of the samples with
the first sample at 0 and the last at N, where
N+1 is the length of rn. N is the order of the Newt
equal -- Set to 1 to enforce equally spaced data
Outputs:
an -- 1-d array of weights to apply to the function at
the provided sample positions.
B -- error coefficient
Compute a definite integral using fixed-tolerance Gaussian quadrature.
Description:
Integrate func from a to b using Gaussian quadrature
with absolute tolerance tol.
Inputs:
func -- a Python function or method to integrate.
a -- lower limit of integration.
b -- upper limit of integration.
args -- extra arguments to pass to function.
tol -- iteration stops when error between last two iterates is less than
tolerance.
maxiter -- maximum number of iterations.
vec_func -- True or False if func handles arrays as arguments (is
a "vector" function ). Default is True.
Outputs: (val, err)
val -- Gaussian quadrature approximation (within tolerance) to integral.
err -- Difference between last two estimates of the integral.
See also:
romberg - adaptive Romberg quadrature
fixed_quad - fixed-order Gaussian quadrature
quad - adaptive quadrature using QUADPACK
dblquad, tplquad - double and triple integrals
romb, simps, trapz - integrators for sampled data
cumtrapz - cumulative integration for sampled data
ode, odeint - ODE integrators
Romberg integration using samples of a function
Inputs:
y - a vector of 2**k + 1 equally-spaced samples of a fucntion
dx - the sample spacing.
axis - the axis along which to integrate
show - When y is a single 1-d array, then if this argument is True
print the table showing Richardson extrapolation from the
samples.
Output: ret
ret - The integrated result for each axis.
See also:
quad - adaptive quadrature using QUADPACK
romberg - adaptive Romberg quadrature
quadrature - adaptive Gaussian quadrature
fixed_quad - fixed-order Gaussian quadrature
dblquad, tplquad - double and triple integrals
simps, trapz - integrators for sampled data
cumtrapz - cumulative integration for sampled data
ode, odeint - ODE integrators
Romberg integration of a callable function or method. Returns the integral of |function| (a function of one variable) over |interval| (a sequence of length two containing the lower and upper limit of the integration interval), calculated using Romberg integration up to the specified |accuracy|. If |show| is 1, the triangular array of the intermediate results will be printed. If |vec_func| is True (default is False), then |function| is assumed to support vector arguments. See also: quad - adaptive quadrature using QUADPACK quadrature - adaptive Gaussian quadrature fixed_quad - fixed-order Gaussian quadrature dblquad, tplquad - double and triple integrals romb, simps, trapz - integrators for sampled data cumtrapz - cumulative integration for sampled data ode, odeint - ODE integrators
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 as follows:
See also:
quad - adaptive quadrature using QUADPACK romberg - adaptive Romberg quadrature quadrature - adaptive Gaussian quadrature fixed_quad - fixed-order Gaussian quadrature dblquad, tplquad - double and triple integrals romb, trapz - integrators for sampled data cumtrapz - cumulative integration for sampled data ode, odeint - ODE integrators
| Local name | Refers to |
|---|---|
| add | numpy.add |
| arange | numpy.arange |
| asarray | numpy.asarray |
| diff | numpy.diff |
| empty | numpy.empty |
| gammaln | scipy.special.gammaln |
| isinf | numpy.isinf |
| isscalar | numpy.isscalar |
| np | numpy |
| ones | numpy.ones |
| p_roots | scipy.special.orthogonal.p_roots |
| real | numpy.real |
| sp | scipy |
| sum | numpy.sum |
| trapz | numpy.trapz |