The Backward Euler and Crank–Nicolson methods are solved using a tridiagonal solver implementing the Thomas algorithm. The first and last rows correspond to the boundary conditions, and the interior ...