Section 9.6 Stiff ODEs
The explicit Euler method and, in general, methods that come from generalization of Newton-Cotes methods, don`t do well with a type of ODEs called stiff. We show below an elementary example of this behavior. Consider the ODE
\begin{equation*}
\dot x = -kx,\;\;x(0)=1
\end{equation*}
for some \(k>0\) and apply the explicit Euler method to it:
\begin{equation*}
x_{n+1}=x_n-hkx_n = (1-hk)x_n.
\end{equation*}
In this case we can find a closed formula for the \(n\)-th iteration:
\begin{equation*}
x_n = (1-hk)^{n-1},\;\;n=1,2,\dots
\end{equation*}
If \(k\) is large, the sequence \(x_n\text{,}\) unless \(h\) is chosen small enough, diverges and oscillates (its sign will switch at every step). This is exactly the opposite of the qualitative behavior of the exact solution of the ODE:
\begin{equation*}
x(t) = e^{-kt}.
\end{equation*}
This solution converges monotonically to 0 for all \(k>0\text{.}\) This is bad: a "good" method should, at least, follow the same qualitative behavior of the exact solution. The code below, solving the ODE \(\dot x = -15x\text{,}\) shows had badly the algorithm can behave. The situation does not improve much using Heun's method (try it!).