Engee documentation

LU Solver

Solving a system of linear equations with a square matrix of coefficients using LU decomposition.

LU Solver

Description

The LU Solver block solves a system of linear equations using LU decomposition:

  • - input signal at port A as a square matrix of coefficients to .

  • - input signal on port B as a matrix to .

  • - solution of the system of equations as a matrix to .

Ports

Input

A - input square matrix A
`matrix M by M

The input square matrix in equation is of size by . The input ports A and B must have the same number of rows.

Data types: Float32, Float64.

Support for complex numbers: No

B - input matrix B
matrix M on N | vector M on 1

The matrix in equation is of size by or a vector of size by 1.

If a vector of length is given, the block treats it as a matrix by 1. Inputs A and B must have the same number of rows.

Data types: Float32, Float64.

Support for complex numbers: No

Output

X is a solution to the system of equations
matrix M on N | vector M on 1

The block finds the solution of the equations as a matrix of size by or a vector of size by 1. The size of the matrix is the same as the size of the matrix .

Data types: Float32, Float64.

Support for complex numbers: No

Algorithms

The LU-decomposition algorithm computes a variant of the square input matrix with rearranged rows as:

,

where

  • - is the matrix with rearranged rows, the order of permutations is determined by the permutation vector ;

  • - is the lower triangular matrix with unit diagonal elements (unitriangular matrix);

  • - upper triangular matrix.

If we replace the matrix multipliers in the original equation with , we obtain

,

where is a variant of the matrix with rearranged rows.

The resulting equation will have the form:

.

By replacing by two systems of equations with triangular matrices are obtained:

,

.

Additional options

C code generation: Yes