The INT_TABULATED function integrates a tabulated set of data { xi , fi } on the closed interval [MIN(x) , MAX(x)], using a five-point Newton-Cotes integration formula.
| Warning |
This routine is written in the IDL language. Its source code can be found in the file int_tabulated.pro in the lib subdirectory of the IDL distribution.
Result = INT_TABULATED( X, F [, /DOUBLE] [, /SORT] )
Returns the area under the curve represented by the function.
The tabulated single- or double-precision floating-point x-value data. Data may be irregularly gridded and in random order. (If the data is randomly ordered, set the SORT keyword.)
| Warning |
The tabulated single- or double-precision floating-point f-value data. Upon input to the function, xi and fi must have corresponding indices for all values of i. If x is reordered, f is also reordered.
Set this keyword to force the computation to be done in double-precision arithmetic.
Set this keyword to sort the tabulated x-value data into ascending order. If SORT is set, both x and f values are sorted.
Define 11 x-values on the closed interval [0.0 , 0.8]:
X = [0.0, .12, .22, .32, .36, .40, .44, .54, .64, .70, .80]
Define 11 f-values corresponding to xi:
F = [0.200000, 1.30973, 1.30524, 1.74339, 2.07490, 2.45600, $ 2.84299, 3.50730, 3.18194, 2.36302, 0.231964] result = INT_TABULATED(X, F)
In this example, the f-values are generated from a known function
f = 0.2 + 25x- 200x2 + 675x3 - 900x4 + 400x5
which allows the determination of an exact solution. A comparison of methods yields the following results:
The exact solution (4 decimal accuracy) is: 1.6405
Introduced: Pre 4.0
INT_2D, INT_3D, QROMB, QROMO, QSIMP