Numerical MethodsUnit 613 min read

Direct & Iterative Methods for Solving Linear Systems: Gauss, Crout, SOR, Gauss-Seidel

Unit 6 of Numerical Methods covers exact (direct) methods like Gauss elimination and Crout factorization, and iterative methods like Jacobi, Gauss-Seidel, and SOR for solving systems of linear equations, with error analysis and convergence criteria.

TAKEAWAYS:

  • Direct methods (Gauss, Crout) give exact solutions in finite steps but are computationally expensive for large systems.
  • Iterative methods (Jacobi, Gauss-Seidel, SOR) approximate solutions and are efficient for sparse or large systems, but require convergence analysis.
  • The Gauss-Seidel method converges faster than Jacobi because it uses updated values immediately.
  • Successive Over-Relaxation (SOR) improves convergence by introducing a relaxation factor ω (1 < ω < 2).
  • Error bounds and residuals determine method accuracy; iterative methods stop when residuals fall below a tolerance.
  • Real-world applications include electric circuit analysis (Nepal Electricity Authority’s load distribution), financial modeling (bank loan repayment schedules), and traffic routing (Pathao’s dynamic ride-matching).

1. Introduction: Why Solve Linear Systems Numerically?

Linear systems arise in engineering when modeling equilibrium states, such as:

  • Structural analysis: Forces in a bridge truss (Nepal’s Seti River Bridge).
  • Circuit analysis: Voltage/current in NTC’s power grids.
  • Economics: Input-output models in Nepal’s GDP calculations.

Key Definitions:

  • Linear system: , where is an matrix, is the solution vector, and is the right-hand side.
  • Direct methods: Compute exact solutions in finite steps (e.g., Gauss elimination).
  • Iterative methods: Approximate solutions via successive refinements (e.g., Jacobi, Gauss-Seidel).

2. Direct Methods: Exact Solutions

2.1 Gauss Elimination Method

How it works:

  1. Convert the system into row-echelon form (upper triangular) using row operations.
  2. Perform back substitution to solve for variables.

Example 1: Solve using Gauss elimination:

Step-by-Step Trace:

  1. Eliminate from rows 2 and 3:
    • Row2 = Row2 – (2/3)Row1
    • Row3 = Row3 – (1/3)Row1
  2. Eliminate from row 3:
    • Row3 = Row3 – (7/11)Row2
  3. Back substitution:

Solution: , , .

Advantages:

  • Exact solution (no rounding errors in theory).
  • Simple to implement.

Disadvantages:

  • Computationally expensive for large ( operations).
  • Prone to round-off errors in floating-point arithmetic.

2.2 Crout Factorization (LU Decomposition)

How it works: Decompose , where:

  • : Lower triangular matrix with 1s on the diagonal.
  • : Upper triangular matrix.

Example 2: Solve using Crout’s method:

Step-by-Step Trace:

  1. Factorize : Solve for and : Using , compute:

  2. Solve : Solution: , , .

  3. Solve : Solution: , , .

Solution: , , .

Advantages:

  • Efficient for repeated solutions with the same (e.g., optimization problems).
  • Avoids pivoting issues if is well-conditioned.

Disadvantages:

  • Requires operations.
  • Fails if is singular or ill-conditioned.

3. Iterative Methods: Approximate Solutions

3.1 Jacobi Method

How it works: Rewrite as: where , is diagonal, is lower triangular, and is upper triangular.

Convergence Criterion: Converges if , where is the spectral radius.

Example 3: Apply Jacobi to: Initial guess: .

Iteration Steps:

flowchart TD
    A["Iteration 0: x₀=0, y₀=0, z₀=0"] --> B["Compute x₁ = (4 + y₀ - z₀)/4 = 1"]
    B --> C["Compute y₁ = (7 - x₁ - z₀)/5 = 6/5 = 1.2"]
    C --> D["Compute z₁ = (3 - x₁ - y₁)/3 ≈ 0.133"]
    D --> E["Iteration 1: x₁=1, y₁=1.2, z₁≈0.133"]
    E --> F["Repeat until convergence (|x^(k+1) - x^(k)| < ε)"]

After 5 iterations: .

Advantages:

  • Simple to implement.
  • Parallelizable (each component updated independently).

Disadvantages:

  • Slow convergence (often requires many iterations).
  • May not converge for all systems.

3.2 Gauss-Seidel Method

Improvement over Jacobi: Uses the most recent values immediately.

Example 4: Solve the same system as Example 3 using Gauss-Seidel.

Iteration Steps:

flowchart TD
    A["Iteration 0: x₀=0, y₀=0, z₀=0"] --> B["Compute x₁ = (4 + y₀ - z₀)/4 = 1"]
    B --> C["Compute y₁ = (7 - x₁ - z₀)/5 = 6/5 = 1.2"]
    C --> D["Compute z₁ = (3 - x₁ - y₁)/3 ≈ 0.133"]
    D --> E["Iteration 1: x₁=1, y₁=1.2, z₁≈0.133"]
    E --> F["Use updated x₁, y₁ for next iteration"]
    F --> G["Iteration 2: x₂ ≈ 0.999, y₂ ≈ 1.000, z₂ ≈ 0.999"]

Converges in fewer iterations than Jacobi.

Convergence Criterion: Converges if is strictly diagonally dominant or symmetric positive definite.


3.3 Successive Over-Relaxation (SOR)

How it works: Introduce a relaxation factor (typically ) to accelerate convergence:

Example 5: Solve Example 3 with .

Optimal : For symmetric positive definite matrices, , where is the spectral radius of .

Comparison Table:

Method Convergence Speed Implementation Complexity Best Use Case
Jacobi Slow Low Parallel systems
Gauss-Seidel Moderate Moderate Diagonally dominant matrices
SOR Fast (with ) High Large sparse systems (e.g., PDEs)

4. Error Analysis and Stopping Criteria

Error Measures:

  1. Residual: . Stop when .
  2. Relative Error: .

Example 6: For Example 3, stop when .


5. Real-World Applications

5.1 Nepal Electricity Authority (NEA) Load Distribution

  • Problem: Distribute power across Nepal’s grid to minimize losses.
  • Method: Gauss-Seidel solves the linear system , where is voltage and is current.
  • Why? Sparse matrix (only nearby nodes interact), so iterative methods are efficient.

5.2 Bank Loan Repayment (Nabil Bank)

  • Problem: Calculate monthly payments for a loan with interest.
  • Method: Solve , where encodes interest rates and is the repayment schedule.
  • Why? Crout factorization is used for repeated calculations (e.g., adjusting interest rates).

5.3 Pathao’s Dynamic Ride-Matching

  • Problem: Assign drivers to passengers in real-time to minimize wait times.
  • Method: Gauss-Seidel approximates optimal assignments by iteratively improving matches.
  • Why? Large-scale system (thousands of variables), so iterative methods outperform direct methods.

6. Exam Tip: What to Expect

  1. Direct Methods (Gauss, Crout):

    • Expect step-by-step elimination or factorization questions.
    • Common pitfall: Forgetting to perform back substitution after elimination.
    • Tip: Always write the augmented matrix clearly.
  2. Iterative Methods (Jacobi, Gauss-Seidel, SOR):

    • Always check convergence before submitting answers.
    • For SOR: State the value of used (e.g., ).
    • Tip: Show the first 2–3 iterations explicitly.
  3. Error Analysis:

    • Questions may ask for residuals or relative error after a fixed number of iterations.
    • Tip: Use for residuals.
  4. Matrix Properties:

    • Diagonally dominant matrices guarantee Gauss-Seidel convergence.
    • Symmetric positive definite matrices have optimal for SOR.
  5. Past Exam Patterns:

    • Part (a): Direct method (Gauss/Crout) with 3 equations.
    • Part (b): Iterative method (Jacobi/Gauss-Seidel/SOR) with 3–4 equations.
    • Always verify your solution by plugging back into the original equations.

7. Summary of Key Formulas

Method Formula Convergence Condition
Gauss Elimination via row ops, then back substitution. Exact (if no pivoting issues).
Crout Factorization , solve , then . must be invertible.
Jacobi .
Gauss-Seidel strictly diagonally dominant.
SOR , optimal exists.

8. Worked Example: Traffic Flow Optimization (Kathmandu)

Problem: Model traffic flow at a 3-intersection junction in Kathmandu using the system: where are traffic flows (vehicles/hour).

Solution:

  1. Gauss Elimination:

    • Eliminate from rows 2 and 3:
    • Back substitution yields: , , .
  2. Gauss-Seidel Iteration:

    • Initial guess: .
    • After 3 iterations: .

Interpretation:

  • Equal flow ( vehicles/hour) optimizes traffic at the junction.
  • Real-world tie-in: Used by SmartRide (Nepal’s traffic management app) to simulate and suggest reroutes.

9. Common Mistakes to Avoid

  1. Floating-Point Errors:

    • In Gauss elimination, partial pivoting (swap rows to avoid division by small numbers) is often required.
    • Example: Swap rows if .
  2. Incorrect Iterative Updates:

    • In Gauss-Seidel, always use the latest values for .
    • Mistake: Using old values for all (this is Jacobi, not Gauss-Seidel).
  3. Forgetting Convergence Checks:

    • Always state the stopping criterion (e.g., ).
  4. Misapplying SOR:

    • must be chosen carefully. For Example 3, works, but may diverge.

10. Practice Questions (Exam-Style)

  1. Gauss Elimination: Solve:

  2. Crout Factorization: Factorize and solve:

  3. Gauss-Seidel: Apply Gauss-Seidel to the above system with . Stop when .

  4. SOR: Solve the same system with . Compare convergence speed to Gauss-Seidel.


11. Further Reading

  • Books:
    • Numerical Methods for Engineers by Steven C. Chapra.
    • Introduction to Numerical Analysis by Kendall E. Atkinson.
  • Online Resources:
    • MIT OpenCourseWare: Numerical Linear Algebra.
    • Python libraries: numpy.linalg.solve (direct), scipy.sparse.linalg (iterative).

Based on the PU BE Computer (PU) syllabus for Numerical Methods, unit 6.

Discussion

Loading…