Stability conditions are often related to the CFL number, and stability analysis of explicit algorithms usually require us to set a limit to small CFL
∣∣∣∣∣ΔtaΔx∣∣∣∣∣≤1
For a given grid, this effectively sets a limit on the time step. The time step can be no larger than the grid spacing divided by the propagation constant Δt≤Δx/∣a∣. As an example, say we have a device of interest that is 1 meter long, and we want a grid resolution such that we can resolve features that are 1mm in size. Say the problem domain is flow over an airfoil
cs≈1000m/s
Δx/a≈10−6
The time step is limited to less than a microsecond! If the system has any appreciable size, we are probably going to need a lot of compute time to simulate any substantial time scale.
If there are boundary layers that need to be resolved, even finer grid resolution is required. The limit on Δt comes from the minimum grid resolution, so non-uniform grid spacings can even further limit the possible time step size.
Such strict constraints on the possible time step can make explicit finite difference methods unfeasible. This motivates implicit methods in which we construct the solution based on data that is not yet available
un+1=f(un,un+1)
Implicit FTCS (Backward Euler)
As an example, let's devise an implicit algorithm based on FTCS where we evaluate Δx at time n+1
Δtujn+1−ujn+a2Δxuj+1n+1−uj−1n+1=0
→ujn+1=uj−ΔxaΔt(2uj+1n+1−uj−1n+1)
Accuracy: O(Δt,Δx2)
von Neumann Stability analysis:
εjn+1=εjn−ΔxaΔt(2εj+1n+1−εj−1n+1)
εjn=VneikjΔx
VnVn+1[1+2ΔxaΔt(eikΔx−e−ikΔx)]=1
→∣∣∣∣∣VnVn+1∣∣∣∣∣=G=1+Δx2a2Δt2sin2(kΔx)1
So the backward Euler method is unconditionally stable! Great, we've got an algorithm that's unconditionally stable. But how do we actually solve it?
We can write backward Euler as a matrix equation Ax=b where
A = operator matrix
x = solution vector (un+1)
b = inhomogeneity vector (un)
Getting to the matrix expression, re-write Backward Euler by putting all of the terms at future times on the left-hand side (in order of increasing j index), and all of the terms at known times on the right-hand side.
We call this method the Θ-method. If we write in terms of our differential operators,
Δtun+a(1−Θ)δxun+aΘδxun+1=0
As we'll see, Θ=[0,1] for stability.
Θ=1: is just Backward Euler
Θ=0: we've just got FTCS
Θ=1/2: This is called Crank-Nicolson
We find that by using Θ=1, we can improve the performance (condition number of operator matrix) by making the operator matrix more diagonally dominant. It can also reduce diffusion (possibly making it better for shock capture), with the flip-side being an increase in dispersion. It can also increase the temporal accuracy -- we find that for Θ=1/2, the accuracy is O(Δt2,Δx2)