Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

INT_TABULATED


Syntax | Return Value | Arguments | Keywords | Examples | Version History | See Also

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
Data that is highly oscillatory requires a sufficient number of samples for an accurate integral approximation.

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.

Syntax

Result = INT_TABULATED( X, F [, /DOUBLE] [, /SORT] )

Return Value

Returns the area under the curve represented by the function.

Arguments

X

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
Each X value must be unique; if duplicate X values are detected, the routine will exit and display a warning message.

F

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.

Keywords

DOUBLE

Set this keyword to force the computation to be done in double-precision arithmetic.

SORT

Set this keyword to sort the tabulated x-value data into ascending order. If SORT is set, both x and f values are sorted.

Examples

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

Version History

Introduced: Pre 4.0

See Also

INT_2D, INT_3D, QROMB, QROMO, QSIMP


Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]