45  Matrices and linear systems

Organising equations so machines — and humans — can solve them

The structural analysis of the Tacoma Narrows Bridge involved linear systems of equations — the same fundamental form as any system of resistors, any truss, any set of chemical mass-balance equations. Thousands of numbers, hundreds of equations, but the same underlying question every time: does this system have a solution, is it unique, and what is it?

For small systems — two or three equations — you can solve by substitution, the way you learned in school. For larger systems, that approach bogs down in bookkeeping errors. The method in this chapter, Gaussian elimination, is systematic substitution: a sequence of operations that any careful person (or machine) can apply without creativity, and that always terminates with a definitive answer.

Before any of that, we need the language: matrices and the algebra of matrix operations. The notation is not decoration — it compresses a system of twenty equations into a single line, and makes the structure of the solution visible.


45.1 What this chapter helps you do

Symbols to keep handy

These are the bits of notation you'll see a lot. If a line of symbols feels like a fence, read it out loud once, then keep going.

  • (): rank of A

  • = : A x equals b

  • [|]: augmented matrix

  • _n: identity matrix of order n

  • ^T: A transpose

Definitions to keep handy

These are the words we keep coming back to. If one feels slippery, come back here and steady it before you push on.

  • matrix: A rectangular array of numbers used to store and act on structured information.

  • linear system: A set of linear equations that must all hold at the same time.

  • augmented matrix: A compact way to write the coefficients and right-hand side of a system together: [A|b].

  • Gaussian elimination: A systematic row-reduction procedure that solves the system (or shows no solution).

  • rank: A count of independent information in a matrix; it predicts whether solutions are unique, none, or infinite.

This chapter turns “a pile of equations” into a single object you can reason about and solve systematically. You will learn to:

  • read and manipulate matrices as structured data, not as a wall of numbers
  • rewrite a linear system as \mathbf{A}\mathbf{x}=\mathbf{b}
  • solve systems reliably using Gaussian elimination (row reduction)
  • use rank to predict whether a solution is unique, nonexistent, or infinite
  • reuse work with LU factorisation when the same matrix is solved repeatedly

Watch for this

  • Matrix notation hides bookkeeping, not meaning. Always keep track of what the entries represent (currents, forces, constraints).
  • Row operations change how the system is written, not what it means: they preserve the solution set.
  • Rank is a structural count of independent information. It tells you “how many constraints really exist” before you do much arithmetic.

45.2 Matrices and operations

A matrix is a rectangular array of numbers. The matrix \mathbf{A} with m rows and n columns is called an m \times n matrix:

How to read the core symbols

  • Symbol: \mathbf{A}, a_{ij}

  • Reads as: “bold A”, “a sub i j”

  • Means: a matrix and its entries (row i, column j)

  • Use when: you need to store or apply a structured collection of coefficients

  • Common misread: the first index is the row, the second is the column

  • Symbol: \mathbf{A}^T

  • Reads as: “A transpose”

  • Means: swap rows and columns

  • Use when: dot products, symmetry, least squares, and geometric interpretations

  • Common misread: transpose is not an inverse; it does not undo multiplication

  • Symbol: \mathbf{I}_n

  • Reads as: “identity matrix of order n”

  • Means: the matrix version of 1 (it leaves vectors unchanged)

  • Use when: describing inverses, solving, and factorisations

  • Common misread: \mathbf{I} depends on size; \mathbf{I}_3 and \mathbf{I}_4 are different objects

\mathbf{A} = \begin{pmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{pmatrix}

The element in row i and column j is a_{ij}. The first subscript is always the row, the second is always the column. A matrix with one column (n = 1) is a column vector; one with one row (m = 1) is a row vector.

45.2.1 Special types

Square matrix. m = n. The elements a_{11}, a_{22}, \ldots, a_{nn} form the main diagonal.

Symmetric matrix. a_{ij} = a_{ji} for all i, j. Equivalently, \mathbf{A} = \mathbf{A}^T. Symmetric matrices arise naturally: the stiffness matrix of a structure is symmetric, as is any correlation matrix in statistics.

Diagonal matrix. All off-diagonal entries are zero: a_{ij} = 0 whenever i \neq j. Multiplication by a diagonal matrix scales each component independently.

Identity matrix \mathbf{I}_n. Diagonal with all diagonal entries equal to 1. It plays the role of 1 in matrix arithmetic: \mathbf{A}\mathbf{I} = \mathbf{I}\mathbf{A} = \mathbf{A}.

Triangular matrices. A matrix is upper triangular if a_{ij} = 0 whenever i > j — all entries below the main diagonal are zero. It is lower triangular if a_{ij} = 0 whenever i < j. Gaussian elimination produces an upper triangular matrix; this is why triangular forms matter.

Transpose. The transpose \mathbf{A}^T swaps rows and columns: (\mathbf{A}^T)_{ij} = a_{ji}. A 3 \times 2 matrix transposes to a 2 \times 3 matrix. Key identities: (\mathbf{A}^T)^T = \mathbf{A}; (\mathbf{A}\mathbf{B})^T = \mathbf{B}^T \mathbf{A}^T (order reverses).

45.2.2 Matrix addition and scalar multiplication

Two matrices of the same size can be added element by element:

(\mathbf{A} + \mathbf{B})_{ij} = a_{ij} + b_{ij}

Scalar multiplication scales every entry: (\lambda \mathbf{A})_{ij} = \lambda a_{ij}.

These operations satisfy the expected algebraic properties — commutativity, associativity, distributivity. Nothing surprising here.

45.2.3 Matrix multiplication

Multiplying two matrices is less obvious. The product \mathbf{C} = \mathbf{A}\mathbf{B} requires that the number of columns of \mathbf{A} equals the number of rows of \mathbf{B}. If \mathbf{A} is m \times n and \mathbf{B} is n \times p, then \mathbf{C} is m \times p.

The (i, j) entry of \mathbf{C} is the dot product of row i of \mathbf{A} with column j of \mathbf{B}:

c_{ij} = \sum_{k=1}^{n} a_{ik}\,b_{kj}

Worked example. Let

\mathbf{A} = \begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix}, \qquad \mathbf{B} = \begin{pmatrix} 1 & 4 \\ 2 & 1 \end{pmatrix}

Then c_{11} = 2 \cdot 1 + 1 \cdot 2 = 4; c_{12} = 2 \cdot 4 + 1 \cdot 1 = 9; c_{21} = 0 \cdot 1 + 3 \cdot 2 = 6; c_{22} = 0 \cdot 4 + 3 \cdot 1 = 3.

\mathbf{A}\mathbf{B} = \begin{pmatrix} 4 & 9 \\ 6 & 3 \end{pmatrix}

Important: matrix multiplication is not commutative. \mathbf{A}\mathbf{B} \neq \mathbf{B}\mathbf{A} in general — and sometimes \mathbf{B}\mathbf{A} is not even defined when \mathbf{A}\mathbf{B} is. This is a genuine departure from ordinary arithmetic, and it matters whenever you are rearranging matrix equations.

What multiplication means geometrically. Each column of \mathbf{A}\mathbf{B} is a linear combination of the columns of \mathbf{A}, with coefficients from the corresponding column of \mathbf{B}. This column-space interpretation is the key to understanding why the structure of \mathbf{A} determines the solvability of \mathbf{A}\mathbf{x} = \mathbf{b}.

The explorer below turns the columns of a matrix into visible motions of the plane.


45.3 Linear systems: Ax = b

A system of m linear equations in n unknowns has the form

How to read \mathbf{A}\mathbf{x}=\mathbf{b}

  • Symbol: \mathbf{A}\mathbf{x}=\mathbf{b}

  • Reads as: “A x equals b”

  • Means: a compact way to write many linear equations at once

  • Use when: coefficients and unknowns are easier to manage as structured objects (especially for large systems)

  • Common misread: \mathbf{A}\mathbf{x} is matrix multiplication (a weighted sum of columns), not componentwise multiplication

  • Symbol: [\mathbf{A}\,|\,\mathbf{b}]

  • Reads as: “A augmented with b”

  • Means: the coefficient matrix with the right-hand side appended as an extra column

  • Use when: doing row operations (Gaussian elimination) without rewriting equations

  • Common misread: row operations act on the whole augmented matrix, including the \mathbf{b} column

\begin{aligned} a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n &= b_1 \\ a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n &= b_2 \\ &\vdots \\ a_{m1}x_1 + a_{m2}x_2 + \cdots + a_{mn}x_n &= b_m \end{aligned}

In matrix notation this is \mathbf{A}\mathbf{x} = \mathbf{b}, where \mathbf{A} is the m \times n coefficient matrix, \mathbf{x} is the n \times 1 vector of unknowns, and \mathbf{b} is the m \times 1 right-hand side vector.

The compactness of this notation is not cosmetic. Once you write a system as \mathbf{A}\mathbf{x} = \mathbf{b}, all the structure of the solution is encoded in \mathbf{A} — its rank, its column space, its null space. You can reason about solvability without touching the specific values in \mathbf{b}.

45.3.1 The augmented matrix

The working object for solving a linear system is the augmented matrix [\mathbf{A}\,|\,\mathbf{b}]: the coefficient matrix with \mathbf{b} appended as an extra column, separated by a vertical bar.

[\mathbf{A}\,|\,\mathbf{b}] = \left(\begin{array}{ccc|c} a_{11} & \cdots & a_{1n} & b_1 \\ \vdots & \ddots & \vdots & \vdots \\ a_{m1} & \cdots & a_{mn} & b_m \end{array}\right)

Working on the augmented matrix instead of the equations directly keeps things compact and avoids rewriting variable names at every step.

45.3.2 What a solution means geometrically

Each equation a_{i1}x_1 + a_{i2}x_2 + \cdots + a_{in}x_n = b_i is a hyperplane in \mathbb{R}^n. Solving the system means finding the intersection of all m hyperplanes.

For n = 2 (two unknowns): each equation is a line in the plane. Two lines either intersect at one point (unique solution), are parallel (no solution), or are the same line (infinitely many solutions).

For n = 3: each equation is a plane in three-dimensional space. Three planes can intersect at one point, at a line, at a plane, or not at all. Gaussian elimination finds which case applies and produces the solution in each case.


45.4 Gaussian elimination

Row operations. The three operations that can be applied to rows of an augmented matrix without changing the solution set are:

  1. Swap two rows: R_i \leftrightarrow R_j
  2. Scale a row by a nonzero constant: R_i \leftarrow \lambda R_i (\lambda \neq 0)
  3. Add a multiple of one row to another: R_i \leftarrow R_i + \mu R_j

These are called elementary row operations. They are reversible, so they transform the system into an equivalent one — same solution set, different representation.

The algorithm. Gaussian elimination applies row operations to reduce [\mathbf{A}\,|\,\mathbf{b}] to upper triangular (also called row echelon) form, where all entries below the main diagonal are zero. Back-substitution then extracts the unknowns from bottom to top.

45.4.1 Worked example: 3×3 system

Solve:

\begin{aligned} 2x_1 + 4x_2 - 2x_3 &= 2 \\ x_1 + 3x_2 + x_3 &= 10 \\ -x_1 + 2x_2 + 3x_3 &= 8 \end{aligned}

Step 1. Write the augmented matrix:

\left(\begin{array}{rrr|r} 2 & 4 & -2 & 2 \\ 1 & 3 & 1 & 10 \\ -1 & 2 & 3 & 8 \end{array}\right)

Step 2. Use row 1 as the pivot row to eliminate x_1 from rows 2 and 3.

R_2 \leftarrow R_2 - \tfrac{1}{2}R_1:

\left(\begin{array}{rrr|r} 2 & 4 & -2 & 2 \\ 0 & 1 & 2 & 9 \\ -1 & 2 & 3 & 8 \end{array}\right)

R_3 \leftarrow R_3 + \tfrac{1}{2}R_1:

\left(\begin{array}{rrr|r} 2 & 4 & -2 & 2 \\ 0 & 1 & 2 & 9 \\ 0 & 4 & 2 & 9 \end{array}\right)

Step 3. Use row 2 as the pivot row to eliminate x_2 from row 3.

R_3 \leftarrow R_3 - 4R_2:

\left(\begin{array}{rrr|r} 2 & 4 & -2 & 2 \\ 0 & 1 & 2 & 9 \\ 0 & 0 & -6 & -27 \end{array}\right)

This is upper triangular form. The system now reads:

\begin{aligned} 2x_1 + 4x_2 - 2x_3 &= 2 \\ x_2 + 2x_3 &= 9 \\ -6x_3 &= -27 \end{aligned}

Step 4. Back-substitution.

From row 3: x_3 = \tfrac{-27}{-6} = \tfrac{9}{2}.

From row 2: x_2 = 9 - 2 \cdot \tfrac{9}{2} = 9 - 9 = 0.

From row 1: 2x_1 = 2 - 4(0) + 2(\tfrac{9}{2}) = 2 + 9 = 11, so x_1 = \tfrac{11}{2}.

Solution: x_1 = \tfrac{11}{2}, x_2 = 0, x_3 = \tfrac{9}{2}.

45.4.2 The pivot

At each elimination step, the diagonal element used to eliminate the column below it is called the pivot. The pivot must be nonzero. If it is zero, swap the current row with any row below it that has a nonzero entry in that column (partial pivoting). If no such row exists, the matrix is singular — the system either has no solution or infinitely many.

In practice, numerical software always uses partial pivoting even when the pivot is technically nonzero, to avoid large round-off errors from dividing by very small numbers.

Step through the elimination — the amber cell is the active pivot.

45.4.3 Gauss-Jordan elimination and RREF

Gauss-Jordan elimination continues beyond upper triangular form: it also eliminates entries above each pivot, reducing the matrix to reduced row echelon form (RREF). In RREF every pivot is 1, and every other entry in the pivot column is 0. The unknowns can be read off directly — no back-substitution needed.

For large systems Gaussian elimination with back-substitution is more efficient than full Gauss-Jordan. For small systems, and especially for finding matrix inverses, RREF is convenient.

Continuing the worked example. Starting from the upper triangular form and scaling:

R_3 \leftarrow -\tfrac{1}{6}R_3, R_2 \leftarrow R_2, R_1 \leftarrow \tfrac{1}{2}R_1:

\left(\begin{array}{rrr|r} 1 & 2 & -1 & 1 \\ 0 & 1 & 2 & 9 \\ 0 & 0 & 1 & 9/2 \end{array}\right)

R_2 \leftarrow R_2 - 2R_3:

\left(\begin{array}{rrr|r} 1 & 2 & -1 & 1 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 9/2 \end{array}\right)

R_1 \leftarrow R_1 + R_3, then R_1 \leftarrow R_1 - 2R_2:

\left(\begin{array}{rrr|r} 1 & 0 & 0 & 11/2 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 9/2 \end{array}\right)

The solution x_1 = \tfrac{11}{2}, x_2 = 0, x_3 = \tfrac{9}{2} is visible directly in the right-hand column. Same answer, different path.


45.5 Solution types and rank

Not every system \mathbf{A}\mathbf{x} = \mathbf{b} has a unique solution. Three outcomes are possible, and the row-reduced form reveals which one applies.

How to read rank

  • Symbol: \mathrm{rank}(\mathbf{A})
  • Reads as: “rank of A”
  • Means: the number of independent rows/columns (the number of pivots after row reduction)
  • Use when: predicting whether constraints are independent and whether a solution is determined
  • Common misread: rank is not “how big the matrix is”; it is how much independent information it contains

45.5.1 The three cases

Case 1: unique solution. Every column of \mathbf{A} has a pivot. After row reduction there is one leading 1 per row and per column. The solution is determined completely.

Case 2: no solution (inconsistent). After row reduction, at least one row has the form [0 \; 0 \; \cdots \; 0 \;|\; c] with c \neq 0. This represents the equation 0 = c, which is impossible. Geometrically: the hyperplanes do not share a common point.

Case 3: infinitely many solutions (underdetermined). After row reduction, at least one column has no pivot — the corresponding variable is free, meaning it can take any value. Each free variable introduces one dimension of solutions. Geometrically: the hyperplanes intersect along a line, a plane, or a higher-dimensional subspace.

Move the sliders to see how the geometry changes. Try slope −0.50 for the parallel and coincident cases.

45.5.2 Rank

The rank of a matrix \mathbf{A}, written \text{rank}(\mathbf{A}), is the number of pivots in its row-reduced form — equivalently, the number of linearly independent rows (or columns).

For an m \times n matrix: \text{rank}(\mathbf{A}) \leq \min(m, n).

Solvability criterion. The system \mathbf{A}\mathbf{x} = \mathbf{b} has at least one solution if and only if \text{rank}(\mathbf{A}) = \text{rank}([\mathbf{A}\,|\,\mathbf{b}]). When this holds:

  • If \text{rank}(\mathbf{A}) = n (all unknowns are pivot variables), the solution is unique.
  • If \text{rank}(\mathbf{A}) < n, there are n - \text{rank}(\mathbf{A}) free variables and infinitely many solutions.

45.5.3 Rank-nullity theorem

For an n-column matrix \mathbf{A}:

\text{rank}(\mathbf{A}) + \text{nullity}(\mathbf{A}) = n

The nullity is the number of free variables — the dimension of the null space (the set of all solutions to \mathbf{A}\mathbf{x} = \mathbf{0}). This theorem says that the number of “determined” directions (rank) plus the number of “undetermined” directions (nullity) always adds up to the total number of unknowns. It is stated here for completeness; it becomes central in the chapter on eigenvalues.

45.5.4 What rank tells you before you compute

If you have a 3 \times 3 system and you can see by inspection that one equation is a linear combination of the other two (for example, equation 3 = equation 1 + equation 2), then \text{rank}(\mathbf{A}) \leq 2 < 3 regardless of \mathbf{b}. The system is either inconsistent or underdetermined. Checking rank first can save significant computation.


Use the stepper to watch each elimination multiplier land in L while the same row operation builds U.

45.6 LU factorisation

Gaussian elimination solves one system \mathbf{A}\mathbf{x} = \mathbf{b} at a time. In engineering, the same matrix \mathbf{A} often appears with many different right-hand sides \mathbf{b}_1, \mathbf{b}_2, \ldots, \mathbf{b}_k — for example, a structural stiffness matrix under different load patterns. Re-running Gaussian elimination from scratch each time wastes the work already done.

LU factorisation stores the elimination steps. It factors \mathbf{A} into:

\mathbf{A} = \mathbf{L}\mathbf{U}

where \mathbf{L} is a lower triangular matrix (with 1s on the diagonal) and \mathbf{U} is the upper triangular matrix produced by elimination. The elimination multipliers — the values m_{ij} = a_{ij}/a_{jj} used to zero out entries below each pivot — become the off-diagonal entries of \mathbf{L}.

45.6.1 Solving with LU

Given \mathbf{A} = \mathbf{L}\mathbf{U}, solving \mathbf{A}\mathbf{x} = \mathbf{b} becomes two triangular solves:

  1. Solve \mathbf{L}\mathbf{y} = \mathbf{b} for \mathbf{y} by forward substitution (top to bottom, since \mathbf{L} is lower triangular).
  2. Solve \mathbf{U}\mathbf{x} = \mathbf{y} for \mathbf{x} by back-substitution (bottom to top, since \mathbf{U} is upper triangular).

Each triangular solve costs O(n^2) operations. The factorisation itself costs O(n^3) — the same as Gaussian elimination — but it only needs to happen once per matrix. Subsequent solves for different \mathbf{b} cost only O(n^2) each.

45.6.2 Worked example: 3×3 LU factorisation

Factorise:

\mathbf{A} = \begin{pmatrix} 2 & 4 & -2 \\ 1 & 3 & 1 \\ -1 & 2 & 3 \end{pmatrix}

Step 1. Column 1. Use a_{11} = 2 as pivot.

Multipliers: m_{21} = \tfrac{1}{2}, m_{31} = \tfrac{-1}{2}.

Apply R_2 \leftarrow R_2 - \tfrac{1}{2}R_1 and R_3 \leftarrow R_3 - (-\tfrac{1}{2})R_1 = R_3 + \tfrac{1}{2}R_1:

\begin{pmatrix} 2 & 4 & -2 \\ 0 & 1 & 2 \\ 0 & 4 & 2 \end{pmatrix}

Step 2. Column 2. Use a_{22}^{(1)} = 1 as pivot.

Multiplier: m_{32} = \tfrac{4}{1} = 4.

Apply R_3 \leftarrow R_3 - 4R_2:

\mathbf{U} = \begin{pmatrix} 2 & 4 & -2 \\ 0 & 1 & 2 \\ 0 & 0 & -6 \end{pmatrix}

Assembling L. The multipliers fill the lower triangle of \mathbf{L}, with 1s on the diagonal:

\mathbf{L} = \begin{pmatrix} 1 & 0 & 0 \\ 1/2 & 1 & 0 \\ -1/2 & 4 & 1 \end{pmatrix}

Verification: \mathbf{L}\mathbf{U} should recover \mathbf{A}. Check the (3,2) entry: (-\tfrac{1}{2})(4) + (4)(1) + (1)(0) = -2 + 4 = 2 ✓.

45.6.3 When LU fails

LU factorisation in the form above requires that every pivot encountered during elimination is nonzero. When a zero pivot arises — even if the matrix is not singular — rows must be swapped before continuing. This leads to PLU factorisation (\mathbf{P}\mathbf{A} = \mathbf{L}\mathbf{U} where \mathbf{P} is a permutation matrix recording the row swaps), which is what production numerical libraries always compute. MATLAB’s lu() and NumPy’s scipy.linalg.lu() both return the PLU form.

45.6.4 Numerical perspective

For n > 4 or 5, Gaussian elimination and LU factorisation are almost always done by software. Understanding the algorithm tells you:

  • When it fails: a zero pivot signals a singular or near-singular matrix — the system is ill-conditioned and the solution, if it exists, may be numerically unreliable.
  • Why pivoting matters: without partial pivoting, round-off errors compound in a predictable direction and can make the computed solution wildly wrong even when a true solution exists.
  • What to trust: if NumPy’s linalg.solve() raises a LinAlgError: Singular matrix, the coefficient matrix is rank-deficient. The fix is not a different solver — it is a reconsideration of the physical model.

45.7 Applications

45.7.1 Circuit mesh analysis: Kirchhoff’s voltage law

Consider a three-mesh resistive circuit. Applying Kirchhoff’s voltage law (KVL) around each mesh — the sum of voltage drops around any closed loop is zero — yields one linear equation per mesh in the mesh currents I_1, I_2, I_3.

For a specific circuit with resistances R_1 = 2\,\Omega, R_2 = 4\,\Omega, R_3 = 3\,\Omega, R_4 = 6\,\Omega, R_5 = 1\,\Omega and voltage sources V_1 = 12\,\text{V}, V_2 = 6\,\text{V}, the KVL equations might take the form:

\begin{aligned} (R_1 + R_2)I_1 - R_2 I_2 &= V_1 \\ -R_2 I_1 + (R_2 + R_3 + R_4)I_2 - R_4 I_3 &= 0 \\ -R_4 I_2 + (R_4 + R_5)I_3 &= -V_2 \end{aligned}

Substituting values:

\begin{aligned} 6I_1 - 4I_2 &= 12 \\ -4I_1 + 13I_2 - 6I_3 &= 0 \\ -6I_2 + 7I_3 &= -6 \end{aligned}

In matrix form \mathbf{A}\mathbf{x} = \mathbf{b}:

\begin{pmatrix} 6 & -4 & 0 \\ -4 & 13 & -6 \\ 0 & -6 & 7 \end{pmatrix} \begin{pmatrix} I_1 \\ I_2 \\ I_3 \end{pmatrix} = \begin{pmatrix} 12 \\ 0 \\ -6 \end{pmatrix}

The coefficient matrix is symmetric — a consequence of reciprocity in passive resistive networks. This is always the case when you apply KVL systematically; it is not a coincidence to exploit, it is a theorem to rely on.

Applying Gaussian elimination yields (after row reduction): I_1 = 3.2\,\text{A}, I_2 = 1.8\,\text{A}, I_3 = 0.686\,\text{A} (to three significant figures). Once the mesh currents are known, every voltage and power in the circuit is computable — the linear system is the complete solution to the circuit analysis problem.

Scaling remark. A practical circuit board may have 50 to 500 mesh loops. The matrix is still symmetric, but 50 \times 50 by hand is not feasible. SPICE — the standard circuit simulator used by every electronics engineer — solves such systems using LU factorisation with partial pivoting, exactly the method in this chapter.

45.7.2 Structural force distribution

A statically determinate truss consists of members (bars) and joints (nodes). At each joint, equilibrium requires that the sum of forces in the horizontal direction is zero, and the sum in the vertical direction is zero. Each equilibrium equation is linear in the member forces. For a truss with n joints and m members plus three reaction forces, static determinacy gives m + 3 = 2n, and the full set of equilibrium equations is a square linear system.

For a simple three-member triangular truss with a vertical load P at the apex:

\begin{pmatrix} \cos\theta_1 & \cos\theta_2 & 0 \\ \sin\theta_1 & \sin\theta_2 & 0 \\ 0 & -1 & 1 \end{pmatrix} \begin{pmatrix} F_1 \\ F_2 \\ R \end{pmatrix} = \begin{pmatrix} 0 \\ P \\ 0 \end{pmatrix}

where F_1, F_2 are member forces, R is a reaction force, and \theta_1, \theta_2 are member angles. Solving this gives the force in each member — positive values indicate tension, negative indicate compression. A member under too much compression will buckle; too much tension and it will yield. The linear system does not just find numbers: it tells the structural engineer which members to upsize.


45.8 What you can do now

You can now compress a system into \mathbf{A}\mathbf{x}=\mathbf{b}, solve it reliably by row reduction, and use rank language to predict whether a model is determined, inconsistent, or underdetermined. You also have the practical engineering idea of LU: factor once, then solve many times.

45.9 Exercises

These exercises use real engineering and science contexts. The interesting part is setting up the augmented matrix correctly and identifying which solution case applies.


45.9.1 Exercise 1: Node admittance matrix multiplication

A circuit has three nodes. The node admittance matrix \mathbf{Y} and a voltage vector \mathbf{V} are:

\mathbf{Y} = \begin{pmatrix} 5 & -2 & -1 \\ -2 & 6 & -3 \\ -1 & -3 & 4 \end{pmatrix}, \qquad \mathbf{V} = \begin{pmatrix} 10 \\ 5 \\ 2 \end{pmatrix} \text{ V}

Compute the current injection vector \mathbf{I} = \mathbf{Y}\mathbf{V}.


45.9.2 Exercise 2: Mesh current analysis by Gaussian elimination

Three mesh currents I_1, I_2, I_3 (in amperes) in a resistive network satisfy:

\begin{aligned} 8I_1 - 2I_2 - 0I_3 &= 16 \\ -2I_1 + 7I_2 - 3I_3 &= 0 \\ 0I_1 - 3I_2 + 5I_3 &= -6 \end{aligned}

Find I_1, I_2, I_3 by Gaussian elimination.


45.9.3 Exercise 3: RREF and solution type (underdetermined structural system)

A redundant structure gives three equilibrium equations in four unknown member forces F_1, F_2, F_3, F_4:

\begin{aligned} F_1 + 2F_2 - F_3 + F_4 &= 10 \\ 2F_1 + 4F_2 + F_3 - F_4 &= 8 \\ F_1 + 2F_2 + 3F_3 - 3F_4 &= -16 \end{aligned}

Row-reduce to RREF. Identify the free variable(s) and write the general solution.


45.9.4 Exercise 4: Rank of a sensor measurement matrix

A sensor network takes four measurements of three physical quantities (temperature, pressure, flow rate). The measurement matrix is:

\mathbf{M} = \begin{pmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 1 & 0 & 2 \\ 3 & 2 & 7 \end{pmatrix}

Find \text{rank}(\mathbf{M}). What does this tell you about the sensor network?


45.9.5 Exercise 5: LU factorisation for repeated solves

A heat-transfer network has conductance matrix:

\mathbf{K} = \begin{pmatrix} 4 & -1 & 0 \\ -1 & 3 & -1 \\ 0 & -1 & 2 \end{pmatrix}

Find the LU factorisation of \mathbf{K}, then use it to solve \mathbf{K}\mathbf{T} = \mathbf{q} for two different heat-flux vectors:

\mathbf{q}_1 = \begin{pmatrix} 8 \\ 4 \\ 2 \end{pmatrix}, \qquad \mathbf{q}_2 = \begin{pmatrix} 0 \\ 6 \\ 4 \end{pmatrix}


45.9.6 Exercise 6: Write and solve the linear system for a 3-mesh circuit

A three-mesh circuit has the following KVL equations after applying Kirchhoff’s voltage law. The mesh currents I_1, I_2, I_3 (in mA) satisfy:

  • Mesh 1: A 10 Ω resistor carries I_1; a 5 Ω resistor is shared with mesh 2 carrying I_1 - I_2. Voltage source: 20 V.
  • Mesh 2: The shared 5 Ω resistor carries I_2 - I_1; a 10 Ω resistor carries I_2; a 4 Ω resistor is shared with mesh 3 carrying I_2 - I_3. No voltage source.
  • Mesh 3: The shared 4 Ω resistor carries I_3 - I_2; a 6 Ω resistor carries I_3. Voltage source: −8 V (opposing reference direction).

Write \mathbf{A}\mathbf{x} = \mathbf{b} explicitly, then solve using Gaussian elimination.