Wednesday, 5 August 2015

numerical methods - How to prove finite difference approximation has error of order $mathcal{O}(Delta x^2)$



I'm asked to prove that the finite difference approximation
$$u_{xx}(x_i) = \frac{u_{i+1} - 2u_i + u_{i-1}}{\Delta x^2}$$
gives a discretization error of order $\mathcal{O}(\Delta x^2).$




My attempt:



I realize I want prove that
$$u_{xx}(x_i) - \frac{u_{i+1} - 2u_i + u_{i-1}}{\Delta x^2} = \mathcal{O}(\Delta x^2).$$



I try to rewrite $u_{xx}(x_i):$
$$u_{i+1} =u_i+\Delta x u_{x(i)} + \frac{\Delta x^2}{2}u_{xx(i)} + \mathcal{O}(\Delta x^3).$$
$$u_{xx(i)} = \frac{2u_{i+1} - 2u_i - 2\Delta x u_{x(i)} - 2\mathcal{O}(\Delta x^3)}{\Delta x^2}$$
and when I calculcate the above difference using this I get
$$\frac{u_{i+1}}{\Delta x^2} - 2\frac{u_{x(i)}}{\Delta x} - \frac{u_{i-1}}{\Delta x^2} - 2\frac{\mathcal{O}(\Delta x^3)}{\Delta x^2}.$$




I can't get further and it seems wrong. Is my approach wrong and if so how should I do it instead?


Answer



You should consider one more term in the expansion:
$$
u_{i\pm 1}=u_i \pm u'\Delta x+\frac{\Delta x^2}2u''\pm\frac{\Delta x^3}{6}u'''+O(\Delta x^4).
$$



Then you will see that this term will cancel out and you will end up with $\ldots +O(\Delta x^4)/\Delta x^2=\ldots +O(\Delta x^2)$


No comments:

Post a Comment

real analysis - How to find $lim_{hrightarrow 0}frac{sin(ha)}{h}$

How to find $\lim_{h\rightarrow 0}\frac{\sin(ha)}{h}$ without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...