LU decomposition calculator

Number format
Solution comments
Without description (answer only)

a

b

c

d

x

y

z

clear

i

ab
x2
xn

Randomize

313131313135151515151583137
2
2510
=Solve

  About matrix LU decomposition calculator

This is a free online matrix LU decomposition calculator with complete, detailed, step-by-step description of solutions, that performs operations with matrices up to 99x99 in size with matrix elements of this type: decimal numbers, fractions, complex numbers, variables.

To start the calculation, you need to first enter the size of the matrix in the input field that you can find from the very top of the screen, also there you can choose the desired method of calculation.

A little below you will find a matrix window in which you need to enter matrix elements using the keyboard. The matrix control panel is also located here, which simplifies work with matrices and contains the following control elements:

  • The first element allows you to expand the matrix window. This can be especially useful in cases where you need to perform calculations with very large matrices that do not fit completely. If the matrix is still not visible after expanding the window, you can change the scale of the matrix using the + / - buttons;
  • The second element performs the function of copying the matrix input to the memory buffer. This can be useful in cases where you often use the same matrix for calculations, or if you need to move matrices between operations;
  • And the last element inserts the previously copied matrix, which allows you to speed up the process of entering the matrix to just a few clicks, instead of doing it manually;

And further down you will find a toolbar that allows you to customize the calculator and make it easier to work with it. It is visually divided into three parts, each of which is responsible for the following functionality:

  • The first allows you to select the number format when the solution result is displayed. Also, here you can turn off comments to the solution of the problem if you have already understood how to solve this problem, and you use the calculator to speed up or check your own calculations. Or you can turn off the step-by-step solution entirely if you only need the result of the solution;
  • The second contains buttons that allow you to change the type of the matrix input field, erase its elements or the entire matrix, and the largest button with an equal sign, which will take you to the screen with the solution of the problem. All these buttons are duplicated by keys on the keyboard. To find out which key on the keyboard to press, simply hover over one of the buttons and a tooltip will appear with the name of the key. You can also use the arrow keys on your keyboard to move the cursor between matrix input fields;
  • And the last one allows you to choose the number of digits after the decimal point for rounding non-integer numbers. Also, here you can immediately see an example of how rounded fractions will look;

  What is the LU decomposition of a matrix?

LU decomposition(where LU is lower-upper) is the factorization of a given square matrix into two triangular matrices, one of which is lower triangular and the other upper triangular, and the product of these two matrices gives the original matrix.

  How to perform the LU decomposition of a matrix?

Using Gaussian elimination we can calculate the upper triangular matrix nad during calculation the upper triangular matrix we will use certain coefficients, to convert elements below the main diagonal to zero. The coefficient that we will use to convert a certain element to zero will be the corresponding element of the lower triangular matrix. During calculating the upper triangular matrix we need to mark all these coefficients as elements of the lower triangular matrix, and then these elements will help us to compose the lower triangular matrix.

  Example of LU decomposition of a matrix

Write the initial matrix
A
:
A
=
71
7
2
4
8
8
5
5
5
5
8
5
2
2
7
2
LU
decomposition is a representation of the matrix
A
in the form
A
=
L
*
U
;
Upper triangular matrix (Matrix
U
) is a square matrix in which all elements below the main diagonal are zero;
Using Gaussian elimination we can calculate the matrix
U
;
Lower triangular matrix (Matrix
L
) is a square matrix in which all elements above the main diagonal are zero;
During calculation the matrix
U
we will use certain coefficients, to convert elements below the main diagonal to zero;
The coefficient that we will use to convert a certain element to zero will be the corresponding element of the matrix
L
;
During calculating the matrix
U
, we will mark all these coefficients as elements of the matrix
L
, and then these elements will help us to compose the matrix
L
;

Gaussian Run Forwards

2
Iteration 1
From
2
th row we subtract
1
th row, multiplied by
1
10
;
From
3
th row we subtract
1
th row, multiplied by
3
100
;
From
4
th row we subtract
1
th row, multiplied by
3
50
;
71
0
0
0
8
7
21
100
4
77
100
4
11
20
5
4
51
100
7
43
50
4
18
25
2
1
4
5
6
47
50
1
89
100
To convert element
a
0
2,1
to zero, we used a coefficient
1
10
;
Mark this element as
l
0
2,1
:
l
0
2,1
=
1
10
;
To convert element
a
0
3,1
to zero, we used a coefficient
3
100
;
Mark this element as
l
0
3,1
:
l
0
3,1
=
3
100
;
To convert element
a
0
4,1
to zero, we used a coefficient
3
50
;
Mark this element as
l
0
4,1
:
l
0
4,1
=
3
50
;
3
Iteration 2
From
3
th row we subtract
2
th row, multiplied by
33
50
;
From
4
th row we subtract
2
th row, multiplied by
63
100
;
71
0
0
0
8
7
21
100
0
0
5
4
51
100
4
22
25
1
22
25
2
1
4
5
5
3
4
3
4
To convert element
a
0
3,2
to zero, we used a coefficient
33
50
;
Mark this element as
l
0
3,2
:
l
0
3,2
=
33
50
;
To convert element
a
0
4,2
to zero, we used a coefficient
63
100
;
Mark this element as
l
0
4,2
:
l
0
4,2
=
63
100
;
4
Iteration 3
From
4
th row we subtract
3
th row, multiplied by
19
50
;
71
0
0
0
8
7
21
100
0
0
5
4
51
100
4
22
25
0
2
1
4
5
5
3
4
-1
23
50
To convert element
a
0
4,3
to zero, we used a coefficient
19
50
;
Mark this element as
l
0
4,3
:
l
0
4,3
=
19
50
;
5
Matrix U
U
=
71
0
0
0
8
7
21
100
0
0
5
4
51
100
4
22
25
0
2
1
4
5
5
3
4
-1
23
50
6
Matrix L
Let's write the initial matrix
L
and mark the elements that we need to find as unknown:
L
=
1
×××
0
1
××
0
0
1
×
0
0
0
1
As we see above, all elements marked as unknown, we found at the previous stage;
Now we just need to put them in the right places;
Substituting all the elements we have a completely composed matrix
L
:
L
=
1
1
10
3
100
3
50
0
1
33
50
63
100
0
0
1
19
50
0
0
0
1
Answer
A = L · U
L
=
1
1
10
3
100
3
50
0
1
33
50
63
100
0
0
1
19
50
0
0
0
1
U
=
71
0
0
0
8
7
21
100
0
0
5
4
51
100
4
22
25
0
2
1
4
5
5
3
4
-1
23
50
SIZE4×4

  Sources