Stability of the heat equation FD approximation¶
The explicit (forward difference in time) formulation of the FD heat equation has a maximum time step that can be used in the calculations. Exceeding this time step will lead to the instability of the calculations, and typically, misbehaviour or crashing of the computational code (and, certainly, erroneous results).
Consider the simplified heat equation
where \(\kappa = \frac{k}{\rho C_p}\). The FD approximation is
and, with \(r=\frac{\kappa\Delta t}{\Delta x^2}\), can be written
If we assume that the numerical solution of the temperature, \(T\) is the sum of the correct temperature values \(\theta\) and the error \(\epsilon\) at each grid point (\(T_i = \theta_i + \epsilon_i\)), the difference equations of temperatures and errors can be separated, leading to
That is, the error diffuses from grid point to next grid point, similarly to the actual temperature. We want to suppress the error, that is, we want \(|\epsilon_i^{q+1}| \leq |\epsilon_i^q| \Rightarrow \Big|\frac{\epsilon_i^{q+1}}{\epsilon_i^q}\Big| \leq 1\), since otherwise the error would grow from time step to next.
Dividing the error diffusion expression by \(\epsilon_i^q\) and applying the inequality
Let’s consider the worst case scenario, where \(\epsilon_{i+1} = \epsilon_{i-1} = a\) and \(\epsilon_i = -a\). We get
The first inequality is naturally true (\(r\) cannot be negative), the second leads to
This inequality can be used to determine a proper time step if grid spacing has been chosen, or proper grid spacing if time step has been chosen. Typically, it is safer to force stricter condition, e.g. \(\frac{\kappa \Delta t}{\Delta x^2} \leq \frac{1}{4}\).
Stability of the method does not guarantee its correctness!
A physical interpretation exists for the stability criterion: The diffusive time scale \(\sqrt{\kappa\Delta t}\) should not exceed the grid spacing, i.e. heat should not diffuse in significant amounts over more than one grid point within one time step.