bundles / scipy 1.17.1 / scipy / integrate / _quadrature / romb
function
scipy.integrate._quadrature:romb
Signature
def romb ( y , dx = 1.0 , axis = -1 , show = False ) Summary
Romberg integration using samples of a function.
Parameters
y: array_likeA vector of
2**k + 1equally-spaced samples of a function.dx: float, optionalThe sample spacing. Default is 1.
axis: int, optionalThe axis along which to integrate. Default is -1 (last axis).
show: bool, optionalWhen
yis a single 1-D array, then if this argument is True print the table showing Richardson extrapolation from the samples. Default is False.
Returns
romb: ndarrayThe integrated result for
axis.
Notes
Array API Standard Support
romb has experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variable SCIPY_ARRAY_API=1 and providing CuPy, PyTorch, JAX, or Dask arrays as array arguments. The following combinations of backend and device (or other capability) are supported.
==================== ==================== ==================== Library CPU GPU ==================== ==================== ==================== NumPy ✅ n/a CuPy n/a ✅ PyTorch ✅ ✅ JAX ✅ ✅ Dask ✅ n/a ==================== ==================== ====================
See
dev-arrayapifor more information.
Examples
from scipy import integrate import numpy as np x = np.arange(10, 14.25, 0.25) y = np.arange(3, 12)✓
integrate.romb(y)
✗y = np.sin(np.power(x, 2.5))
✓integrate.romb(y)
✗integrate.romb(y, show=True)
✗integrate.romb([[1, 2, 3], [4, 5, 6]], show=True)
✓See also
- cumulative_trapezoid
cumulative integration for sampled data
- dblquad
double integrals
- fixed_quad
fixed-order Gaussian quadrature
- quad
adaptive quadrature using QUADPACK
- simpson
integrators for sampled data
- tplquad
triple integrals
Aliases
-
scipy.integrate.romb