I am teaching numerical solution of first order ODEs. I wanted to show to my students how choosing step size can be critical when solving ODEs numerically. I was looking for a problem to demonstrate that i.e. when choosing a step size within a certain range gives an accurate answer but choosing a different step size can make the solution go off track or unstable solution. I have been unable find such an example. If anyone here has a problem(s) which I can use to this end, it would be very helpful to me if you could share it here.
2026-03-27 10:44:09.1774608249
On
Pedagogical example of nonlinear ODE for numerical methods
152 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
0
On
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
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.