3

For periodic functions on a regularly spaced grid, the trapezoidal rule is supposed to converge incredibly quickly ( the error estimate decreasing as $O(e^{-\eta/h})$ for step size $h$ ).

However, I don't believe this is true for non-uniform grids. What is the error estimate for a non-uniform grid, and how does it converge? (specifically for a logarithmic grid, but more generally if possible).

Andrew Spott
  • 1,155
  • 1
  • 9
  • 22
  • Why would you use a logarithmic grid for a periodic function? Could you describe in a bit more detail what it is you want to do, and what you hope to achieve with it? – Pedro Feb 11 '14 at 22:16
  • @Pedro: I calculate a series of eigenvectors for a differential equation on a logarithmic grid (the differential equation has a singularity at r = 0, so the logarithmic grid helps to make it easier to calculate near the singularity). However, the positive eigenvalues (which are calculated on a logarithmic grid), are periodic, and I need to calculate the integral of products of these eigenvectors. ($\int_0^{\infty} f1(r); r; f2(r); dr$). Besides all that though, I'm just curious about the error estimate qualities of the trapezoidal rule on a non-uniform grid. – Andrew Spott Feb 11 '14 at 23:51
  • @Pedro: see http://scicomp.stackexchange.com/questions/10741/integrating-highly-oscillatory-functions for the specific problem I'm having. – Andrew Spott Feb 11 '14 at 23:53

1 Answers1

3

The trapezoidal rule is an interpolating quadrature where you incur an error on each interval that is independent from that of other intervals. In particular, if you have a set of disjoint intervals $I_i$ of size $h_i$ so that $\bigcup_i I_i = I=[a,b]$ is the interval that you want to integrate over, then the total error is given by an expression of the form $$ e = \sum_i h_i^3 \zeta_i $$ where $\zeta_i$ is a measure of the second derivative of your integrand on interval $i$. In particular, if the function is linear, then the error is zero. Also, since the number of intervals is proportional to $1/h$ in the case of a uniform mesh, you get an error bound of the form $$ e = {\cal O}(h^2). $$

Wolfgang Bangerth
  • 55,373
  • 59
  • 119