Matrix Factorisation Calculator: LU with Pivoting, Cholesky, QR and Singular Value Decomposition (3x3)

Split a matrix into simpler structured pieces.

Calculated from standard textbook formulas, with every step shown. The formulas are fixed, so the working does not need checking: what matters is the numbers you type in. Use these calculators only if you are competent to choose the inputs (loads, material strength, dimensions, supports) and check your units and assumptions. For learning and checking your own working: design and sign-off are for a qualified engineer. Drafting Central does not store the numbers you type.

How this calculator works

Enter the nine numbers of the matrix.

The calculator gives the LU factorisation with row pivoting, the Cholesky factor if the matrix is symmetric and positive definite, the QR factorisation by Gram-Schmidt and the SVD with the singular values, rank and condition number.

Each factorisation is checked by multiplying the factors back and showing the largest difference.

Formulas used

  • PA = LU
  • A = LL^T
  • A = QR,\ \ Q^TQ = I
  • A = U\Sigma V^T

Worked example

With the default numbers in the calculator above:

  1. The matrix: [4.0000, 12.0000, -16.0000; 12.0000, 37.0000, -43.0000; -16.0000, -43.0000, 98.0000]
  2. LU with row pivoting: the permutation matrix P: [0.0000, 0.0000, 1.0000; 0.0000, 1.0000, 0.0000; 1.0000, 0.0000, 0.0000]
  3. Unit lower triangular matrix L: [1.0000, 0.0000, 0.0000; -0.7500, 1.0000, 0.0000; -0.2500, 0.2632, 1.0000]
  4. Upper triangular matrix U: [-16.0000, -43.0000, 98.0000; 0.0000, 4.7500, 30.5000; 0.0000, 0.0000, 0.4737]
  5. Check: the largest difference between PA and LU: 1.7764e-15
  6. Cholesky factorisation: the lower triangular matrix L, with A = L times L transpose: [2.0000, 0.0000, 0.0000; 6.0000, 1.0000, 0.0000; -8.0000, 5.0000, 3.0000]
  7. Check: the largest difference between A and L L transpose: 0
  8. QR factorisation: the orthogonal matrix Q (Gram-Schmidt): [0.1961, 0.1695, 0.9658; 0.5883, 0.7676, -0.2542; -0.7845, 0.6181, 0.0508]
  9. QR factorisation: the upper triangular matrix R: [20.3961, 57.8543, -105.3144; 0.0000, 3.8581, 24.8531; 0.0000, 0.0000, 0.4575]
  10. Check: the largest difference between A and QR, and between Q transpose Q and the identity: 0 and 6.5878e-14
  11. Singular values (the square roots of the eigenvalues of A transpose A), largest first: 123.48, 15.50, 0.0188
  12. Rank (the number of non-zero singular values), and the condition number: 3; condition number 6566.20

Change the numbers in the calculator to see the full working, every step, for your own case.

Common questions

When can I use Cholesky?

Only when the matrix is symmetric and positive definite, such as a stiffness matrix. It is about twice as fast as LU.

What is QR used for?

Least squares fitting and finding eigenvalues. The orthogonal factor Q keeps the arithmetic stable.

What does the SVD show?

The rank of the matrix, how sensitive it is (the condition number, the largest singular value over the smallest) and the best low-rank approximation.

Why does LU need pivoting?

To avoid dividing by a small or zero number. The permutation matrix P records the row swaps.

Related calculators

Got a question about this? Ask an engineering question and get a plain-language answer with references.

Further reading: Golub and Van Loan, Matrix Computations; Strang, Linear Algebra and Its Applications.

Need a calculator we do not have?

Tell us what you would like to calculate. We read every request and build the most asked-for ones.

We store your request (and your email if you give it) to decide what to build. We do not store the numbers you type into calculators.

Embed this calculator on your own page

Copy this code into your page. The calculator runs inside the frame and links back to Drafting Central.

Need this drawn, designed or checked?

Drafting Central is a mechanical engineering and drafting business working with customers across Australia and around the world. A calculator gives you the numbers; we can turn them into drawings and designs.

Need help with a real project?

Talk to Drafting Central →

← All engineering calculators