# For a non-linear PDEs should the source term be discretised at $u_j$ or averaged over $(u_{j+1} + u_{j-1})/2$?

The non-linear Poisson equation in one-dimension,

$$0 = \frac{\partial^2u}{\partial x^2} - f(u)$$

can be discretised as to give,

$$u_{j-1} -2u_{j} + u_{j+1} = h^2 f(u_j)$$

where $h$ is the step size of the mesh.

Is there any advantage (in general or not) to write the non-linear source term as the average value of the solution variable $\bar{u_j}$ over the neighbouring mesh points?

For example,

$$f(u_j) \rightarrow f(\bar{u_j})$$

where,

$$\bar{u_j} = \frac{1}{2}\left( u_{j-1} + u_{j+1} \right)$$

I have noticed in practice that this sometimes improves the solution stability when using relaxation methods.

• The gain in stability is probably due to the smoothing out of high frequencies.
– Jan
Feb 5 '14 at 8:50
• Yes, high frequency components was (still is!) the main problem I was seeing. Feb 5 '14 at 9:05

For your example equation, taking the average approach, the local consistency error $$\frac{1}{h^2}[u(x-h) - 2 u(x) + u(x+h)]-f(\frac{1}{2}[u(x-h)+u(x+h)]) = \frac{1}{2}f_uu_{xx}h^2 + hot.$$ will be of order $2$ (instead of order $3$). ($hot.$ means higher order terms)

Therefore, if your overall approximation is of order $1$, e.g. if you use upwind somewhere, then it doesn't matter.

If you use higher order schemes, then this approach will limit of your convergence rate.

• So to keep the local consistency error as low as possible I should stick with the original approach (not to average)? Feb 5 '14 at 9:07
• Yes, I would do so. The main thing is to be consistent. If you run into stability issues, then you may think of such stabilizations.
– Jan
Feb 5 '14 at 9:17

If you look at it from a Galerkin perspective, the right side could also be approximated by

$$\frac16(f(u_{i-1})+4f(u_i)+f(u_{i+1})),$$

the Kepler formula, I believe. This would be valid for first sampling $f(u)$ and then approximating by a piecewise linear function. If the sampled $u$ is approximated piecewise linearly, then the non-linearity of $f$ will destroy this property, giving no general rule.