1D Numeric Integration VI

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.


icon

Inputs/Outputs

  • c1ddbl.png Input Array

    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),….

  • cdbl.png dt

    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.

  • ci32.png integration method

    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
  • idbl.png result

    result returns the numeric integral.

  • ii32.png error

    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.

  • 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:

    • Trapezoidal: 1/2(x[i] + x[i + 1])*dt
    • Simpsons': (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, 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.