Elecmetric

Matrix Calculator

Find the determinant, trace and inverse of a 2 × 2 or 3 × 3 matrix, with a check that the matrix times its inverse gives the identity.

Matrix size 2 × 2, row 1, column 1 4, row 1, column 2 7, row 2, column 1 2 gives
Determinant: 10 · Trace: 10 · Inverse, row 1 column 1: 0.6

Estimate only. Not engineering or safety advice. Check the result against the applicable standard and the equipment data, and have a competent engineer review it before it is relied on. Terms of use.

Open in the calculator with these values

About this calculator

This page calculates determinant, trace, inverse, row 1 column 1 and 9 more results from matrix size, row 1, column 1, row 1, column 2, row 1, column 3 and 6 more inputs. Change any value or its unit and the result updates. The steps below show the working for the default values, so you can check each line against your own method.

Limits of this calculator

Use this to invert the impedance or admittance matrix of a small network, to check a hand-calculated determinant, or to solve mesh equations written in matrix form. To solve A x = k for the unknowns directly, use the simultaneous equations solver. Always check the inverse against the original matrix.

Cross-check: 36 reference cases, calculated from textbook formulas coded separately from the engine by the same author, agree with this calculator. This is not an independent review.

Verification status: Engineering reference

Engineering reference. Formula and method documented and tested against separately coded reference calculations. Not yet Verified: the evidence listed on this page is still needed.

What this calculator checks

What remains unverified

Verification register entry

Calculation authorRahul Sharma (author)
Technical reviewNo independent technical review has been carried out
Individual professional approvalNot recorded
Formula referencenot recorded
Standard and editionNot applicable: Pure mathematics or statistics; no electrical standard governs the method
Standard review stateNot applicable
Scope-screening notenot recorded
Cross-check test cases36 reference vectors (tests/reference_vectors.json)
Review datenot recorded
Next review datenot recorded
StatusEngineering reference

Needed before this calculator can be marked Verified: reviewer name, qualification and review date; exact formula reference; formula source (textbook or standard); next review date.

Formula

For a 2 × 2 matrix [a b; c d]: det = ad − bc and the inverse is [d −b; −c a] / det For 3 × 3, det is the cofactor expansion along row 1 and the inverse is the adjugate divided by det trace = sum of the diagonal det = 0: no inverse

Worked example

InputValue
Matrix size2 × 2
Row 1, column 14
Row 1, column 27
Row 2, column 12
Row 2, column 26
  1. Matrix, row by row: 4 7 | 2 6
  2. det = ad − bc = 4 × 6 − 7 × 2 = 10
  3. Trace = 10
  4. Inverse, row by row: 0.6 -0.7 | -0.2 0.4
  5. Check: the largest difference between A × A⁻¹ and the identity is 2.220e-16

Assumptions

Use this to invert the impedance or admittance matrix of a small network, to check a hand-calculated determinant, or to solve mesh equations written in matrix form. To solve A x = k for the unknowns directly, use the simultaneous equations solver. Always check the inverse against the original matrix.

Inputs and results

InputUnitAllowed or shownNote
Matrix size(choice)2 × 2; 3 × 3
Row 1, column 1(number)-1,000,000,000,000 or more, up to 1,000,000,000,000Enter the matrix row by row. For a 2 × 2 matrix leave the third row and third column blank.
Row 1, column 2(number)-1,000,000,000,000 or more, up to 1,000,000,000,000
Row 1, column 3(number)-1,000,000,000,000 or more, up to 1,000,000,000,000; may be left blank
Row 2, column 1(number)-1,000,000,000,000 or more, up to 1,000,000,000,000
Row 2, column 2(number)-1,000,000,000,000 or more, up to 1,000,000,000,000
Row 2, column 3(number)-1,000,000,000,000 or more, up to 1,000,000,000,000; may be left blank
Row 3, column 1(number)-1,000,000,000,000 or more, up to 1,000,000,000,000; may be left blank
Row 3, column 2(number)-1,000,000,000,000 or more, up to 1,000,000,000,000; may be left blank
Row 3, column 3(number)-1,000,000,000,000 or more, up to 1,000,000,000,000; may be left blank
ResultUnitAllowed or shownNote
Determinant(number)Shown to 10 decimal places
Trace (sum of the diagonal)(number)Shown to 10 decimal places
Inverse, row 1 column 1(number)Shown to 10 decimal places
Inverse, row 1 column 2(number)Shown to 10 decimal places
Inverse, row 1 column 3(number)Shown to 10 decimal places
Inverse, row 2 column 1(number)Shown to 10 decimal places
Inverse, row 2 column 2(number)Shown to 10 decimal places
Inverse, row 2 column 3(number)Shown to 10 decimal places
Inverse, row 3 column 1(number)Shown to 10 decimal places
Inverse, row 3 column 2(number)Shown to 10 decimal places
Inverse, row 3 column 3(number)Shown to 10 decimal places
Largest error of A × A⁻¹ against the identity(number)Shown to 6 decimal places

How it is calculated

Each input is converted to the base unit of its quantity, the formula above is applied in the order shown in the worked example, and each result is shown in the unit you choose. Results are held at full precision and rounded only for display, except where a step selects a standard size, as the worked example shows. A value outside its allowed range is refused with a message instead of giving a result.

How the result changes with row 1, column 1

Row 1, column 1DeterminantTraceInverse, row 1 column 1
0.4-11.66.4-0.5172413793
1-87-0.75
2-28-3
410100.6
834140.1764705882
1682220.0731707317
40226460.0265486726

Other inputs are the same as in the worked example above.

Standards and further reading

Complex numbers, rectangular and polar form and angle conversion are standard mathematics, not the subject of a standard. Standards apply when the result feeds an electrical design, and they set the method there.

Frequently asked questions

What do I need to enter?

Enter matrix size, row 1, column 1, row 1, column 2, row 1, column 3, row 2, column 1, row 2, column 2, row 2, column 3, row 3, column 1, row 3, column 2, row 3 and column 3. Change the unit of a value with its selector and the result stays the same.

What does this calculator assume?

The matrix is square, 2 × 2 or 3 × 3, with real entries; for a 2 × 2 matrix the third row and column are ignored. The determinant must not be zero. If it is, the rows are dependent and the matrix has no inverse. The inverse is found by elimination with row swapping, which keeps its accuracy when an entry is small, and is checked by multiplying it back against the original. When the determinant is very small compared with the size of the entries the matrix is close to singular, so a small change in an entry changes the inverse a lot; a warning is shown. The inverse entries for a third row and column are a dash for a 2 × 2 matrix.

Which calculators should I use next?

Common next steps are Simultaneous Equations Solver, Vector Calculator (3D), Complex Numbers (Rectangular and Polar) and Resistors in Parallel. The related links at the bottom of this page open them.

How accurate are the results?

Every figure comes from the same tested engine as the Elecmetric calculators and is meant for estimating. 36 reference cases, calculated from textbook formulas coded separately from the engine by the same author, agree with this calculator. This is not an independent review. Check design values against the standard and the equipment data you work to.

Formula guides and reference

Longer explanations with worked examples and tables, written for the same topic.

More Engineering Mathematics calculatorsAll engineering calculatorsMatrix Calculator (2×2 and 3×3) in Elecmetric

Tell us how to improve this page

This opens your email app. Nothing is sent until you press send.