# Numeric Integration (G Dataflow)

Version:

Performs numeric integration on the input data using a specific numeric integration method.

The data values you wire to this node must be evenly spaced. If the data values are not evenly spaced, use the Uneven Numeric Integration node to compute the integral.

## f(x)

Data to integrate.

This input accepts the following data types:

• 1D array of double-precision, floating-point numbers
• 2D array of double-precision, floating-point numbers
• 3D array of double-precision, floating-point numbers

This input changes to f(x,y) when the data type is a 2D array of double-precision, floating-point numbers.

This input changes to f(x,y,z) when the data type is a 3D array of double-precision, floating-point numbers.

## f(x,y)

Data to integrate.

This input accepts the following data types:

• 1D array of double-precision, floating-point numbers
• 2D array of double-precision, floating-point numbers
• 3D array of double-precision, floating-point numbers

This input changes to f(x) when the data type is a 1D array of double-precision, floating-point numbers.

This input changes to f(x,y,z) when the data type is a 3D array of double-precision, floating-point numbers.

## f(x,y,z)

Data to integrate.

This input accepts the following data types:

• 1D array of double-precision, floating-point numbers
• 2D array of double-precision, floating-point numbers
• 3D array of double-precision, floating-point numbers

This input changes to f(x) when the data type is a 1D array of double-precision, floating-point numbers.

This input changes to f(x,y) when the data type is a 2D array of double-precision, floating-point numbers.

## integration method

Method to use to perform the numeric integration.

Name Value Description
Trapezoidal Rule 0 Uses the trapezoidal rule.
Simpson's Rule 1 Uses the Simpson's rule.
Simpson's 3/8 Rule 2 Uses the Simpson's 3/8 rule.
Bode Rule 3 Uses the Bode rule.

Default: Trapezoidal Rule

## error in

Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

Default: No error

## dx

Interval size, which represents the sampling step size used in obtaining the input data from the function.

If the interval size is negative, this node uses its absolute value.

This input is available only if you wire a 1D array of double-precision floating-point numbers to f(x).

Default: 1

## interval size

Interval size of the integration variables.

This input is available only if you wire a 2D array of double-precision, floating-point numbers to f(x,y) or a 3D array of double-precision, floating-point numbers to f(x,y,z).

### dx

Interval size of the integration variable x.

Default: 1

### dy

Interval size of the integration variable y.

Default: 1

### dz

Interval size of the integration variable z.

This input is available only if you wire a 3D array of double-precision, floating-point numbers to f(x,y,z).

Default: 1

## integral

Numeric integral.

## error out

Error information. The node produces this output according to standard error behavior.

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 following example shows what this node evaluates for different numbers of points.

Number of Points Partial Evaluations Performed
224 55 Bode, 1 Simpson's 3/8
225 56 Bode
226 56 Bode, Trapezoidal
227 56 Bode, 1 Simpson's
228 56 Bode, 1 Simpson's 3/8

The previous table describes the number of data points and the partial evaluations performed by the integration method.

If 224 points are provided and the Bode method is chosen, the node arrives at the result by performing 55 Bode method partial evaluations and one Simpson's 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.

$\text{output integral}={\int }_{{t}_{0}}^{{t}_{1}}f\left(t\right)\text{dt}=\underset{i}{\sum }\text{partial sums}$

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:

• Trapezoidal: 1/2(x[i] + x[i + 1]) * dt
• Simpson's: (x[2i] + 4x[2i + 1] + x[2i + 2]) * dt/3, k= 2
• Simpsons' 3/8: (3x[3i] + 9x[3i + 1] + 9x[3i + 2] + 3x[3i + 3]) * dt/8, k = 3
• Bode: (14x[4i] + 64x[4i + 1] + 24x[4i + 2] + 64x[4i + 3] + 14x[4i + 4]) * dt/45, k = 4 for i = 0, 1, 2, 3, 4, ..., Integral Part of [(N - 1)/k]

where

• N is the number of data points
• k is an integer dependent on the method
• x is the input array

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported