scipy 1.8.0 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
dblquad(func, a, b, gfun, hfun, args=(), epsabs=1.49e-08, epsrel=1.49e-08)

Return the double (definite) integral of func(y, x) from x = a..b and y = gfun(x)..hfun(x) .

Parameters

func : callable

A Python function or method of at least two variables: y must be the first argument and x the second argument.

a, b : float

The limits of integration in x: a < b

gfun : callable or float

The lower boundary curve in y which is a function taking a single floating point argument (x) and returning a floating point result or a float indicating a constant boundary curve.

hfun : callable or float

The upper boundary curve in y (same requirements as :None:None:`gfun`).

args : sequence, optional

Extra arguments to pass to :None:None:`func`.

epsabs : float, optional

Absolute tolerance passed directly to the inner 1-D quadrature integration. Default is 1.49e-8. :None:None:`dblquad'` tries to obtain an accuracy of abs(i-result) <= max(epsabs, epsrel*abs(i)) where i = inner integral of func(y, x) from gfun(x) to hfun(x) , and result is the numerical approximation. See :None:None:`epsrel` below.

epsrel : float, optional

Relative tolerance of the inner 1-D integrals. Default is 1.49e-8. If epsabs <= 0 , :None:None:`epsrel` must be greater than both 5e-29 and 50 * (machine epsilon) . See :None:None:`epsabs` above.

Returns

y : float

The resultant integral.

abserr : float

An estimate of the error.

Compute a double integral.

See Also

fixed_quad

fixed-order Gaussian quadrature

nquad

N-dimensional integrals

ode

ODE integrator

odeint

ODE integrator

quad

single integral

quadrature

adaptive Gaussian quadrature

romb

integrator for sampled data

scipy.special

for coefficients and roots of orthogonal polynomials

simpson

integrator for sampled data

tplquad

triple integral

Examples

Compute the double integral of x * y**2 over the box x ranging from 0 to 2 and y ranging from 0 to 1.

>>> from scipy import integrate
... f = lambda y, x: x*y**2
... integrate.dblquad(f, 0, 2, lambda x: 0, lambda x: 1) (0.6666666666666667, 7.401486830834377e-15)
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.integrate._quadrature.simpson scipy.integrate._quadpack_py.dblquad scipy.integrate._quadrature.quadrature scipy.integrate._quadrature.romb scipy.integrate._quadrature.fixed_quad scipy.integrate._quadrature.cumulative_trapezoid scipy.integrate._quadpack_py.quad scipy.integrate._quadpack_py.nquad scipy.integrate._quadrature.romberg scipy.integrate._quadpack_py.tplquad

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/integrate/_quadpack_py.py#530
type: <class 'function'>
Commit: