How to define the order of a 'composite' finite differences aproximation?

67 Views Asked by At

If I'm trying to aproximate the solution to a BVP, such as this unidimentional Poisson equation with Dirichlet and Neumann border conditions:

$$\dfrac{d^2u(x)}{dx^2}=\exp\left(-x^2\right),\quad \dfrac{du(0)}{dx}=-1, \quad u(1)=1,\quad 0\leq x \leq 1$$

I'll naturally define: $$w_i=u(0+ih)$$ With $h$ as the step size. $$\dfrac{d^2u(x)}{dx^2}=\dfrac{w_{i+1}-2w_{i}+w_{i-1}}{h^2}+\text{O}\left(h^2\right)=\exp\left(-(ih)^2\right)\tag{1}\label{1}$$

And, in order to take into account the Neumann condition:

$$\dfrac{du(0)}{dx}=\dfrac{w_1-w_0}{h}+\text{O}(h)=-1\tag{2}\label{2}$$

Such that:

$$w_0=w_1+h+\text{O}(h^2)\tag{3}\label{3}$$

This way, the first equation of the system using equation \eqref{1} and \eqref{3}:

$$\dfrac{w_{2}-2w_{1}+w_{0}}{h^2}=\exp(-h^2)=\dfrac{w_{2}-2w_{1}+(w_1+h)}{h^2}\tag{4}\label{4}$$

$$w_{2}-w_{1}=h^2\exp(-h^2)-h\tag{5}\label{5}$$

And the last equation, using the Dirichlet condition:

$$\dfrac{w_{n}-2w_{n-1}+w_{n-2}}{h^2}=\exp(-((n-1)h)^2)\tag{6}\label{6}$$ $$-2w_{n-1}+w_{n-2}=h^2\exp(-((n-1)h)^2)-1\tag{7}\label{7}$$

Therefore, the matrix form of the system:

$$\begin{bmatrix}-1 & 1 & 0 & 0 & \dots & 0\\ 1 & -2 & 1 & 0 & \dots & 0\\ 0 & 1 & -2 & 1 & \dots & 0\\ \vdots & \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & \dots & \dots & 0 & 1 & -2\end{bmatrix}\begin{bmatrix}w_1\\w_2\\w_3\\ \vdots\\ w_{n-1}\end{bmatrix}=\begin{bmatrix}h^2\exp(-h^2)-h\\h^2\exp(-(2h)^2)\\h^2\exp(-(3h)^2)\\ \vdots\\ h^2\exp(-((n-1)h)^2)-1\end{bmatrix}$$

So, my question is: What's the order of the entire aproximation?

I'm aware that the second derivative it's under an aproximation of second order, but what's the influence of the Forward Difference \eqref{2} aproximation on the overall process? Does it propagate over the system?

Thank you very much!