Example Code

Tridiagonal matrix algorithm for 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

1. Overview

This example VI uses the Thomas algorithm for Gaussian elimination of a tridiagonal matrix. It outputs a solution vector from one input known vector.

 

2. Description

A tridiagonal matrix is a band matrix that has nonzero elements only on the main diagonal, the first diagonal below this, and the first diagonal above the main diagonal. In numerical linear algebra, the tridiagonal matrix algorithm, also known as the Thomas algorithm (named after Llewellyn Thomas), is a simplified form of Gaussian elimination that can be used to solve tridiagonal systems of equations.

Tridiagonal matrices are important in the numerical solution of partial differential equations. Rather than using a general linear solver, a specialized algorithm can be implemented for improved performance.

 

3. Requirements

  • NI LabVIEW Base Development System 2012 or compatible.

 

4. Steps to Implement or Execute Code

  1. Download and open the example VI.
  2. Write an Input Array and a Known Vector.
  3. Run the VI.

 

5. Additional Information or References

 

Tridiagonal matrix algorithm Screenshot.PNG

 

**The code for this example has been edited to meet the new Community Example Style Guidelines.**

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