3

Consider the following FDM problem:


Find $u$ such that $$ -u^{\prime \prime}(x)+b(x) u^{\prime}(x)+c(x) u(x)=f(x) ~~\text { in }(0,1), $$ and conditions $u(0) = u(1) = 0$, where $$ b(x)=x^{2}, \qquad c(x)=1+x, \qquad f(x)=-2+13 x^{2}+3 x^{3}-x^{4}-5 x^{5}. $$


I am trying to find an upper bound on the local truncation error using finite difference method (forward, backward, and centered). So far, I have the following:

Approximate $u\left(x_{i}\right)$ respectively by $U_{i}, V_{i}$, and $W_{i}$, where $U_{i}$ is the solution of the finite-difference scheme: $$ \frac{1}{h^{2}}\left[-U_{i-1}+2 U_{i}-U_{i+1}\right]+\frac{b_{i}}{h}\left[U_{i}-U_{i-1}\right]+c_{i} U_{i}=f_{i}, \tag3$$ $V_{i}$ is the solution of $$ \frac{1}{h^{2}}\left[-V_{i-1}+2 V_{i}-V_{i+1}\right]+\frac{b_{i}}{h}\left[V_{i+1}-V_{i}\right]+c_{i} V_{i}=f_{i}, \tag4$$ and $W_{i}$ is the solution of $$ \frac{1}{h^{2}}\left[-W_{i-1}+2 W_{i}-W_{i+1}\right]+\frac{b_{i}}{2 h}\left[W_{i+1}-W_{i-1}\right]+c_{i} W_{i}=f_{i}, \tag5$$ with $U_{0}=V_{0}=W_{0}=U_{N+1}=V_{N+1}=W_{N+1}=0$.

I know that I have to use Taylor's formula, but don't know how find the upper bound on the local truncation error for (3), (4), and (5), or even how to derive the truncation error.

I am also trying to find the order. (3) has order O(h2), and the other two have order O(h) - is this correct?

Can anyone help me here?

1 Answers1

2

Looking at the last scheme, the approximations being used are are follows:

$$ u''(x_i) = \frac{1}{h^2}\left(u(x_{i+1})-2u(x_i)+u(x_{i-1})\right)-\frac{h^2}{12} u^{(4)}(\xi_i) $$

$$ u'(x_i) = \frac{1}{2h}(u(x_{i+1})-u(x_{i-1})) + \frac{h^2}{6}u^{(3)}(\zeta_i) $$

So, when you write the equation at $x = x_i$, and denote $W_i = u(x_i)$, you get $$ -\dfrac{W_{i+1}-2W_i+W_{i-1}}{h^2} + b_ i \dfrac{W_{i+1}-W_{i-1}}{2h} + c_i W_i = f_i + E_i $$ where $E_i = -\frac{h^2}{14} u^{(4)}(\xi_i)-\frac{h^2}{6}\cdot b_i \,u^{(3)}(\zeta_i)$.

Since the system your will actually solve does not include the $E_i$ terms, the global error can now be estimated by standard perturbation analysis on the rhs of a linear system. Basically, you are solving some system $A W = F$, instead of $A(W+\delta W) = F+ \delta F$, which leads to an (absolute) error estimate $\|\delta W\| \leq \|A^{-1}\| \|\delta F\|$.

PierreCarre
  • 23,092
  • 1
  • 20
  • 36
  • What is meant by an upper bound? I am assuming that is the error itself? – silver58 Feb 08 '22 at 14:55
  • @silver58 It is an upper bound because we do not know the exact value of the error. If that was the case, we would have the exact solution. Regarding the local error, since we do not know exactly what are the points $\xi_i, \zeta_i$, only that they belong to $(0,1)$, we get inequalities like $$ |u^{(4)}(\xi_i)| \leq \sup_{x \in (0,1)}|u^{(4)}(t)|$$, which lead to upper bounds for the error. This means that we conclude that the error is surely smaller than a certain threshold, but you cannot pinpoint its actual value. – PierreCarre Feb 08 '22 at 15:11
  • Thanks. What are the errors for schemes (3) and (4)? – silver58 Feb 08 '22 at 17:01
  • 1
    The difference formulas for $u'(x_i)$ in (3) and (4) are $O(h)$ instead of $O(h^2)$, so that turns out to be the dominant error term. – PierreCarre Feb 08 '22 at 17:08
  • What are the errors, can you write them for (3) and (4) as you've done for (5)? – silver58 Feb 08 '22 at 17:25
  • @silver58 I think you can do that by yourself... You just need to combine Taylor's formula for $u(x+h)$ and $u(x-h)$ to get the error formula for the forward (4) and backward (3) differences for the first derivative. – PierreCarre Feb 08 '22 at 17:34
  • Is this correct: \begin{aligned} \frac{f(x+h)-f(x)}{h} &=\frac{1}{h}\left[\mathrm{h} f^{\prime}(x)+\frac{h^{2}}{2 !} f^{\prime \prime}(x)+\frac{h^{3}}{3 !} f^{\prime \prime \prime}(x)+\ldots\right] \ &=f^{\prime}(x)+O(h) \end{aligned} Is there no way to write it without O? – silver58 Feb 08 '22 at 18:07
  • Yes, it is correct. The $O(h)$ term is given by $\frac h2 f''(\xi).$ – PierreCarre Feb 08 '22 at 18:09