[Math] Heun’s method maximum error

numerical methodsrunge-kutta-methods

It can be easily found on the Internet many proof that Heun's method error has order $O(h^3)$. However, I have been searching for a formula for the maximum error but I haven't found any. The closest I got was on this page

https://ece.uwaterloo.ca/~math211/Laboratories/08/Heuns/

But I do not understand where he gets the values for $\tau$. I deduced the following formula, based on the truncation term.

$E = (\frac{1}{4}||f'||_{\infty} ||y^2||_{\infty} – \frac{1}{12}||y^3||_{\infty})h^3$

where $||.||_{\infty}$ denotes the maximum value on the interval. Is it correct?

Best Answer

The direct error in your formula is that

  • first, the application of the triangle inequality never results in a norm difference in the upper bound.
  • and second, the upper indices should be derivative orders, not powers, thus written as either $y^{(2)}$ or $y''$ etc.

Indeed, as reconstructed below, you get a correct bound with the same terms, but in a sum, not a difference.


To simplify the calculus, consider an autonomous system $y'=f(y)$, as you can always have $f_1(y)=1$ to get a time variable. The discretization error of Heun's explicit trapezoidal method is, in the form you use, given by \begin{align} E(h)&=y(x+h)-y(x)-\frac{h}2\Bigl(f(y(x))+f\bigl(y(x)+hf(y(x))\bigr)\Bigr) \\ &=\left[y(x+h)-y(x)-\frac12\bigl(f(y(x))+f(y(x+h))\bigr)\right]+\frac{h}2\left[f\bigl(y(x)+hf(y(x))\bigr)-f(y(x+h))\right]. \end{align}

For the first term use the error formula of the trapezoidal quadrature method for the function $g(x)=y_i'(x)=f_i(y(x))$. It gives $$ \frac{h}2(g(x)+g(x+h))-\int_x^{x+h}g(s)ds=-\frac{h^3}{12}g''(x+\theta_i h) $$ so that the first term has the error bound \begin{align} \left\|y(x+h)-y(x)-\frac h2(f(y(x+h))+f(y(x)))\right\| &\le\frac{h^3}{12}\sup_{\theta\in[0,1]}\|y'''(x+\theta h)\| \end{align} For the second term we get using a Lipschitz constant $L_f=\|f'\|_\infty$ \begin{align} \|f(y(x)+hf(y(x)))−f(y(x+h))\|&\le L_f\|y(x)+hy'(x)−y(x+h)\| \\&\le L_f\int_x^{x+h}(x+h-s)\|y''(s)\| \\&\le L_f \frac{h^2}2\sup_{\theta\in[0,1]}\|y''(x+\theta h)\| \end{align}

In combination this gives for the error of the explicit method \begin{align} \|E(h)\| &\le \frac{h^3}{12}·\|y'''\|_\infty+\frac{h^3}{4}·\|f'\|_\infty·\|y''\|_\infty \end{align}

This is the most optimistic outcome you could expect from the error formula of the linked article.

Related Question