Skip to content
Tactiverge

Textbooks/Applied Engineering Mathematics/Chapter 1Lite (plain text) version

1Linear systems in practice

Version 1 · Technically checked (automated checks only) · 4 source lessons · 8 practice items

Text
All chapters and search
  1. 1. Linear systems in practice
  2. 2. Least squares and model fitting
  3. 3. Linearisation, Jacobians and Newton's method
  4. 4. Differential equations and stability
  5. 5. Fourier and transform thinking
  6. 6. Numerical methods and their errors
  7. 7. Statistics for engineering evidence
  8. 8. Estimation and error budgets

Introduction

Circuits, trusses and calibration problems all arrive as many linear equations at once. This chapter writes them as A·x = b, treats matrix multiplication as doing one map after another, and asks the practical questions a textbook exercise skips: should you ever form an inverse, and how much can you trust the answer? The condition number is the honest measure. When it is large, a tiny error in the data can move the solution a long way.

xy(1, 1)(0, 2)b2: 2.01 → 2.02κ ≈ 402x + y = 2 (solid) · x + 1.01y = b2 (tinted)
Figure 1.1. Two nearly parallel lines. Two almost parallel lines, x + y = 2 and x + 1.01y = 2.01, cross at (1, 1). Changing the second right-hand side by only 0.01, to 2.02, moves the crossing all the way to (0, 2). The matrix has a condition number of about 402, so small data errors are greatly amplified.

Explanation

This chapter is built from 4 School lessons. Each part below is the lesson's own explanation; open the lesson for its predict-and-discover activities.

1.1 Writing engineering problems as Ax = b

A resistor network, a loaded frame and a cross-talking sensor pair look nothing alike. Why does one line of code solve all three?

A recipe for modelling

  1. Choose unknowns (loop currents, member tensions, true quantities). 2. Write one equation per physical law: Kirchhoff's voltage law per loop, ΣF = 0 per direction per joint, one sensor model per reading. 3. Collect coefficients into A, knowns into b. 4. Count: as many independent equations as unknowns for a unique answer.

Example: two-loop circuit

A 2 V source drives loop 1 through 2 Ω, and loop 2 contains a 3 V source and 1 Ω. A 1 Ω resistor is shared. KVL in loop 1: 2I₁ + 1(I₁ − I₂) = 2, so 3I₁ − I₂ = 2. Loop 2: 1(I₂ − I₁) + 1·I₂ = 3, so −I₁ + 2I₂ = 3. So A = [[3, −1], [−1, 2]], b = (2, 3), and I = (1.4, 2.2) A.

Always check the residual

Compute r = b − A·x. A tiny residual says you solved the equations you wrote; it does not say they were the right equations. So also sanity-check physics: are currents in a sensible direction, do tensions in a hanging cable come out positive, does the answer change sensibly when you double a source?

Common mix-ups

  • If the residual is zero, the model is right.
    ✓ A zero residual only verifies the solve. Validation needs physics checks and data.
  • More equations always means a better model.
    ✓ Dependent equations add nothing; inconsistent ones make the system unsolvable. Count independent equations.

Open the full lesson: Writing engineering problems as Ax = b →

1.2 Matrix multiplication as composition

Rotate then shear, or shear then rotate: the same two moves, different results. Why does order matter for matrices?

The rule

If A is m×n and B is n×p, then AB is m×p with (AB)ᵢⱼ = Σₖ aᵢₖbₖⱼ: row i of A dotted with column j of B. Inner dimensions must match. Equivalently, column j of AB is A times column j of B.

Composition

(BA)x = B(Ax): first A acts, then B. So BA means 'A then B', read right to left, just like function composition f(g(x)). Associativity, (CB)A = C(BA), lets you pre-multiply a chain of frames into one matrix once.

Order and transposes

In general AB ≠ BA; commuting is the exception (for example two rotations about the same axis, or diagonal matrices). The transpose swaps rows and columns, and reverses products: (AB)ᵀ = BᵀAᵀ. Similarly (AB)⁻¹ = B⁻¹A⁻¹: to undo 'put on socks, then shoes', take off shoes first.

Common mix-ups

  • AB = BA, like ordinary numbers.
    ✓ Matrix products usually do not commute; the order encodes which map happens first.
  • Matrix multiplication multiplies matching entries.
    ✓ That is the element-wise (Hadamard) product. The matrix product is rows times columns.

Open the full lesson: Matrix multiplication as composition →

1.3 Inverses: undoing a linear map

A sensor matrix turns true forces into readings. Can you always run it backwards to turn readings into forces?

What an inverse is

A⁻¹ is the matrix with A⁻¹A = AA⁻¹ = I. It exists exactly when A is square with det A ≠ 0 (rank n). Then Ax = b has the unique solution x = A⁻¹b. Geometrically, the map must not squash any direction to zero, or it cannot be undone.

Gauss–Jordan for bigger matrices

Write [A | I] and row-reduce all the way to [I | X]: eliminate below and above each pivot and scale pivots to 1. Then X = A⁻¹. If a zero pivot cannot be fixed by swapping, A is singular.

Solve, don't invert

In computation, forming A⁻¹ costs about three times more than an LU solve and is typically less accurate. Libraries offer solve(A, b) for this reason. Inverses remain useful on paper, for small fixed matrices, and when you genuinely need the entries (for example a covariance matrix).

Derivation: The 2×2 inverse formula
  1. Let A = [[a, b], [c, d]]. We want X with AX = I.

  2. Try X = k·[[d, −b], [−c, a]] (swap the diagonal, negate the off-diagonal).

  3. Then AX = k·[[ad − bc, −ab + ba], [cd − dc, −cb + da]] = k·(ad − bc)·I.

  4. Choosing k = 1/(ad − bc) gives AX = I, so A⁻¹ = (1/det A)·[[d, −b], [−c, a]].

  5. This only works if det A = ad − bc ≠ 0; when it is zero there is no inverse.

Common mix-ups

  • Every square matrix has an inverse.
    ✓ Only those with det A ≠ 0.
  • A small determinant means nearly singular.
    ✓ Scaling changes det without changing difficulty: 0.1·I in 10D has det 10⁻¹⁰ yet is perfectly conditioned. Use the condition number (week 5).

Open the full lesson: Inverses: undoing a linear map →

1.4 Conditioning: when small errors become big ones

Your solver is perfect, your sensors are 0.1% accurate, and your answer is 50% wrong. Who is to blame?

A property of the problem

κ(A) ≥ 1 measures how sensitive the solution of Ax = b is to changes in b (and in A). κ ≈ 1 is perfect (rotations, orthogonal matrices); κ = 10⁶ means relative data errors may be magnified up to a million times. It is a property of the problem itself, so no algorithm can beat it.

Determinant is not the test

det(0.01·I) in 10 dimensions is 10⁻²⁰, yet κ = 1: it is perfectly conditioned, just scaled. [[1, 1], [1, 1.0001]] has det 10⁻⁴ and κ ≈ 4×10⁴. Use κ, not det, to judge closeness to singularity.

Problem versus algorithm

Conditioning is about the problem; stability is about the algorithm. Elimination without pivoting on the tiny-pivot example is an unstable algorithm on a well-conditioned problem (κ ≈ 2.6). Pivoting fixes the algorithm. For an ill-conditioned problem, the fix is to change the problem: better sensor placement, rescaling, or more independent measurements.

Derivation: The error-amplification bound
  1. Exact: Ax = b. Perturbed data: A(x + δx) = b + δb. Subtract: A·δx = δb, so δx = A⁻¹δb.

  2. Take norms: ‖δx‖ ≤ ‖A⁻¹‖·‖δb‖. Also ‖b‖ = ‖Ax‖ ≤ ‖A‖·‖x‖, so 1/‖x‖ ≤ ‖A‖/‖b‖.

  3. Multiply: ‖δx‖/‖x‖ ≤ ‖A‖·‖A⁻¹‖·‖δb‖/‖b‖.

  4. Define κ(A) = ‖A‖·‖A⁻¹‖. In the 2-norm this is σmax/σmin, the ratio of the largest to smallest singular value.

  5. Rule of thumb: you can lose about log₁₀ κ significant digits. With double precision (about 16 digits) and κ = 10¹⁰, expect about 6 good digits.

Common mix-ups

  • A tiny determinant means ill-conditioned.
    ✓ Use the condition number; determinants change with scaling.
  • Better code always fixes inaccurate answers.
    ✓ Only if the algorithm was unstable. An ill-conditioned problem is sensitive whatever the code.

Open the full lesson: Conditioning: when small errors become big ones →

Worked examples

Writing engineering problems as Ax = b: example 1

Two sensors read r₁ = q₁ + 0.5q₂ and r₂ = 0.25q₁ + q₂. Readings are r = (3, 2.5). Find the true quantities q.

Solution

A = [[1, 0.5], [0.25, 1]]. From the first equation q₁ = 3 − 0.5q₂. Substituting: 0.75 − 0.125q₂ + q₂ = 2.5, so q₂ = 2 and q₁ = 2. Residual: (3 − 2 − 1, 2.5 − 0.5 − 2) = (0, 0).

Matrix multiplication as composition: example 1

Compute AB for A = [[1, 2], [3, 4]], B = [[0, 1], [1, 0]], and BA.

Solution

AB = [[1·0 + 2·1, 1·1 + 2·0], [3·0 + 4·1, 3·1 + 4·0]] = [[2, 1], [4, 3]] (columns of A swapped). BA = [[3, 4], [1, 2]] (rows of A swapped). Different.

Inverses: undoing a linear map: example 1

Invert A = [[3, 1], [2, 5]] and check.

Solution

det A = 15 − 2 = 13. A⁻¹ = (1/13)[[5, −1], [−2, 3]]. Check: A·A⁻¹ = (1/13)[[15 − 2, −3 + 3], [10 − 10, −2 + 15]] = I. ✓

Conditioning: when small errors become big ones: example 1

κ(A) = 10⁴ and the measurements in b have 0.01% relative error. What is the worst-case relative error in x?

Solution

‖δx‖/‖x‖ ≤ 10⁴ × 10⁻⁴ = 1, i.e. up to 100%. The answer may have no correct digits.

Interactive figures

Figure 1.2 from Matrix multiplication as compositionLoad 'Shear' into A and choose 'Then apply B: Rotate 30°'. Note where î and ĵ land. Now load 'Rotate 30°' into A and apply B = 'Shear'. Same two maps, different picture. Check that det(BA) = det(B)·det(A) both times.
Can't use the interactive? Read a description instead

The transformation grid shows a grid and unit square mapped by the combined matrix B·A, with î and ĵ drawn as labelled arrows. Text gives the combined matrix entries and det A, det B and det(BA).

Interactive figure (online). Description: The transformation grid shows a grid and unit square mapped by the combined matrix B·A, with î and ĵ drawn as labelled arrows. Text gives the combined matrix entries and det A, det B and det(BA).

Figure 1.3 from Conditioning: when small errors become big onesSet ε = 1 and nudge b₂. Then slide ε down to 10⁻⁴. For each, record κ, the relative change in b and the relative change in x. Does the amplification ever exceed κ?
Can't use the interactive? Read a description instead

The condition explorer draws two lines whose intersection is the solution, plus a dashed nudged line and the new intersection. Sliders set ε and the nudge. Text reports κ, both solutions and the relative changes in b and x.

Interactive figure (online). Description: The condition explorer draws two lines whose intersection is the solution, plus a dashed nudged line and the new intersection. Sliders set ε and the nudge. Text reports κ, both solutions and the relative changes in b and x.

Laboratory

Everything runs in your browser. No kit, nothing mains-powered. Simulations are simplified educational models.

  • Equation Lab exploration

    Equation Lab: Matrices

    Make the two columns of a 2×2 matrix nearly parallel and watch how far the solution moves when you nudge the right-hand side.

    Open Equation Lab: Matrices →
  • Studio

    Code Lab

    Solve a three-node resistor network as A·x = b, then perturb one resistor by 1 % and report how much each node voltage changes.

    Open Code Lab →

Guided practice

Answers are checked on the server; wrong answers get a hint and another try. Signed in, solved items also count towards the source lesson.

Practice 1

For the circuit in the lesson (3I₁ − I₂ = 2, −I₁ + 2I₂ = 3), what is I₂ in amperes?

A

Practice 2

Your solver returns x with residual ‖b − Ax‖ ≈ 10⁻¹⁴. What have you shown?

Practice 3

To apply A first and then B to a vector x, you compute…

Practice 4

A is 3×2 and B is 2×4. What size is AB?

Practice 5

A colleague computes x = inv(A) * b for a 5000×5000 system. Best advice?

Practice 6

κ = 500, relative error in b is 0.002 (0.2%). What is the worst-case relative error in x?

Practice 7

Working with about 16 significant digits and κ = 10⁹, roughly how many digits of x can you trust?

Practice 8

A calibration matrix has κ = 10⁷. What actually helps?

  1. For the circuit in the lesson (3I₁ − I₂ = 2, −I₁ + 2I₂ = 3), what is I₂ in amperes? (A)
  2. Your solver returns x with residual ‖b − Ax‖ ≈ 10⁻¹⁴. What have you shown?
    • That the physical model is correct
    • That x solves the equations you wrote, to rounding error
    • That the answer has 14 correct digits
  3. To apply A first and then B to a vector x, you compute…
    • ABx
    • BAx
    • Either: they are equal
  4. A is 3×2 and B is 2×4. What size is AB?
    • 2×2
    • 3×4
    • It is undefined
  5. A colleague computes x = inv(A) * b for a 5000×5000 system. Best advice?
    • Fine: that is the standard method
    • Use solve(A, b) (LU): cheaper and more accurate
    • Use Cramer's rule
  6. κ = 500, relative error in b is 0.002 (0.2%). What is the worst-case relative error in x?
  7. Working with about 16 significant digits and κ = 10⁹, roughly how many digits of x can you trust?
  8. A calibration matrix has κ = 10⁷. What actually helps?
    • Use a more accurate solver
    • Redesign the measurements so the columns are less alike
    • Round the answer to fewer digits

Engineering applications

  • Circuit simulators

    A simulator writes one current-balance equation per node and solves them together. It never forms an inverse: elimination on the system is faster and loses fewer digits.

  • Calibration fits

    A sensor calibrated from readings bunched in a narrow range gives a badly conditioned system. Spreading the calibration points across the whole range is the cheapest fix.

Watch

Optional verified videos. Nothing loads from YouTube until you press play.

Explains why multiplying matrices means doing one transformation after another, and why the order matters.

10 min 3 s · captions on YouTube · source

Nothing loads from YouTube until you press play.

Connects solving Ax = b to undoing a transformation, and shows geometrically when a system has no solution or many.

12 min 8 s · captions on YouTube · source

Nothing loads from YouTube until you press play.

Gilbert Strang works through Gaussian elimination at the board, including pivots, failure cases and elimination as matrix multiplication.

Length: see YouTube · captions on YouTube · source

Nothing loads from YouTube until you press play.

  • Matrix multiplication as composition | Chapter 4, Essence of linear algebra (3Blue1Brown)
  • Inverse matrices, column space and null space | Chapter 7, Essence of linear algebra (3Blue1Brown)
  • 2. Elimination with Matrices. (MIT OpenCourseWare)

Chapter summary

  • Many engineering problems are A·x = b: one row per balance law, one unknown per column.
  • AB means apply B first, then A; the order matters and the sizes must match.
  • Solve by elimination rather than computing an inverse; it is cheaper and more accurate.
  • The condition number κ bounds how much relative error in b can grow in x; large κ means fragile answers.

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.
Kirchhoff's current law (KCL)
At any junction in a circuit, the total current flowing in equals the total current flowing out.
Floating-point rounding and comparison
Most decimal fractions cannot be stored exactly in binary floating point, so tiny rounding errors appear and == between floats is unreliable.
Absolute and relative uncertainty
Absolute uncertainty is the ± range in the same units as the measurement; relative uncertainty is that range divided by the measurement, often as a percentage.

Definitions from the Field Guide.

Project: How fragile is my network?

Pick a small resistor network or a two-member truss. Write it as A·x = b, solve it, then repeat with each input changed by 1 %. Estimate the condition number and say whether the measured sensitivity matches it.

Deliverables

  • The system written as A·x = b with units
  • The solution and the perturbed solutions
  • A condition-number estimate with a one-paragraph interpretation

Keep your work in your Engineering Journal; it stays private unless you choose to share it.

References

  • Gilbert Strang (2016). Introduction to Linear Algebra, 5th edition. Wellesley-Cambridge Press.
  • Lloyd N. Trefethen and David Bau III (1997). Numerical Linear Algebra. SIAM.
  • MIT OpenCourseWare (2010). 18.06 Linear Algebra (Spring 2010). Massachusetts Institute of Technology. Link ↗

Publication record

Version
1
Status
Technically checked (automated checks only)
Technical review
Automated checks only, last run 2026-11-29. No human, educator or mentor review is claimed.src/content/textbooks/textbooks.test.ts: schema, every lesson, diagram, practice item, video, Field Guide entry, lab and reference resolves; figure numbers recomputed; no practice answers in client payloads.
Written by
Compiled and written by the Tactiverge team with AI assistance, from Tactiverge School lessons that were themselves written with AI assistance.
Licence
All rights reserved by the founders unless a licence is approved.
Corrections
None recorded yet.Spotted a mistake? Use “Report a problem” on any chapter, or see the corrections page.