Unit 4: Numerical Linear Algebra & Multi-Variable Non-Linear Systems
Direct matrix factorizations (LU, Cholesky), partial pivoting stability, iterative solvers (Jacobi, Gauss-Seidel, SOR) with spectral radius convergence criteria, power iteration for eigenvalues, and multi-dimensional Newton-Raphson.
§4.1 Direct Solvers: Gaussian Elimination, Pivoting Strategies & LU/Cholesky Factorizations
1. Gaussian Elimination and Computational Complexity
Solving a linear system $A\vec{x} = \vec{b}$ with $A \in \mathbb{R}^{n \times n}$ and $\vec{b} \in \mathbb{R}^n$ is the central computational primitive of scientific computing.
Naive Gaussian Elimination reduces the augmented matrix $[A \mid \vec{b}]$ to upper triangular form $[U \mid \vec{c}]$ through row operations:
Computational Operation Count (FLOPs):
- Forward Elimination: $\sum_{k=1}^{n-1} [2(n - k)(n - k + 1)] = \frac{2}{3} n^3 + \mathcal{O}(n^2)$ floating point operations.
- Backward Substitution: $\sum_{k=1}^n [2(n - k) + 1] = n^2 + \mathcal{O}(n)$ floating point operations.
The cubic complexity $\frac{2}{3} n^3$ dominates overall execution time.
2. Numerical Instability and Pivoting Strategies
If a pivot element $a_{kk}^{(k)}$ is zero, the algorithm crashes (division by zero). More insidiously, if $|a_{kk}^{(k)}| \ll 1$, the multipliers $m_{ik} = a_{ik} / a_{kk}$ become gigantic ($|m_{ik}| \gg 1$), causing catastrophic exponential growth of round-off errors and destroying numerical stability.
Partial Pivoting Algorithm:
At stage $k$, search the active column $k$ from row $k$ down to row $n$ for the element with the maximum absolute magnitude:
Interchange rows $k$ and $p$: $R_k \leftrightarrow R_p$. This guarantees that all multipliers satisfy $|m_{ik}| \le 1$, bounding error amplification and ensuring backwards stability.
Scaled Partial Pivoting:
When row elements differ by orders of magnitude, row scaling factor $s_i = \max_{1 \le j \le n} |a_{ij}|$ is computed. The pivot row $p$ is selected to maximize the relative ratio:
3. Matrix Factorizations: LU and Cholesky
The LU Decomposition ($PA = LU$):
Gaussian elimination with partial pivoting factors a permutation of $A$ into:
where:
- $P$ is a permutation matrix recording row interchanges.
- $L$ is a unit lower-triangular matrix with $1$'s on the main diagonal and the multipliers $m_{ik}$ below the diagonal.
- $U$ is the upper-triangular matrix produced at the termination of forward elimination.
Solving $A\vec{x} = \vec{b}$ reduces to two sequential $\mathcal{O}(n^2)$ triangular solves:
- Permute right-hand side: $\vec{b}^* = P\vec{b}$.
- Forward solve: $L\vec{y} = \vec{b}^*$.
- Backward solve: $U\vec{x} = \vec{y}$.
Cholesky Factorization for Symmetric Positive-Definite (SPD) Matrices:
If $A = A^T$ and $\vec{x}^T A \vec{x} > 0$ for all $\vec{x} \ne \vec{0}$, then $A$ admits a unique factorization:
where $L$ is a lower triangular matrix with strictly positive diagonal entries:
Properties: Cholesky factorization requires $\frac{1}{3} n^3$ FLOPs (half the work of standard LU) and is unconditionally numerically stable without any pivoting!
§4.2 Iterative Methods for Large Sparse Systems: Jacobi, Gauss-Seidel & SOR
1. Matrix Splitting and General Iterative Framework
When $n$ is very large (e.g. $n = 10^5$ to $10^7$ in finite element and CFD grid models) and $A$ is sparse, direct methods ($\mathcal{O}(n^3)$) are prohibitive due to fill-in. Iterative methods generate a sequence of approximations $\vec{x}^{(k)} \to \vec{x}^*$ with sparse matrix-vector products ($\mathcal{O}(n)$ per iteration).
Split $A$ into:
where $D$ is the diagonal, $-L$ is the strictly lower triangular part, and $-U$ is the strictly upper triangular part of $A$.
The general stationary linear iterative scheme has the form:
where $T$ is the iteration matrix.
2. The Jacobi Method
The Jacobi method updates each coordinate simultaneously using values from the previous iteration $k$:
In matrix form:
3. The Gauss-Seidel Method
The Gauss-Seidel method immediately utilizes updated components $x_1^{(k+1)}, \dots, x_{i-1}^{(k+1)}$ as soon as they are computed:
In matrix form:
4. Successive Over-Relaxation (SOR)
To accelerate convergence, SOR computes a weighted average of the previous iterate and the Gauss-Seidel update with relaxation parameter $\omega \in (0, 2)$:
In matrix form:
Theorem 4.1 (Ostrowski-Reich Theorem):
If $A$ is a symmetric positive-definite matrix and $0 < \omega < 2$, then the SOR method converges for any initial guess $\vec{x}^{(0)}$.
Theorem 4.2 (Optimal Relaxation Parameter $\omega_{\text{opt}}$):
For a consistently ordered tridiagonal matrix $A$, the optimal relaxation parameter $\omega_{\text{opt}}$ that minimizes the spectral radius $\rho(T_\omega)$ is:
where $\rho(T_J)$ is the spectral radius of the Jacobi iteration matrix. The corresponding optimal spectral radius is:
§4.3 Spectral Radius Theory & Iterative Convergence Criteria
1. The Spectral Radius of a Matrix
Definition 4.1:
The spectral radius $\rho(M)$ of a square matrix $M \in \mathbb{C}^{n \times n}$ is the maximum absolute value of its eigenvalues:
Theorem 4.3 (Fundamental Convergence Criterion for Linear Iterative Schemes):
The iterative scheme $\vec{x}^{(k+1)} = T \vec{x}^{(k)} + \vec{c}$ converges to the unique solution $\vec{x}^* = (I - T)^{-1}\vec{c}$ for any initial vector $\vec{x}^{(0)}$ if and only if:
Rigorous Proof: Let $\vec{e}^{(k)} = \vec{x}^{(k)} - \vec{x}^*$ denote the error vector at iteration $k$. Subtracting $\vec{x}^ = T \vec{x}^ + \vec{c}$ from the recurrence:
By induction:
For the sequence to converge for every arbitrary $\vec{e}^{(0)}$, we must have:
By the Jordan Canonical Form theorem, $T = P J P^{-1}$ where $J = \text{diag}(J_1, \dots, J_m)$. The powers are $T^k = P J^k P^{-1}$. Each Jordan block of eigenvalue $\lambda$ satisfies:
As $k \to \infty$, $J_i^k \to \mathbf{0}$ if and only if $|\lambda_i| < 1$ for all eigenvalues $\lambda_i$. Hence $\lim_{k \to \infty} T^k = \mathbf{0} \iff \max |\lambda_i| = \rho(T) < 1$. $\blacksquare$
2. Strictly Diagonally Dominant Matrices
Definition 4.2:
A matrix $A \in \mathbb{R}^{n \times n}$ is strictly diagonally dominant (SDD) if for every row $i$:
Theorem 4.4:
If $A$ is strictly diagonally dominant, then both the Jacobi and Gauss-Seidel iterative methods converge unconditionally for any initial guess $\vec{x}^{(0)}$. Furthermore, Gauss-Seidel converges at least twice as fast as Jacobi:
§4.4 Systems of Non-Linear Equations: Multi-Dimensional Newton-Raphson
1. Vector Formulation of Non-Linear Systems
Consider a coupled system of $n$ nonlinear equations in $n$ unknown variables:
Definition 4.3 (The Jacobian Matrix):
The Jacobian Matrix $J(\vec{x}) \in \mathbb{R}^{n \times n}$ contains the first partial derivatives of $\vec{F}$:
2. The Multi-Dimensional Newton-Raphson Scheme
Expanding $\vec{F}(\vec{x})$ about the current vector iterate $\vec{x}^{(k)}$ using the multivariate Taylor theorem:
Setting $\vec{F}(\vec{x}) = \vec{0}$ and defining the update step $\Delta \vec{x}^{(k)} = \vec{x}^{(k+1)} - \vec{x}^{(k)}$:
Key Algorithmic Principle: One must never compute the matrix inverse $J^{-1}$ explicitly! Instead, at each iteration, solve the linear system $J \Delta \vec{x} = -\vec{F}$ using LU decomposition with partial pivoting.
Theorem 4.5 (Quadratic Convergence in $\mathbb{R}^n$):
If $\vec{F} \in C^2(\mathbb{R}^n)$, $J(\vec{x}^)$ is non-singular at the root $\vec{x}^$, and $\vec{x}^{(0)}$ is chosen within a sufficiently small ball $\|\vec{x}^{(0)} - \vec{x}^*\| \le \delta$, then the multivariate Newton sequence converges quadratically:
Tiered Solved Practice Problems & Examination Proofs
Comprehensive analytical derivations, multi-tier solutions (Foundational, Intermediate Algorithmic, and Honors/Proof Challenge) with complete line-by-line verification.
Given the linear system $A\vec{x} = \vec{b}$:
1. Perform Gaussian elimination with partial pivoting to factor $PA = LU$.
2. Solve the system via sequential forward and backward substitution.
3. Verify the residual vector $\vec{r} = \vec{b} - A\vec{x} = \vec{0}$.
Step 1: LU Factorization with Partial Pivoting
Matrix $A_0 = \begin{pmatrix} 1 & 2 & 4 \\ 3 & 8 & 14 \\ 2 & 6 & 13 \end{pmatrix}$, Permutation vector $P = [1, 2, 3]^T$.
Column 1: Pivots are $1, 3, 2$. Maximum is $3$ in Row 2. Swap $R_1 \leftrightarrow R_2$ ($P = [2, 1, 3]^T$):
Eliminate below pivot 3:
- $m_{21} = 1/3$. $R_2 \leftarrow R_2 - (1/3)R_1$: $(2 - 8/3, 4 - 14/3) = (-2/3, -2/3)$.
- $m_{31} = 2/3$. $R_3 \leftarrow R_3 - (2/3)R_1$: $(6 - 16/3, 13 - 28/3) = (2/3, 11/3)$.
Column 2: Entries in row 2 and 3 are $-2/3$ and $2/3$. Magnitudes are equal $|2/3| = |-2/3|$. Swap $R_2 \leftrightarrow R_3$ to choose positive pivot ($P = [2, 3, 1]^T$):
Swap row 2 and 3 of active submatrix (and swap multipliers $m_{21} \leftrightarrow m_{31}$):
Eliminate below pivot $2/3$ in row 3:
- $m_{32} = \frac{-2/3}{2/3} = -1$.
$R_3 \leftarrow R_3 - (-1)R_2$: $-2/3 - (-1)(11/3) = -2/3 + 11/3 = 9/3 = 3$.
Thus, the factors are:
Step 2: Forward Substitution $L\vec{y} = P\vec{b}$
$P\vec{b} = [b_2, b_3, b_1]^T = [25, 21, 7]^T$.
- $y_1 = 25$.
- $y_2 = 21 - (2/3)y_1 = 21 - (2/3)(25) = 21 - 50/3 = 13/3$.
- $y_3 = 7 - (1/3)y_1 - (-1)y_2 = 7 - 25/3 + 13/3 = 7 - 12/3 = 7 - 4 = 3$.
Vector $\vec{y} = [25, 13/3, 3]^T$.
Step 3: Backward Substitution $U\vec{x} = \vec{y}$
- $3 x_3 = 3 \implies x_3 = 1$.
- $\frac{2}{3} x_2 + \frac{11}{3} x_3 = \frac{13}{3} \implies \frac{2}{3} x_2 + \frac{11}{3}(1) = \frac{13}{3} \implies \frac{2}{3} x_2 = \frac{2}{3} \implies x_2 = 1$.
- $3 x_1 + 8 x_2 + 14 x_3 = 25 \implies 3 x_1 + 8(1) + 14(1) = 25 \implies 3 x_1 + 22 = 25 \implies 3 x_1 = 3 \implies x_1 = 1$.
Solution: $\vec{x} = [1, 1, 1]^T$.
Step 4: Residual Verification
$A\vec{x} = \begin{pmatrix} 1(1) + 2(1) + 4(1) \\ 3(1) + 8(1) + 14(1) \\ 2(1) + 6(1) + 13(1) \end{pmatrix} = \begin{pmatrix} 7 \\ 25 \\ 21 \end{pmatrix} = \vec{b}$. Residual is identically zero!
Solution vector $\vec{x} = \begin{pmatrix} 1 \\ 1 \\ 1 \end{pmatrix}$. $PA = LU$ with $P = [2, 3, 1]^T, \vec{y} = [25, 13/3, 3]^T$.
Consider the linear system with coefficient matrix:
1. Calculate the Jacobi iteration matrix $T_J$ and determine its exact spectral radius $\rho(T_J)$.
2. Calculate the Gauss-Seidel iteration matrix $T_{GS}$ and verify the relationship $\rho(T_{GS}) = \rho(T_J)^2$.
3. Determine the theoretical optimal SOR relaxation parameter $\omega_{\text{opt}}$ and compute the optimal asymptotic rate of convergence.
Step 1: Jacobi Iteration Matrix $T_J$ and Spectral Radius
Splitting $A = D - L - U$:
$D^{-1} = \frac{1}{4} I$.
Find eigenvalues of $M = \begin{pmatrix} 0 & 1 & 0 \\ 1 & 0 & 1 \\ 0 & 1 & 0 \end{pmatrix}$:
Eigenvalues of $M$: $\mu_1 = \sqrt{2}, \mu_2 = 0, \mu_3 = -\sqrt{2}$.
Therefore, eigenvalues of $T_J = -\frac{1}{4} M$:
Since $\rho(T_J) \approx 0.3536 < 1$, Jacobi iteration converges.
Step 2: Gauss-Seidel Matrix $T_{GS}$ and Verification
For a tridiagonal consistently ordered matrix, the Young-David theorem establishes $\rho(T_{GS}) = \rho(T_J)^2$:
Gauss-Seidel converges roughly 3 times faster than Jacobi per iteration!
Step 3: Optimal SOR Parameter $\omega_{\text{opt}}$
Using Theorem 4.2:
Evaluating numerically: $\sqrt{14} \approx 3.741657 \implies 4 + \sqrt{14} \approx 7.741657$.
The optimal spectral radius for SOR is:
Comparing spectral radii:
- Jacobi: $\rho = 0.3536$
- Gauss-Seidel: $\rho = 0.1250$
- SOR ($\omega = 1.0334$): $\rho = 0.0334$ (Error shrinks by a factor of 30 every single step!)
$\rho(T_J) = \frac{\sqrt{2}}{4} \approx 0.3536$, $\rho(T_{GS}) = \frac{1}{8} = 0.1250$. Optimal SOR parameter $\omega_{\text{opt}} \approx 1.0334$ yielding spectral radius $\rho(T_{\omega}) \approx 0.0334$.
Consider the nonlinear system of equations:
1. Formulate the symbolic Jacobian matrix $J(x, y)$ and write the explicit Newton step $J(\vec{x}_k)\Delta \vec{x}_k = -\vec{F}(\vec{x}_k)$.
2. Perform 2 iterations of multivariate Newton-Raphson starting from $\vec{x}_0 = (1.0, -1.0)^T$.
3. Prove analytically that the residual $\|\vec{F}(\vec{x}_k)\|$ converges quadratically.
Step 1: Jacobian Matrix Formulation
Function vector $\vec{F}(x, y) = \begin{pmatrix} x^2 + y^2 - 4 \\ e^x + y - 1 \end{pmatrix}$.
Partial derivatives:
- $\frac{\partial f_1}{\partial x} = 2x, \quad \frac{\partial f_1}{\partial y} = 2y$
- $\frac{\partial f_2}{\partial x} = e^x, \quad \frac{\partial f_2}{\partial y} = 1$
Jacobian matrix:
Determinant: $\det(J) = 2x(1) - 2y(e^x) = 2(x - y e^x)$.
Linear system for Newton step:
Step 2: Iteration 1 with $\vec{x}_0 = (1.0, -1.0)^T$
Evaluate $\vec{F}(\vec{x}_0)$:
- $f_1(1, -1) = 1^2 + (-1)^2 - 4 = 2 - 4 = -2$.
- $f_2(1, -1) = e^1 + (-1) - 1 = 2.718282 - 2 = 0.718282$.
Evaluate $J(\vec{x}_0)$:
$\det(J) = 2(1) - (-2)(2.718282) = 2 + 5.436564 = 7.436564$.
Solve $\begin{pmatrix} 2 & -2 \\ 2.718282 & 1 \end{pmatrix} \begin{pmatrix} \Delta x_0 \\ \Delta y_0 \end{pmatrix} = \begin{pmatrix} 2 \\ -0.718282 \end{pmatrix}$: Using Cramer's Rule:
Update:
Step 3: Iteration 2
Evaluate $\vec{F}(\vec{x}_1)$:
- $f_1 = (1.075766)^2 + (-1.924234)^2 - 4 = 1.157272 + 3.702677 - 4 = 0.859949$.
- $f_2 = e^{1.075766} - 1.924234 - 1 = 2.932230 - 2.924234 = 0.007996$.
Jacobian $J(\vec{x}_1) = \begin{pmatrix} 2.151532 & -3.848468 \\ 2.932230 & 1 \end{pmatrix}$, $\det(J) = 2.151532 + 11.284594 = 13.436126$.
Update:
Residual: $\|\vec{F}(\vec{x}_2)\| \approx 0.039$, demonstrating robust quadratic convergence toward the root $(1.00417, -1.72998)^T$!
Iterates: $\vec{x}_0 = (1.0, -1.0)^T, \vec{x}_1 \approx (1.075766, -1.924234)^T, \vec{x}_2 \approx (1.009473, -1.737844)^T$, confirming multidimensional quadratic error reduction.