TactivergeLite

Lite / Textbooks / The Mathematics of Machines / Chapter 10

10. Linear systems

Version 1 · Technically checked (automated checks only) · 3 source lessons · Full interactive version

Introduction

Circuits, structures and fitted models all lead to many linear equations in many unknowns, written A·x = b. This chapter reads A·x as a combination of A's columns, uses rank to decide whether there is one solution, none or infinitely many, and solves systems the way computers do: Gaussian elimination, back substitution and the LU factorisation that lets one elimination serve many right-hand sides.

Figure 10.1. Two equations, one crossing (described in words)

Two straight lines on a grid: 2x + y = 5 and x − y = 1. They cross at the single point (2, 1), which is the unique solution of the system.

Explanation

Built from 3 School lessons. Each part is the lesson's own explanation.

10.1 Vectors, combinations and span

Two cables hold up one load. Which loads can they balance, and which can they never balance however hard they pull?

Linear combinations

Given vectors a₁, …, aₙ and numbers x₁, …, xₙ, the vector x₁a₁ + … + xₙaₙ is a linear combination. Matrix–vector multiplication is exactly this: A·x = x₁·(column 1) + x₂·(column 2) + …. So the question 'does Ax = b have a solution?' means 'is b some combination of the columns of A?'

Span and dependence

The span of a set of vectors is every combination of them. Two non-parallel vectors in the plane span the whole plane; two parallel ones span only a line. Vectors are linearly dependent if one is a combination of the others, which means it adds nothing new to the span. A basis is a set that spans the space with no redundancy; its size is the dimension.

Vector spaces, informally

A vector space is any collection you can add and scale without leaving it: arrows in the plane, lists of three currents, even polynomials or solutions of a linear ODE. Closure is what lets us superpose: if two motions satisfy a linear equation, so does their sum. That single fact powers modal analysis later in the term.

Common mix-ups

Open the Lite lesson: Vectors, combinations and span

10.2 Rank: one, none or infinitely many

Three equations, three unknowns, and yet no answer at all. How can counting fail?

Rank

Eliminate to row echelon form. Each non-zero row starts with a pivot; the number of pivots is the rank r. It equals the number of independent columns (and of independent rows). For an m×n matrix, r ≤ min(m, n).

The decision rule

Compare rank A with rank of the augmented matrix [A | b] and the number of unknowns n.

Free variables and the null space

A column without a pivot is free: choose its unknown freely, and back-substitute for the rest. The general solution is x = x_particular + (any vector with Ax = 0). Those homogeneous solutions form the null space, of dimension n − r. Physically, null-space directions are motions or combinations the system cannot 'see', such as a mechanism mode of a frame.

Common mix-ups

Open the Lite lesson: Rank: one, none or infinitely many

10.3 Gaussian elimination, back substitution and LU

Elimination throws away its multipliers. Keep them, and you can re-solve for a new right-hand side almost for free. How?

Forward elimination and back substitution

Use the pivot in row 1 to make zeros below it in column 1, then the pivot in row 2 for column 2, and so on, until the matrix is upper triangular U. Then the last equation has one unknown; solve it and substitute upwards. Apply every row operation to b as well (that is why we work with [A | b]).

Keep the multipliers

The multiplier ℓᵢⱼ = (entry being cleared)/(pivot). Store it in L at position (i, j), with 1s on L's diagonal. For A = [[2, 1, −1], [−3, −1, 2], [−2, 1, 2]] the multipliers are ℓ₂₁ = −1.5, ℓ₃₁ = −1, ℓ₃₂ = 4, giving U = [[2, 1, −1], [0, 0.5, 0.5], [0, 0, −1]].

Why pivot?

Dividing by a tiny pivot creates huge multipliers, and huge numbers swamp small ones when rounded. Partial pivoting swaps up the row with the largest entry in the current column, keeping every |ℓᵢⱼ| ≤ 1. It costs almost nothing and is used by essentially every dense solver.

Derivation: Elimination is A = LU
  1. Subtracting ℓ₂₁ × row 1 from row 2 is left-multiplication by E₂₁ = I − ℓ₂₁e₂e₁ᵀ (the identity with −ℓ₂₁ in position (2, 1)).

  2. Forward elimination is a product of such matrices: E₃₂E₃₁E₂₁·A = U, upper triangular.

  3. Each Eᵢⱼ is undone by flipping the sign of its multiplier, and the inverses multiply in reverse order without interfering: L = E₂₁⁻¹E₃₁⁻¹E₃₂⁻¹ has 1s on the diagonal and ℓᵢⱼ in position (i, j).

  4. Therefore A = LU. To solve Ax = b, solve Ly = b by forward substitution, then Ux = y by back substitution.

  5. Cost: factorising is about (2/3)n³ operations; each extra right-hand side is only about 2n². With row swaps, PA = LU for a permutation matrix P.

Common mix-ups

Open the Lite lesson: Gaussian elimination, back substitution and LU

Worked examples

Vectors, combinations and span: example 1

Is b = (1, 5) a combination of a₁ = (2, 1) and a₂ = (−1, 1)?

Solution

Solve 2x₁ − x₂ = 1 and x₁ + x₂ = 5. Adding gives 3x₁ = 6, so x₁ = 2 and x₂ = 3. Check: 2·(2, 1) + 3·(−1, 1) = (1, 5). Yes.

Vectors, combinations and span: example 2

Are (1, 2, 3), (2, 3, 4) and (3, 5, 7) independent?

Solution

(1, 2, 3) + (2, 3, 4) = (3, 5, 7), so the third is a combination of the first two: dependent. Together they span only a plane in ℝ³.

Rank: one, none or infinitely many: example 1

Solve x₁ + x₂ + x₃ = 6, x₁ + 2x₂ + 3x₃ = 14, 2x₁ + 3x₂ + 4x₃ = 20.

Solution

R2 − R1: x₂ + 2x₃ = 8. R3 − 2R1: x₂ + 2x₃ = 8. Then R3 − R2: 0 = 0. Rank 2, three unknowns: one free variable. Let x₃ = t: x₂ = 8 − 2t, x₁ = 6 − x₂ − x₃ = −2 + t. Check t = 0: (−2, 8, 0) gives 6, 14, 20. ✓

Gaussian elimination, back substitution and LU: example 1

Solve 2x₁ + x₂ − x₃ = 8, −3x₁ − x₂ + 2x₃ = −11, −2x₁ + x₂ + 2x₃ = −3.

Solution

R2 + 1.5R1: 0.5x₂ + 0.5x₃ = 1. R3 + R1: 2x₂ + x₃ = 5. R3 − 4R2: −x₃ = 1, so x₃ = −1. Then 0.5x₂ − 0.5 = 1 gives x₂ = 3; 2x₁ + 3 + 1 = 8 gives x₁ = 2. x = (2, 3, −1).

Interactive figures, in words

Figure 10.2 from Vectors, combinations and span

Start with 'Two cables' and use the sliders to make the orange arrow land on b. Then switch to 'Parallel columns': can you still reach b? Watch the shaded line: it is everything those columns can build.

The diagram plots two column vectors of A scaled by sliders x₁ and x₂, laid tip to tail, and a target point b. A text readout gives A·x, b and the miss distance. For parallel columns, a shaded line marks the span; points off it cannot be reached.

Figure 10.3 from Rank: one, none or infinitely many

Step through '3×3, unique', then '3×3, rank 2' and '3×3, inconsistent'. For each, count the pivots and look at the last row when elimination finishes.

The row-reduction stepper shows the augmented matrix as a table after each row operation, with the pivot highlighted and the operation described in text. When finished, the readout states the rank and whether the system has one, none or infinitely many solutions.

The interactive versions are in the full chapter.

Laboratory

These run in a browser on the full site (they need a faster connection). Simulations are simplified educational models.

Practice

Each question links to its Lite lesson, where your answer is checked on our server and a wrong answer gets a hint. Answers are never sent to your device.

  1. a₁ = (1, 0.5) and a₂ = (2, 1). What is their span?
    Answer it in “Vectors, combinations and span”
  2. Find x₂ so that x₁(1, 1) + x₂(1, −1) = (5, 1).
    Answer it in “Vectors, combinations and span”
  3. After elimination a 3×3 system ends with the row (0 0 0 | 0). Rank A = 2. What can you say?
    Answer it in “Rank: one, none or infinitely many”
  4. A 4×6 matrix has rank 3. What is the dimension of its null space?
    Answer it in “Rank: one, none or infinitely many”
  5. In A = [[2, 1, −1], [−3, −1, 2], [−2, 1, 2]], what multiplier ℓ₂₁ clears the (2, 1) entry?
    Answer it in “Gaussian elimination, back substitution and LU”
  6. Solve A·x = b with A = [[-2, 3, -2], [-2, 3, 4], [-3, 4, -3]] and b = (-11, 7, -15). What is x3?
    Answer it in “Gaussian elimination, back substitution and LU”
  7. Why does partial pivoting help?
    Answer it in “Gaussian elimination, back substitution and LU”
  8. Factorising costs about (2/3)n³ operations. Roughly how many times longer does n = 2000 take than n = 1000?
    Answer it in “Gaussian elimination, back substitution and LU”

Engineering applications

Circuit analysis

Kirchhoff's current law at each node of a resistor network gives one linear equation per node. Solving A·x = b gives every node voltage at once, which is what circuit simulators do.

Structures

The forces in a truss satisfy one balance equation per joint and direction. If the rank is too low the structure is a mechanism and can move; engineers check rank before trusting a design.

Watch (optional)

Streaming video uses a lot of data. Everything you need is in the text.

Summary

Glossary

Matrix multiplication
Multiplying matrices combines rows of the first with columns of the second: each entry of the result is a dot product of a row and a column. Field Guide
Kirchhoff's current law (KCL)
At any junction in a circuit, the total current flowing in equals the total current flowing out. Field Guide
Vector addition
Vectors are added component by component: the x parts add, the y parts add, and the result is the single vector with the same effect as both. Field Guide

Project: Solve a resistor network

Choose a resistor network with three unknown node voltages. Write the node equations as A·x = b, solve them by elimination by hand, check with code, and confirm the currents at one node add to zero.

Deliverables

Write it up on paper or in your own notes. Lite never stores what you write.

References

← 9. Probability and uncertainty11. Eigenvalues and stability →