Systems of Linear Equations
Solving linear systems is a core task in scientific computing. Gaussian elimination and matrix factorizations provide efficient and numerically stable methods.
Key Points
- A system $A\mathbf{x} = \mathbf{b}$ has unique solutions when $A$ is invertible.
- Gaussian elimination with partial pivoting improves numerical stability.
- LU decomposition factorizes $A$ into lower and upper triangular matrices.
Formulas
Linear system
$$A\mathbf{x} = \mathbf{b}$$
LU factorization
$$A = LU$$
Condition number
$$\kappa(A) = \|A\| \|A^{-1}\|$$
Code Example
import numpy as np
A = np.array([[2, 1], [1, 3]])
b = np.array([4, 5])
x = np.linalg.solve(A, b)
print(x)