The equation is $$\frac{\partial}{\partial x}\left(u\frac{\partial u}{\partial x}\right)=f(x)\\ 0<x<1, u(0)=u(1)=0$$

I'm discretizing this PDE using FVM as follows: $0=x_0=x_{1/2}<x_1<x_{3/2}<\dots<x_{N+1/2}=x_{N+1}=1$



$$\int\limits_{x_{i-1/2}}^{x_{i+1/2}} \frac{\partial}{\partial x}\left(u\frac{\partial u}{\partial x}\right)dx=(uu_x)(x_{i+1/2})-(uu_x)(x_{i-1/2})=\int\limits_{x_{i-1/2}}^{x_{i+1/2}}f(x)dx$$

Using finite differences, obtain

$$u_{i+1/2}\frac{u_{i+1}-u_i}{h_{i+1/2}}-u_{i-1/2}\frac{u_{i}-u_{i-1}}{h_{i-1/2}}=h_if_i$$ where $u_0=u_{N+1}=0$, $f_i:=\frac1h_i\int\limits_{x_{i-1/2}}^{x_{i+1/2}}f(x)dx$

So now comes the part where I got really stuck. I want to determine the truncation error of this discretization. For this I substitute the Taylor expansion of the exact solution into the equation:



I'm not sure what to do with the terms $u(x_{i+1/2})$ and $u(x_{i-1/2})$ to arrive at the truncation error, which I think will be $O(h^2)$. I'd appreciate some help with this.

I've already tried to expand these terms about $x_{i-1/2}$ but that wasn't quite useful.

  • 1
    $\begingroup$ You have not specified your scheme completely. You need to write $u_{i+1/2}$ in terms of the $\{ u_j \}$ values. Then you can Taylor expand everything about $x_i$. $\endgroup$ – cpraveen Mar 24 at 9:25
  • $\begingroup$ @cpraveen Do you mean write $u_{i+1/2}$ as the average of $u_i$ and $u_{i-1}$? $\endgroup$ – sequence Mar 24 at 13:03
  • 1
    $\begingroup$ yes, average would be a reasonable approximation to try. $\endgroup$ – cpraveen Mar 24 at 13:50
  • $\begingroup$ @cpraveen I did this approximation and expanded about $x_i$, set $h_{i+1/2}=\alpha h_i$, $h_{i-1/2}=\beta h_i$, but then I get this: $u_x(x_i)\left( \frac{(\alpha+\beta)u(x_i)}{2} + \frac{(\alpha^2+\beta^2)h_i}{4}u_{xx}(x_i)+O(h_i) \right)+u_{xx}(x_i)\left( \frac{(\alpha+\beta)h_i}{2}+O(h_i^2) \right)+O(h_i^3)$. Now we can set $\alpha = \beta = 0$, but this gives an $O(h_i)$ truncation instead of $O(h_i^2)$. What could possibly be wrong? $\endgroup$ – sequence Mar 24 at 16:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.