Computational Physics, Physics, Heat Equation, Python, Math.
difference formula of second-order accuracy: def rhs_centered(T, dx, alpha, source): """Returns the right-hand side of the 1D heat equation based on centered finite differences Parameters ---------- T : array of floats solution at the current time-step. dx : float grid spacing alpha : float heat