Section 9.4 Heun Method
As mentioned before, all methods for numerical quadrature do translate into methods for numerical solution of ODEs. As an example, here we show only what happens in case of the trapezoidal method. If \(f(t,x)\) depended on \(t\) only, the "local" version of the method would be
\begin{equation*}
x_{n+1}=x_n+\frac{h}{2}\left(f(t_n)+f(t_{n+1})\right).
\end{equation*}
Naively, one would want to use
\begin{equation*}
x_{n+1}=x_n+\frac{h}{2}\left(f(t_n,x_n)+f(t_{n+1},x_{n+1})\right)
\end{equation*}
but we now we have \(x_{n+1}\) on both sides! Of course we do not know \(x_{n+1}\text{,}\) that is exactly what we are trying to evaluate. A way to overcome the problem above is evaluating a first time \(x_{n+1}\) using Euler`s method and use that value into the trapezoidal algorithm. The method obtained this way is an example of "two steps method", since two steps are needed to evaluate \(x_{n+1}\text{,}\) and it is called Heun method:
- \(\displaystyle \hat x_{n+1} = x_n + h f(t_n,x_n)\)
- \(\displaystyle x_{n+1} = x_n + \frac{h}{2}(f(t_n,x_n)+f(t_{n+1},\;\;\hat x_{n+1}))\)