Order of accuracy of $0$

82 Views Asked by At

I had to calculate the truncation error, but the error gave me $0$. Then the question asked what is the order of accuracy, however since the error is $0$ should it be infinity?


We use this difference formula:

$$Q(h) = \frac{f(x-2h) - 8f(x-h) + 8f(x+h) -f(x+2h)}{12h}$$

And with the following Taylor expansions around $x$:

$\begin{align} f(x-2h) &= f(x) - 2hf'(x) + 2h^2f''(x) - \frac{4}{3}h^3f'''(x) + \mathcal{O}(h^4)\\ f(x-h) &= f(x) - hf'(x) + \frac{1}{2}h^2f''(x) - \frac{1}{6}h^3f'''(x) + \mathcal{O}(h^4)\\ f(x-h) &= f(x) + hf'(x) + \frac{1}{2}h^2f''(x) + \frac{1}{6}h^3f'''(x) + \mathcal{O}(h^4)\\ f(x+2h) &= f(x) + 2hf'(x) + 2h^2f''(x) + \frac{4}{3}h^3f'''(x) + \mathcal{O}(h^4)\\ \end{align}$

Then we find the truncation error:

$\begin{align} |f'(x) - Q(h)| &= |f'(x) - f(x)\cdot\left(\frac{1}{12h}-\frac{8}{12h}+\frac{8}{12h}-\frac{1}{12h}\right)\\ &- f'(x)\cdot\left(-\frac{1}{6}+\frac{2}{3}+\frac{2}{3}-\frac{1}{6}\right)\\ &- f''(x)\cdot\left(\frac{h}{6}-\frac{h}{3}+\frac{h}{3}-\frac{h}{6}\right)\\ &- f'''(x)\cdot\left(-\frac{h^2}{9}+\frac{h^2}{9}+\frac{h^2}{9}-\frac{h^2}{9}\right)| \end{align}$

As you can see, all the orders cancel out except for the first derivative

Therefore $|f'(x) - Q(h)| = |f'(x) - f'(x)| = 0$

2

There are 2 best solutions below

2
On BEST ANSWER

You can't cancel the orders out. Remember that each Taylor expansion has an error of $\frac{h^4}{24} f^{(4)}(\eta_i)$, and $\eta_i$ might vary for each case.

0
On

Although having no error means that the accuracy is maximum, I would personally use a more elegant way of measuring accuracy, because infinity means that the scale of real numbers until there is all available for accuracies. As in, 200...10^5, etc.

Perhaps, use 100% (much more clear and easy to write and process).

Another option, of you want to see it as "efficiency", make it 1.

If you want to be fine, use complete accuracy.