naginterfaces.library.quad.dim1_​data

naginterfaces.library.quad.dim1_data(x, y)[source]

dim1_data integrates a function which is specified numerically at four or more points, over the whole of its specified range, using third-order finite difference formulae with error estimates, according to a method due to Gill and Miller (1972).

For full information please refer to the NAG Library document for d01ga

https://support.nag.com/numeric/nl/nagdoc_30/flhtml/d01/d01gaf.html

Parameters
xfloat, array-like, shape

The values of the independent variable, i.e., the .

yfloat, array-like, shape

The values of the dependent variable at the points , for .

Returns
ansfloat

The estimated value of the integral.

erfloat

An estimate of the uncertainty in .

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, and , , and .

Constraint: either or .

(errno )

On entry, , and .

Constraint: .

Notes

dim1_data evaluates the definite integral

where the function is specified at the -points , which should be all distinct, and in either ascending or descending order. The integral between successive points is calculated by a four-point finite difference formula centred on the interval concerned, except in the case of the first and last intervals, where four-point forward and backward difference formulae respectively are employed. If is less than , the function fails. An approximation to the truncation error is integrated and added to the result. It is also returned separately to give an estimate of the uncertainty in the result. The method is due to Gill and Miller (1972).

References

Gill, P E and Miller, G F, 1972, An algorithm for the integration of unequally spaced data, Comput. J. (15), 80–83