# Integral x(t) (G Dataflow)

Version:

Performs the discrete integration of the sampled signal.

## x(t)

Sampled signal from time 0 to n-1, where n is the number of elements in the sampled signal.

## 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: Simpson's Rule

## initial condition

Initial condition of the sampled signal in the integration calculation.

This node uses the first element of the initial condition to calculate the integration if the integration method is the Trapezoidal Rule or Simpson's Rule. This node uses the first two elements in the initial condition to calculate the integration if the integration method is the Simpson's 3/8 Rule or Bode Rule.

## final condition

Final condition of the sampled signal in the integration calculation.

This node ignores the final condition if the integration method is Trapezoidal Rule. This node uses the first element in the final condition to calculate the integration if the integration method is the Simpson's Rule or Simpson's 3/8 Rule. This node uses the first two elements to calculate the integration if the integration method is Bode 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

## dt

Sampling interval.

Default: 1

## integral x(t)

Discrete integration of the sampled signal.

## error out

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

## Algorithm for Calculating the Integral

Integral x(t) calculates a definite integral. The value of the output array at any value x is the area under the curve of the input array between 0 and x.

The integral F(t) of a function f(t) is defined by the following equation.

$F\left(t\right)=\int f\left(t\right)\text{dt}$

Let y represent the sampled output sequence integral x(t).

If integration method is Trapezoidal Rule, this node obtains the elements of y using the following equation:

${y}_{i}=\frac{dt}{2}\underset{j=0}{\overset{i}{\sum }}\left({x}_{j-1}+{x}_{j}\right)$

for i = 0, 1, 2, ..., n - 1,

where n is the number of samples in x(t) and x-1 is the first element in initial condition.

If integration method is Simpson's Rule, this obtains the elements of y using the following equation:

${y}_{i}=\frac{dt}{6}\underset{j=0}{\overset{i}{\sum }}\left({x}_{j-1}+4{x}_{j}+{x}_{j+1}\right)$

for i = 0, 1, 2, ..., n - 1

where

• n is the number of samples in x(t)
• x-1 is the first element in initial condition
• xn is the first element in final condition

If integration method is Simpson's 3/8 Rule, this node obtains the elements of y using the following equation:

${y}_{i}=\frac{dt}{8}\underset{j=0}{\overset{i}{\sum }}\left({x}_{j-2}+3{x}_{j-1}+3{x}_{j}+{x}_{j+1}\right)$

for i = 0, 1, 2, ..., n - 1

where

• n is the number of samples in x(t)
• x-2 and x-1 are the first and second elements in initial condition
• xn is the first element in final condition

If integration method is Bode Rule, this node obtains the elements of y using the following equation:

${y}_{i}=\frac{dt}{90}\underset{j=0}{\overset{i}{\sum }}\left(7{x}_{j-2}+32{x}_{j-1}+12{x}_{j}+32{x}_{j+1}+7{x}_{j+2}\right)$

for i = 0, 1, 2, ..., n - 1,

where

• n is the number of samples in x(t)
• x-2 and x-1 are the first and second elements in initial condition
• xn and xn+1 are the first and second elements in final condition

The initial condition and final condition minimize the overall error by increasing the accuracy at the boundaries, especially when the number of samples is small. Determining boundary conditions before the fact enhances accuracy.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported