Mathematics IIUnit 68 min read
Systems of Linear Equations – Direct & Iterative Methods
Unit 6 of Mathematics II: introduces consistency, rank, pivoting, Gaussian elimination, LU decomposition, and iterative schemes such as Jacobi, Gauss‑Seidel, and SOR, with practical examples and real‑world applications.
Key points
- A linear system is consistent iff its rank equals the rank of its augmented matrix.
- Gaussian elimination transforms a matrix to upper‑triangular form, enabling back‑substitution.
- Iterative methods converge when the coefficient matrix is diagonally dominant or symmetric positive definite.
- LU decomposition factorises a matrix into lower and upper triangular parts, reducing repeated solves.
- In practice, large sparse systems in engineering and data science are solved iteratively for efficiency.
Introduction
A system of linear equations in variables is a collection
The matrix is called the coefficient matrix and the right‑hand side.
Key concepts:
| Term | Definition |
|---|---|
| Consistency | A system has at least one solution if . |
| Rank | The maximum number of linearly independent rows (or columns) of a matrix. |
| Pivot | A non‑zero entry used to eliminate other entries in its column during Gaussian elimination. |
| Pivot column | The column containing the pivot element in a given row. |
| Pivot element | The entry chosen as pivot; often the largest in magnitude in its column (partial pivoting). |
Visualising a Simple System
Consider the system
Its coefficient matrix and augmented matrix are
The three planes intersect at a single point, the unique solution of the system.
Direct Methods
Gaussian Elimination
- Forward elimination: Transform into an upper‑triangular matrix by eliminating entries below the pivots.
- Back‑substitution: Solve for the variables starting from the last equation.
Partial pivoting: At each step, swap rows so that the pivot element has the largest absolute value in its column. This improves numerical stability.
Worked Example
Solve the system above using Gaussian elimination with partial pivoting.
Step 1 – Pivot in column 1
Largest absolute value in column 1 is 3 (row 2). Swap row 1 and row 2.
Step 2 – Eliminate below pivot
, .
Step 3 – Pivot in column 2
Largest absolute value in column 2 below the diagonal is (row 3). Swap rows 2 and 3.
Step 4 – Eliminate below pivot
.
The last row indicates , which is impossible.
Conclusion: The system is inconsistent; no solution exists.
LU Decomposition
For a nonsingular matrix , we can write where is lower‑triangular with unit diagonal and is upper‑triangular.
Solving becomes two triangular solves:
- (forward substitution).
- (back‑substitution).
LU decomposition is efficient when the same matrix is used with many different vectors, as in repeated simulations or parameter studies.
Iterative Methods
Direct methods are exact but can be expensive for large sparse systems. Iterative methods start with an initial guess and generate a sequence that converges to the solution.
Jacobi Method
All components are updated simultaneously using values from the previous iteration.
Gauss‑Seidel Method
Uses the newest available values, leading to faster convergence than Jacobi.
Successive Over‑Relaxation (SOR)
Adds a relaxation factor (typically ) to accelerate convergence:
Convergence Criteria
A common stopping rule:
where is a prescribed tolerance (e.g., ).
Worked Example – Gauss‑Seidel
Solve
with initial guess .
Iteration table
After the third iteration the change is below ; the solution is
Mermaid diagram of the iterative process
flowchart TD
A["Start with x^(0)"] --> B["Compute x^(1) using Gauss‑Seidel"]
B --> C["Check convergence"]
C -->|"Not converged"| B
C -->|"Converged"| D["Accept x^(k) as solution"]Comparison of Direct and Iterative Methods
| Feature | Gaussian Elimination | LU Decomposition | Jacobi | Gauss‑Seidel | SOR |
|---|---|---|---|---|---|
| Exactness | Exact (within round‑off) | Exact | Approximate | Approximate | Approximate |
| Cost for dense | per iteration | per iteration | per iteration | ||
| Memory | |||||
| Best for | Small to medium dense systems | Repeated solves with same | Very large sparse, diagonally dominant | Large sparse, diagonally dominant | Same as Gauss‑Seidel, but faster |
| Stability | Requires pivoting | Requires pivoting | Sensitive to ordering | Sensitive to ordering | Sensitive to choice |
Applications in the Real World
1. Daraz Order Fulfilment
Daraz uses a linear system to balance inventory across warehouses.
Let be the number of units of product to ship from Warehouse A, from Warehouse B.
Constraints:
- Total demand must be met: .
- Warehouse capacity: , .
- Shipping cost minimisation leads to a linear program solved by the simplex method.
Figure: Bar chart of inventory distribution
2. Kathmandu Traffic Flow
Traffic engineers model flow conservation at intersections:
where is the flow from node to node .
Solving the resulting sparse linear system yields equilibrium traffic densities.
Mermaid diagram of a traffic network
erDiagram
NODE1 ||--o{ EDGE : "flows to"
NODE2 ||--o{ EDGE : "flows to"
NODE3 ||--o{ EDGE : "flows to"3. Bank Loan Interest Calculation
A bank offers a fixed‑rate loan with monthly payment .
The relationship between loan amount , interest rate , and payment is linear in when is fixed:
where is the number of months.
Solving for given and is a simple linear equation.
Figure: Graph of payment vs. loan amount
In the Real World
| Product | Idea Used | How It Works |
|---|---|---|
| eSewa | Linear system for cash‑flow balancing across multiple merchant accounts | Uses Gaussian elimination to reconcile daily transactions and detect discrepancies. |
| Khalti | Iterative solution of large sparse matrices for fraud‑detection risk scoring | Applies Gauss‑Seidel to update risk scores until convergence. |
| Pathao | Routing optimisation via linear programming | Solves a system of constraints to minimise delivery time, implemented with the simplex method. |
| Ncell | Network load balancing | Uses LU decomposition to quickly solve for optimal bandwidth allocation across base stations. |
| NEPSE | Portfolio optimisation | Linear equations determine asset weights that satisfy return and risk constraints. |
Exam Tip
- Identify the method: Check if the system is small and dense (use Gaussian elimination or LU). If it is large and sparse, consider Jacobi or Gauss‑Seidel.
- Check consistency: Compute ranks of and .
- Show pivoting: If partial pivoting is required, mention row swaps.
- Iteration details: For iterative methods, provide at least two iterations and the convergence criterion.
- Use diagrams: A figure of the coefficient matrix or the iteration table can earn extra marks.
- Real‑world tie‑in: Mention a concrete example (e.g., Daraz inventory balancing) to demonstrate application.
Daraz warehouse inventory layout (Image: Shixart1985, CC BY 2.0, via Wikimedia Commons)
Based on the TU BCA syllabus for Mathematics II (CAMT154), unit 6.
Discussion
Loading…