Pedagogical example of nonlinear ODE for numerical methods

Hairer-Wanner: Solving ODE II: Stiff and DAE problems, in the chapter on L-Stability and A($\alpha$)-Stability, page 44ff, introduce the motivation for the concept of stability with the initial value problem $$ y'=-2000(y-\cos x), ~~ y(0) = 0, ~~ 0 \le x \le 1.5, \tag{3.11} $$ which has the "slow" solution at $y\approx \cos x$ and the large coefficient forcing all other solutions towards this one. The plots below compare the (implicit) trapezoidal rule against implicit Euler. Here the stability of the order-1 method trumps the asymptotically smaller error of the order-2 method for large step sizes.

enter image description here


I think $y' = y+\cos(2 \pi x) + 2 \pi \sin(2 \pi x) -1$ with $y(0)=0$ is a nice example. If you use Euler's method with an integer value of $h$, you get the zero solution (numerically). As you reduce $h$, the behavior of the numerical solution falls slowly into place. [1] h=1; [2] h=0.5; [3] h=0.25; [4] h=0.005; [5] h=0.0005