Example Code

Selection of Numerical Integration Methods Using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
This example demonstrates some methods for numerical integration.

The methods explored were the Rectangle rule, the Trapezoidal rule and Simpson's Rule. These three methods were incorporated to a numerical integration polymorphic VI which also the user to select which method to use.

 
Description
There are a number of methods for numerical integration; however the methods selected here are relatively straight forward which can be used in a variety of applications involving, for example, encoders. In the use case of encoders, by measuring the instanteous flow rate, speed, etc. we can determine the total volume or total distance which the encoder has measured.

When it comes to the use of numerical integration methods for engineering or scientific applications, it is important to understand the limitations of the method selected in terms of accuracy that you can expect. Comparitvely, Simpsons Rule would be the most accurate from the 3 selections presented here.

In addition to these numerical methods, this code demonstrates the implementation of Polymorphic VIs.

 
Requirements

  • LabVIEW 2013 (or compatible)


Steps to Implement or Execute Code

  1. Download Project Zip and Extract
  2. Open Project and Launch Meta Data.vi
  3. Set the time duration for which you want to run the test
  4. Run the VI
  5. Compare the results

Additional Information or References

 Front Panel

FP.png

VI Snippet of Block Diagram

 BD.png

 

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.