Simple Matrix Calculator

This will take a matrix, of size up to 5x6, to reduced row echelon form by Gaussian elimination. Each elementary row operation will be printed. Given a matrix smaller than 5x6, place it in the upper lefthand corner and leave the extra rows and columns blank. Some sample values have been included. Press "Clear" to get rid of them.

Matrix

A is a 2x2 matrix and B is 2x1 matrix. This calculator will attempt to find AB and solve AX=B by calculating A-1B, when possible. Otherwise it will report whether it is consistent. It also gives det, rank and eigenvalues.

Matrix A
Matrix B

A few comments about what's going behind the scenes: The Gaussian elimination uses the same algorithm that you would use by hand: work left to right, and do elementary row operations to get each column to have the right shape. This puts the matrix in echelon form. Then go back and eliminate extra entries to get it into reduced form.
For the second part, the inverse is computed by the standard formula using determinants
A-1 = (1/det(A))adjoint(A)
This works great in our (2x2) case, although it is not feasable for larger matrices. The consistency test is based on idea that for AX=B to be solvable, we need B to be in the column space of A. So it suffices to check that the dimension of Col(A) = Col(A|B). That is that the ranks of A and (A|B) are the same. The ranks are computed using minors. The eigenvalues are gotten by solving the characteristic equation
det(tI-A) = t2 -trace(A)t+det(A) =0
Since it's quadratic, it's easy to do this explicitly.

This essentially a "demo" which I put together for teaching purposes. It should be fine for simple examples but it can occasionally give wrong answers due to round off errors. It will usually try to warn you when such errors are likely. There is plenty of serious matrix crunching software out there. Some of it free (octave or scilab) and some not ( matlab ).

- Donu Arapura