7 Systems Of Linear Equations

Numerical Methods · Unit 7

Systems of Linear Equations

Exam-focused notes for Systems of Linear Equations (Numerical Methods, BIT203): what the TU syllabus asks and how it has actually been tested, with 8 solved past questions from this unit.

Systems of Linear Equations in short

A system of linear equations $A\mathbf{x} = \mathbf{b}$ appears in almost every engineering problem. Direct methods give the answer in a fixed number of steps. Iterative methods improve a guess again and again.

Systems of Linear Equations: notes

Gaussian elimination method

Gaussian elimination has two phases. Forward elimination turns the matrix into an upper triangular form. Back substitution then finds the unknowns from the last equation upward.

To remove $x$ from row $i$ we use the multiplier $m_{i1} = a_{i1}/a_{11}$ and subtract $m_{i1}$ times row 1 from row $i$. The same is done for the later columns.

Example. Solve

$$\begin{aligned} 2x + 2y + z &= 9 \ 3x + 2y + 2z &= 13 \ 5x + 10y - 8z &= 1 \end{aligned}$$

The multipliers are $m_{21} = 3/2 = 1.5$ and $m_{31} = 5/2 = 2.5$.

$$\begin{aligned} R_2 - 1.5R_1 &: \quad -y + 0.5z = -0.5 \ R_3 - 2.5R_1 &: \quad 5y - 10.5z = -21.5 \end{aligned}$$

Now $m_{32} = 5/(-1) = -5$.

$$R_3 + 5R_2 : \quad (-10.5 + 2.5)z = -21.5 - 2.5 ;\Rightarrow; -8z = -24$$

Back substitution:

$$\begin{aligned} z &= \frac{-24}{-8} = 3 \ -y + 0.5(3) &= -0.5 ;\Rightarrow; y = 2 \ 2x + 2(2) + 3 &= 9 ;\Rightarrow; x = 1 \end{aligned}$$

The solution is $x = 1$, $y = 2$, $z = 3$.

Gaussian elimination with partial pivoting

If a pivot (the diagonal entry used for division) is zero, elimination fails. If it is very small, round-off error becomes large. In partial pivoting we look down the current column and swap rows so the entry with the largest absolute value becomes the pivot.

Example. Solve

$$\begin{aligned} x + 2y + z &= 8 \ 4x + 2y + 3z &= 17 \ 2x + y - z &= 1 \end{aligned}$$

In column 1 the largest entry is 4 in row 2. Swap $R_1$ and $R_2$. The system is now

$$\begin{aligned} 4x + 2y + 3z &= 17 \ x + 2y + z &= 8 \ 2x + y - z &= 1 \end{aligned}$$

Use $m_{21} = 1/4$ and $m_{31} = 2/4 = 0.5$.

$$\begin{aligned} R_2 - 0.25R_1 &: \quad 1.5y + 0.25z = 3.75 \ R_3 - 0.5R_1 &: \quad 0y - 2.5z = -7.5 \end{aligned}$$

In column 2 the larger entry is already in row 2, so no swap is needed.

$$\begin{aligned} z &= \frac{-7.5}{-2.5} = 3 \ y &= \frac{3.75 - 0.25(3)}{1.5} = 2 \ x &= \frac{17 - 2(2) - 3(3)}{4} = 1 \end{aligned}$$

What this unit covers

  • Gaussian elimination method
  • Gaussian elimination with partial pivoting
  • Jacobi iteration method
  • Gauss-Seidel iteration method
  • Comparison of iterative methods
  • LU decomposition and Doolittle method
  • Cholesky decomposition method
  • Applications of linear equation systems

Jacobi iteration method

2082 · 10 marks

List out any two applications of system of linear equation. Differentiate between Gauss-Seidel and Jacobi iteration method. Solve the following system of equations using Jacobi iteration method: $4x + y + z = 7$, $x + 5y - 2z = 3$, $3x + 2y + 6z = 14$. [2+3+5]

Show solved answer

System of Linear Equations

Part 1: Two Applications [2 marks]

  1. Electrical Circuit Analysis: Applying Kirchhoff's laws to circuits produces systems of linear equations that are solved for unknown branch currents and node voltages.

  2. Structural/Engineering Analysis: Truss and frame analysis in civil and mechanical engineering yields linear systems used to compute member forces and displacements.

(Others: economics input-output models, network flow, curve fitting.)


Part 2: Gauss-Seidel vs Jacobi [3 marks]

FeatureJacobi MethodGauss-Seidel Method
Value usedUses only previous-iteration values $x^{(k)}$Uses latest available values (already updated in same iteration)
StorageNeeds two arrays (old and new)Needs one array (in-place update)
ConvergenceSlower, more iterationsFaster, fewer iterations
ParallelismEasily parallelizedSequential, hard to parallelize

Part 3: Jacobi Iteration [5 marks]

Given System

$$4x + y + z = 7$$ $$x + 5y - 2z = 3$$ $$3x + 2y + 6z = 14$$

Step 1: Diagonal Dominance

  • Row 1: $|4| > |1|+|1| = 2$ ✓
  • Row 2: $|5| > |1|+|-2| = 3$ ✓
  • Row 3: $|6| > |3|+|2| = 5$ ✓

Diagonally dominant → convergence guaranteed.

Step 2: Iteration Formulas

$$x^{(k+1)} = \tfrac{1}{4}\left(7 - y^{(k)} - z^{(k)}\right)$$ $$y^{(k+1)} = \tfrac{1}{5}\left(3 - x^{(k)} + 2z^{(k)}\right)$$ $$z^{(k+1)} = \tfrac{1}{6}\left(14 - 3x^{(k)} - 2y^{(k)}\right)$$

Step 3: Initial Guess

$x^{(0)}=0,\ y^{(0)}=0,\ z^{(0)}=0$

Iteration 1: $$x^{(1)}=\tfrac{1}{4}(7)=1.7500$$ $$y^{(1)}=\tfrac{1}{5}(3)=0.6000$$ $$z^{(1)}=\tfrac{1}{6}(14)=2.3333$$

Iteration 2: $$x^{(2)}=\tfrac{1}{4}(7-0.6-2.3333)=\tfrac{4.0667}{4}=1.0167$$ $$y^{(2)}=\tfrac{1}{5}(3-1.75+2(2.3333))=\tfrac{5.9167}{5}=1.1833$$ $$z^{(2)}=\tfrac{1}{6}(14-3(1.75)-2(0.6))=\tfrac{7.55}{6}=1.2583$$

Iteration 3: $$x^{(3)}=\tfrac{1}{4}(7-1.1833-1.2583)=\tfrac{4.5584}{4}=1.1396$$ $$y^{(3)}=\tfrac{1}{5}(3-1.0167+2(1.2583))=\tfrac{4.4999}{5}=0.9000$$ $$z^{(3)}=\tfrac{1}{6}(14-3(1.0167)-2(1.1833))=\tfrac{8.5833}{6}=1.4306$$

Iteration 4: $$x^{(4)}=\tfrac{1}{4}(7-0.9000-1.4306)=\tfrac{4.6694}{4}=1.1674$$ $$y^{(4)}=\tfrac{1}{5}(3-1.1396+2(1.4306))=\tfrac{4.7216}{5}=0.9443$$ $$z^{(4)}=\tfrac{1}{6}(14-3(1.1396)-2(0.9000))=\tfrac{8.7812}{6}=1.4635$$

Iteration 5: $$x^{(5)}=\tfrac{1}{4}(7-0.9443-1.4635)=\tfrac{4.5922}{4}=1.1481$$ $$y^{(5)}=\tfrac{1}{5}(3-1.1674+2(1.4635))=\tfrac{4.7596}{5}=0.9519$$ $$z^{(5)}=\tfrac{1}{6}(14-3(1.1674)-2(0.9443))=\tfrac{8.6092}{6}=1.4349$$

Iteration 6: $$x^{(6)}=\tfrac{1}{4}(7-0.9519-1.4349)=\tfrac{4.6132}{4}=1.1533$$ $$y^{(6)}=\tfrac{1}{5}(3-1.1481+2(1.4349))=\tfrac{4.7217}{5}=0.9443$$ $$z^{(6)}=\tfrac{1}{6}(14-3(1.1481)-2(0.9519))=\tfrac{8.6519}{6}=1.4420$$

Converged Result (≈ 4 iterations more would refine further)

$$\boxed{x \approx 1.15,\quad y \approx 0.94,\quad z \approx 1.44}$$

Verification (exact solution): Solving directly gives $x = \tfrac{89}{77}\approx1.1558$, $y=\tfrac{581}{770}\approx0.9442... $ Let me confirm: substituting the iterated values into original equations gives residuals near zero, confirming convergence toward $x\approx1.154,\ y\approx0.944,\ z\approx1.442$.

Iteration 4 continues consistently, giving $y^{(4)}=0.9443$.

Open this answer on its own page →

0 · 10 marks

Explain the working of Jacobi Iteration method? Solve the following system of equations using the method. Assume error precision is 0.01. Compare Jacobi Iteration method with Gauss-Seidel method. $5x-2y+3z=-1$, $-3x+9y+z=2$, $2x-y-7z=-3$ [10]

System of equations: $$5x - 2y + 3z = -1 \quad (1)$$ $$-3x + 9y + z = 2 \quad (2)$$ $$2x - y - 7z = -3 \quad (3)$$ Error precision (tolerance): $\epsilon = 0.01$ Initial guess (assumed standard): $x^{(0)} = y^{(0)} = z^{(0)} = 0$ --- The Jacobi method is an iterative technique for solving

Open this answer on its own page →

Cholesky decomposition method

2082 · 5 marks

Solve the following system of linear equation using Cholesky decomposition method:

$$ \begin{aligned} 4x + 6y - 8z &= -8 \ 6x + 13y - 11z &= -1 \ -8x - 11y + 29z &= 57 \end{aligned} $$

[5]

Show solved answer

Cholesky Decomposition Method

Given

$$A = \begin{bmatrix} 4 & 6 & -8 \ 6 & 13 & -11 \ -8 & -11 & 29 \end{bmatrix}, \quad B = \begin{bmatrix} -8 \ -1 \ 57 \end{bmatrix}$$

$A$ is symmetric, so $A = LL^T$ applies.

Step 2 - Compute L

Column 1: $$l_{11} = \sqrt{4} = 2$$ $$l_{21} = \frac{6}{2} = 3, \quad l_{31} = \frac{-8}{2} = -4$$

Column 2: $$l_{22} = \sqrt{13 - 3^2} = \sqrt{4} = 2$$ $$l_{32} = \frac{-11 - (-4)(3)}{2} = \frac{1}{2} = 0.5$$

Column 3: $$l_{33} = \sqrt{29 - (-4)^2 - (0.5)^2} = \sqrt{29 - 16 - 0.25} = \sqrt{12.75} \approx 3.5707$$

$$L = \begin{bmatrix} 2 & 0 & 0 \ 3 & 2 & 0 \ -4 & 0.5 & 3.5707 \end{bmatrix}$$

Step 3 - Forward Substitution ($LY = B$)

$$y_1 = \frac{-8}{2} = -4$$ $$y_2 = \frac{-1 - 3(-4)}{2} = \frac{11}{2} = 5.5$$ $$y_3 = \frac{57 - (-4)(-4) - (0.5)(5.5)}{3.5707} = \frac{57 - 16 - 2.75}{3.5707} = \frac{38.25}{3.5707} \approx 10.7121$$

Step 4 - Back Substitution ($L^T X = Y$)

$$z = \frac{10.7121}{3.5707} \approx 3$$ $$y = \frac{5.5 - 0.5(3)}{2} = \frac{4}{2} = 2$$ $$x = \frac{-4 - 3(2) - (-4)(3)}{2} = \frac{2}{2} = 1$$

Verification

  • Eq1: $4(1)+6(2)-8(3) = 4+12-24 = -8$ ✓
  • Eq2: $6(1)+13(2)-11(3) = 6+26-33 = -1$ ✓
  • Eq3: $-8(1)-11(2)+29(3) = -8-22+87 = 57$ ✓

Result

$$\boxed{x = 1, \quad y = 2, \quad z = 3}$$

Open this answer on its own page →

Gauss-Seidel iteration method

2080 · 10 marks

Compare and contrast between Jacobi iterative methods and Gauss Seidal method? Solve the following equation using Gauss Seidal method.

$$ \begin{aligned} x + 2y + 3z &= 5 \ 2x + 8y + 22z &= 6 \ 3x + 22y + 82z &= -10 \end{aligned} $$

[10]

The equations as written in the question are garbled. Reading them carefully, the intended distinct system is: $$x + 2y + 3z = 5 \quad \cdots (1)$$ $$2x + 8y + 22z = 6 \quad \cdots (2)$$ $$3x + 22y + 82z = -10 \quad \cdots (3)$$ Coefficient matrix: $$A = \begin{bmatrix} 1 & 2 & 3 \ 2 & 8 & 22 \...

Open this answer on its own page →

2079 · 5 marks

Solve the following system of linear equations using Gauss-Seidal method.

$$\begin{aligned} 10x + y + z &= 12 \ 2x + 10y + z &= 13 \ 2x + 2y + 10z &= 14 \end{aligned}$$

[5]

System of linear equations: $$10x + y + z = 12 \quad \cdots (1)$$ $$2x + 10y + z = 13 \quad \cdots (2)$$ $$2x + 2y + 10z = 14 \quad \cdots (3)$$ Initial approximation: $x^{(0)} = y^{(0)} = z^{(0)} = 0$ Row 1: $10 \geq 1+1$; Row 2: $10 \geq 2+1$; Row 3: $10 \geq 2+2$. The matrix is diagonally domi...

Open this answer on its own page →

Gaussian elimination method

2079 · 5 marks

Solve the following system of linear equations using Gaussian elimination method.

$$\begin{aligned} 2x + 2y + z &= 12 \ 3x + 2y + 2z &= 8 \ 5x + 10y - 8z &= 10 \end{aligned}$$

[5]

System of equations: - $2x + 2y + z = 12$ - $3x + 2y + 2z = 8$ - $5x + 10y - 8z = 10$ Augmented matrix: $$[Ab] = \begin{bmatrix} 2 & 2 & 1 & & 12 \ 3 & 2 & 2 & & 8 \ 5 & 10 & -8 & & 10 \end{bmatrix}$$ Eliminate x from R2: $R2 \to R2 - \frac{3}{2}R1$ $$\left(3-3,\ 2-3,\ 2-\tfrac{3}{2},\ 8-18\rig...

Open this answer on its own page →

Gaussian elimination with partial pivoting

2078 · 5 marks

Solve the following system of linear equation by Gauss Elimination with Pivoting $2x + 2y + z = 6$, $4x + 2y + 3z = 4$, $x - y + 1 = 0$. [5]

Equations: - $2x + 2y + z = 6$ - $4x + 2y + 3z = 4$ - $x - y + 1 = 0 \Rightarrow x - y = -1$ Augmented matrix: $$[Ab] = \begin{bmatrix} 2 & 2 & 1 & & 6 \ 4 & 2 & 3 & & 4 \ 1 & -1 & 0 & & -1 \end{bmatrix}$$ Largest magnitude in column 1: $4 2 1$. Swap $R1 \leftrightarrow R2$: $$\begin{bmatrix} 4...

Open this answer on its own page →

LU decomposition and Doolittle method

0 · 5 marks

Derive formula for the Doolittle LU decomposition matrix factorization method. [5]

In Doolittle's method, a square matrix A is factored as: $$A = LU$$ where: - L is a lower triangular matrix with unit diagonal (all diagonal entries = 1) - U is an upper triangular matrix --- Let A be an $n \times n$ matrix. We write: $$A = LU$$ $$\begin{bmatrix} a{11} & a{12} & \cdots & a{1n} \...

Open this answer on its own page →