Your Equation

Tools / Matrix calculator

Matrix calculator

Solve a set of linear equations, find a determinant, inverse or rank, or multiply matrices, with the working shown step by step. It also builds the mesh-current matrix for a resistor network by inspection, the shortcut that skips pages of loop algebra.

Start from an example

A three-mesh resistor network. Every mesh current is taken in the same direction, so each shared resistor gets a minus sign in the matrix. The currents come out as 2, 1 and 3 mA.

What to do

Diagonal boxes: the total resistance in each mesh (kΩ). Boxes above the diagonal: the resistance that two meshes share, with 0 or empty if they share none. Last column: the sum of the source voltages round the mesh, positive when a source drives current in the direction of the mesh current. Boxes below the diagonal fill themselves in.

Mesh data
Mesh 1Mesh 2Mesh 3Source voltage (V)
Mesh 1
Mesh 23
Mesh 312
    Uniquesolution found146determinant of R6.95condition number

    The matrix, written by inspection

    R·I = V, with R in kΩ and V in volts.

    Resistance matrix R
    5−3−1
    −38−2
    −1−26
    ·
    Unknown mesh currents
    I₁
    I₂
    I₃
    =
    Source voltage vector V
    4
    −4
    14

    Mesh currents

    2 mAI₁1 mAI₂3 mAI₃

    Current in each shared resistor

    A shared resistor carries the difference of the two mesh currents that pass through it, taken in the direction of the first mesh.

    1 mAthrough the 3 kΩ shared by meshes 1 and 2−1 mAthrough the 1 kΩ shared by meshes 1 and 3−2 mAthrough the 2 kΩ shared by meshes 2 and 3
    • Check: substituting the currents back gives a largest error of 0 in the equations.
    • The matrix is symmetric by construction, because the resistance shared by meshes i and j is the same from either side.

    Working

    Show the steps
    1. Start with the matrix.
    2. Column 1: divide row 1 by 5; row 2 − (−3) × row 1; row 3 − (−1) × row 1.
    3. Column 2: divide row 2 by 6.2; row 1 − (−0.6) × row 2; row 3 − (−2.6) × row 2.
    4. Column 3: divide row 3 by 4.70968; row 1 − (−0.451613) × row 3; row 2 − (−0.419355) × row 3.

    How to read it

    Solving. The tool applies Gauss–Jordan elimination: it swaps rows to put the largest number in the pivot position, scales the pivot row to 1, and removes that column from every other row. Reading the final matrix tells you whether the equations have one solution, none, or infinitely many. The condition number says how much errors in the numbers are magnified in the answer: above about a million, the data would need to be very precise to trust the result.

    Mesh currents by inspection. Draw every mesh current in the same direction, say clockwise. Then the matrix R·I = V can be written without any algebra. Each diagonal entry is the sum of all resistors in that mesh. Each off-diagonal entry is minus the resistance shared by the two meshes (0 if they share none). Each entry of V is the sum of the source voltages around that mesh, positive when the source pushes current the same way as the mesh current. The matrix is symmetric, which is a quick check on your entries.

    Limits: up to 8×8, real numbers (decimals, exponents like 2e-3, and fractions like 1/3), double-precision arithmetic. A pivot smaller than about 10⁻¹⁰ of the largest entry is treated as zero, so a matrix that is singular only in the thirteenth digit is reported as singular. The mesh shortcut applies to planar resistor circuits with voltage sources and no current sources shared between meshes.