discretization error in numerical

198 Views Asked by At

I have been able to find the formula to approximate $f''(x_0)$ which uses $f( x_0),f\left(x_0+\frac{h}{2}\right)$ and $f(x+2h)$ with some help, which is the following:

$$f''(x_0) =\frac{f(x_0+2h)-4f(x_0+h/2)+3f(x_0)}{\frac32h^2}.$$

Now I am trying to find the formula for the leading term in the discretization error.

Is this the proper equation to use to find this?

$$E(h) = f''_{exact} - f''(h) \approx Ah^p$$ where $h$ is a measure of the mesh discretization, $A$ is a constant, and $p$ is the rate of convergence. If so how can I use this formula with my given answer from above?

2

There are 2 best solutions below

10
On BEST ANSWER

If you plugin the Taylor expansion $$f(x_0+h/2) = f(x_0) + \frac{1}{2}h f'(x_0)+ \frac{1}{8}h^2 f''(x_0) + \frac{1}{48}h^3 f'''(x_0) + \frac{1}{384}h^4 f''''(x_0)+ O(h^5)$$ and similar $$f(x_0+2h) = f(x_0) +2hf'(x_0) + 2h^2f''(x_0) + \frac{4}{3}h^3f'''(x_0) + \frac{2}{3}h^4f''''(x_0) + O(h^5) $$ into you formula your get $$f''(x_0) = f''(x_0,h) + \frac{5}{6}f'''(x_0)h + O(h^2)$$ from which you read-off $$f''(x_0)-f''(x_0, h) = \frac{5}{6}f'''(x_0)h + O(h^2)$$ and therefore

$$A=\frac{5}{6}f'''(x_0), \quad p=1$$

6
On

Assuming $f$ is sufficiently smooth around $x_0$, one can use the Taylor series to write for all $x$ close enough to $x_0$:

$$f(x_0+h)= f(x_0) + f'(x_0)h + \frac{1}{2}f''(x_0)h^2 + \mathcal{O}(h^3)$$

Using these one can expand the terms in your formula as follows

(A) $f(x_0+2h)=f(x_0) + f'(x_0)2h + 2f''(x_0)h^2 + \mathcal{O}(h^3)$

(B) $f(x_0+h/2)=f(x_0) + f'(x_0)h/2 + \frac{1}{8}f''(x_0)h^2 + \mathcal{O}(h^3)$

Plugging these into the formula you gave one can write

$$\frac{f(x_0+2h) - 4f(x_0+h/2) + 3f(x_0) + \mathcal{O}(h^3)}{3/2h^2} = \frac{ f(x_0) + f'(x_0)2h + 2f''(x_0)h^2 - 4(f(x_0) + f'(x_0)h/2 + \frac{1}{8}f''(x_0)h^2) + 3f(x_0) + \mathcal{O}(h^3)}{3/2h^2} = \frac{ f(x_0) + 2f'(x_0)h + 2f''(x_0)h^2 - 4f(x_0) - 2f'(x_0)h - \frac{1}{2}f''(x_0)h^2 + 3f(x_0) + \mathcal{O}(h^3)}{3/2h^2} = f''(x_0) + \mathcal{O}(h). $$

This should give enough of a lead to give you the result. If not, it is possible to expand a discussion in the comments..