Numeric Integration VI

Owning Palette: Integration & Differentiation VIs

Requires: Full Development System

Performs numeric integration on the Input Array using one of four popular numeric integration methods. Wire data to the Input Array input to determine the polymorphic instance to use or manually select the instance.

Details  

Use the pull-down menu to select an instance of this VI.

 Add to the block diagram  Find on the palette

1D Numeric Integration

Input Array contains the data to be integrated, which is obtained from sampling an integrand f(t) at multiples of dt, that is, f(0), f(dt), f(2dt),….
dt is the interval size, which represents the sampling step size used in obtaining data in Input Array from the function. If you supply a negative dt, this VI uses its absolute value.
integration method specifies the method to use to perform the numeric integration.

0Trapezoidal Rule (default)
1Simpson's Rule
2Simpson's 3/8 Rule
3Bode Rule
result returns the numeric integral.
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

2D Numeric Integration

Input Array contains the data to be integrated, which is obtained from sampling an integrand f(x, y) at multiples of dx and dy, that is, f(0, 0), f(dx, 0), f(0, dy), f(dx, dy),….
interval size contains the interval sizes dx and dy.
dx is the interval size of the integration variable x. The default is 1.
dy is the interval size of the integration variable y. The default is 1.
integration method specifies the method to use to perform the numeric integration.

0Trapezoidal Rule (default)
1Simpson's Rule
2Simpson's 3/8 Rule
3Bode Rule
result returns the numeric integral.
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

3D Numeric Integration

Input Array contains the data to be integrated, which is obtained from sampling an integrand f(x, y, z) at multiples of dx, dy, and dz, that is, f(0, 0, 0), f(dx, 0, 0), f(0, dy, 0), f(0, 0, dz), f(dx, dy, dz),….
interval size contains the interval sizes dx, dy, and dz.
dx is the interval size of the integration variable x. The default is 1.
dy is the interval size of the integration variable y. The default is 1.
dz is the interval size of the integration variable z. The default is 1.
integration method specifies the method to use to perform the numeric integration.

0Trapezoidal Rule (default)
1Simpson's Rule
2Simpson's 3/8 Rule
3Bode Rule
result returns the numeric integral.
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

Numeric Integration Details

The x values you wire to this VI must be evenly spaced, or result is incorrect. If the values are not evenly spaced, you can use the Uneven Numeric Integration VI to compute the integral.

1D Numeric Integration

Number of PointsPartial Evaluations Performed
22455 Bode, 1 Simpsons' 3/8
22556 Bode
22656 Bode, Trapezoidal
22756 Bode, 1 Simpsons'
22857 Bode, 1 Simpsons' 3/8

If 224 points are provided and the Bode Method is chosen, the VI arrives at the result by performing 55 Bode Method partial evaluations and one Simpsons' 3/8 Method evaluation.

Each of the methods depends on the sampling interval (dt) and computes the integral using successive applications of a basic formula in order to perform partial evaluations, which depend on some number of adjacent points. The number of points used in each partial evaluation represents the order of the method. The result is the summation of these successive partial evaluations.

where j is a range dependent on the number of points and the method of integration.

The following are the basic formulas for the computation of the partial sum of each rule in ascending method order:

where N is the number of data points, k is an integer dependent on the method, and x is the input array.

Note  If the number of points provided for a certain chosen method does not contain an integral number of partial sums, then the method is applied for all possible points. For the remaining points, the next possible lower order method is used. For example, if the Bode method is selected, the previous example shows what this VI evaluates for different numbers of points.

2D Numeric Integration

To perform the 2D numeric integration of

,

this VI first applies 1D numeric integration over x to evaluate

.

Then this VI applies 1D numeric integration over y to obtain the result

3D Numeric Integration

To perform the 3D numeric integration of

,

this VI applies 1D numeric integration over x, y, and z, in sequence, as shown by the following equations: