LU Solver
Solving a system of linear equations with a square matrix of coefficients using LU decomposition.
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
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:
,
.