Gaussian Elimination
Gaussian elimination is a direct method for solving the linear system . It operates on the augmented matrix and proceeds in two phases.
Forward Elimination
For each pivot column from left to right, subtract suitable multiples of the pivot row from all rows below it to produce zeros below the diagonal. After this phase, the augmented matrix is upper triangular.
Back Substitution
Solve for the unknowns starting from the last equation (which involves only one unknown) and working upward.
Python
Use in BTCS
For the BTCS scheme, the tridiagonal linear system at each time step can be solved using Gaussian elimination (or more efficiently using np.linalg.inv to precompute the inverse, since the matrix does not change between time steps). A specialised solver for tridiagonal systems - the Thomas algorithm - also exists but is not covered in this module.
BTCS scheme | Diagonal dominance | Laplacian difference equation