01 / 21

Modeling with
Linear Systems

Learn how to translate networks, balancing constraints, and flows into systems of linear equations: the foundation of real-world problem solving.

Linear Algebra

What Is a Linear System?

A linear system is a collection of linear equations that share the same set of unknowns. In matrix form we write:

When these equations come from a real situation: traffic at intersections, chemicals in a reaction, money in accounts: we call it modeling with linear systems.

Three Key Modeling Scenarios

Networks
Roads, pipes, or circuits with quantities flowing between nodes.
Balancing
Chemical equations, budgets, or resource allocation where totals must match.
Flows
Supply chains, electrical currents, or fluid systems where conservation laws apply.

Why Model This Way?

1
Structured thinking: a system of equations organizes complex relationships clearly.
2
Scalable: the same techniques work for 2 unknowns or 2,000 unknowns.
3
Solvable by algorithm: Gaussian elimination, matrix inverses, and software can handle any size.
4
Reveals structure: free variables tell you which quantities are flexible; pivots tell you which are determined.

The Conservation Principle

At every node (junction, account, species) in a model, the fundamental rule is:

Node \(x_1\) \(x_2\) \(x_3\) \(x_4\) IN OUT

Network Flow Diagram

Consider a traffic network with three intersections. Known flows enter and exit; unknown flows \(x_1, x_2, x_3\) travel between nodes.

A B C 100 50 80 70 \(x_1\) \(x_2\) \(x_3\)

Building Equations from the Network

Apply conservation at each node: flow in = flow out.

A
Node A: \(100 = x_1 + x_2\)
B
Node B: \(x_1 = 80 + x_3\), i.e. \(x_1 - x_3 = 80\)
C
Node C: \(x_2 + x_3 + 50 = 70\), i.e. \(x_2 + x_3 = 20\)

Determined vs Underdetermined

Determined System
Number of independent equations equals number of unknowns. One unique solution (if consistent).
Underdetermined System
Fewer independent equations than unknowns. Infinitely many solutions parameterized by free variables.

Balancing: Chemical Equations

Consider balancing the reaction: \(x_1\,\text{CH}_4 + x_2\,\text{O}_2 \to x_3\,\text{CO}_2 + x_4\,\text{H}_2\text{O}\)

C
Carbon: \(x_1 = x_3\)
H
Hydrogen: \(4x_1 = 2x_4\), i.e. \(2x_1 = x_4\)
O
Oxygen: \(2x_2 = 2x_3 + x_4\)

Step-by-Step Modeling Process

1
Identify unknowns: label each unknown quantity with a variable \(x_1, x_2, \ldots\).
2
Write constraints: apply conservation (in = out) at every node, element, or account.
3
Build the augmented matrix: write \([A \mid \mathbf{b}]\).
4
Row reduce: use Gaussian elimination to reach echelon form.
5
Interpret: identify pivot variables (determined) and free variables (flexible). Check for physical constraints like \(x_i \geq 0\).

Example 1: Solving the Traffic Network

From slide 6, our augmented matrix is:

Row reduce: \(R_2 \leftarrow R_2 - R_1\):

Example 1: Parametric Solution

Let \(x_3 = t\) (free variable). Back-substituting:

Since traffic flows must be non-negative (\(x_i \geq 0\)):

✓
\(x_1 = 80 + t \geq 0\) is always true for \(t \geq 0\).
✓
\(x_2 = 20 - t \geq 0\) requires \(t \leq 20\).
✓
\(x_3 = t \geq 0\) requires \(t \geq 0\).

Example 2: Electrical Circuit

For a circuit with currents \(I_1, I_2, I_3\), applying Kirchhoff's laws gives the following system:

This is a determined system: 3 equations, 3 unknowns. In augmented form:

Example 2: Solving the Circuit

Row reduce: \(R_2 \leftarrow R_2 - 2R_1\):

\(R_3 \leftarrow 5R_3 - 3R_2\):

1
From row 3: \(14I_3 = 9 \implies I_3 = \frac{9}{14}\).
2
From row 2: \(5I_2 + 2I_3 = 12 \implies 5I_2 = 12 - 2(\frac{9}{14}) = \frac{75}{7} \implies I_2 = \frac{15}{7}\).
3
From row 1: \(I_1 = I_2 + I_3 = \frac{15}{7} + \frac{9}{14} = \frac{39}{14}\).

Common Mistakes

✕ Wrong Flow Direction
Mixing up inflows and outflows at a node: the equation gets a sign error. Always draw arrows first.
✕ Missing an Equation
Forgetting a node or constraint. Check: you need one equation per node (or per element type for balancing).
✕ Ignoring Physical Constraints
Getting a valid algebraic solution like \(x = -5\) for a flow that must be non-negative. Always test \(x_i \geq 0\).

Comparison of Model Types

Feature Networks Balancing Flows
Principle In = Out per node Atoms conserved Conservation laws
Typical system \(A\mathbf{x} = \mathbf{b}\) \(A\mathbf{x} = \mathbf{0}\) \(A\mathbf{x} = \mathbf{b}\)
Usually Underdetermined Underdetermined Determined or under
Extra constraint \(x_i \geq 0\) Smallest integers Capacity limits

Question 1 of 5

At a network node, 40 units flow in from the left and \(x\) units flow in from the top. 25 units exit to the right and 30 units exit downward. Which equation models this node?

Question 2 of 5

A system of 2 equations in 4 unknowns (with both equations independent) will generally have:

Question 3 of 5

To balance \(a\,\text{Fe} + b\,\text{O}_2 \to c\,\text{Fe}_2\text{O}_3\), which system of equations is correct?

Question 4 of 5

In a network flow model, the solution is \(x_1 = 50 - t,\; x_2 = t,\; x_3 = 30 + t\) with all flows non-negative. What is the maximum value of \(t\)?

Question 5 of 5

A chemical balancing problem produces the system \(A\mathbf{x} = \mathbf{0}\). After row reduction, there are 2 pivots and 5 unknowns. How many free variables are there?