Composite Open Newton-Cotes

547 Views Asked by At

I have a set of points $x_i=\left(i-\frac{1}{2}\right)\Delta x$, for $i=1,...,N$ and the value of a function $f(x)=f(x_i)=f_i$ evaluated at the points $x_i$.

I would like to numerically integrate $f$ from $0$ to $N\Delta x$, i.e.,

$$ \int_0^{N\Delta x}{f(x)dx} $$

Since my points $x_i$ are not endpoints, I can't use the trapezoidal rule, Simpsons rule etc. I tried to use the midpoint rule:

$$ \int_0^{N\Delta x}{f(x)dx}\approx \Delta x\cdot\sum_{i=1}^{N}{f(x_i)} $$

However, the error in the midpoint rule is too big. I would like a better numerical method for the open interval I have, but I am struggling with the open Newton-Cotes formulas given, because the step size of this formulas does not match with what I have. Any suggestions to how should I begin to approach it?

1

There are 1 best solutions below

4
On BEST ANSWER

Simpson's Rule would become $$\int_{-\frac32}^{\frac32}f(x)dx\approx\frac98f(-1)+\frac34f(0)+\frac98f(1)$$ I may post better results when I get off of work.

EDIT: Home again, so here goes: $$f(0)=\int_{-\frac12}^{\frac12}f(x)dx-\frac{1}{24}f^{(2)}(\xi)$$ $$f\left(-\frac12\right)+f\left(-\frac12\right)=\int_{-1}^{1}f(x)dx-\frac{1}{12}f^{(2)}(\xi)$$ $$\frac98f(-1)+\frac34f(0)+\frac98f(1)=\int_{-\frac32}^{\frac32}f(x)dx-\frac{21}{640}f^{(4)}(\xi)$$ $$\frac{13}{12}f\left(-\frac32\right)+\frac{11}{12}f\left(-\frac12\right)+\frac{11}{12}f\left(\frac12\right)+\frac{13}{12}f\left(\frac32\right)=\int_{-2}^{2}f(x)dx-\frac{103}{1440}f^{(4)}(\xi)$$ $$\frac{1375}{1152}f(-2)+\frac{125}{288}f(-1)+\frac{335}{192}f(0)+\frac{125}{288}f(1)+\frac{1375}{1152}f(2)=\int_{-\frac52}^{\frac52}f(x)dx-\frac{5575}{193536}f^{(6)}(\xi)$$ $$\frac{741}{640}f\left(-\frac52\right)+\frac{417}{640}f\left(-\frac32\right)+\frac{381}{320}f\left(-\frac12\right)+\frac{381}{320}f\left(\frac12\right)+\frac{417}{640}f\left(\frac32\right)+\frac{741}{640}f\left(\frac52\right)=\int_{-3}^{3}f(x)dx-\frac{1111}{17920}f^{(6)}(\xi)$$ You can get these formulas by just solving $N$ equations in $N$ unknowns for them to be exact for polynomials of degree up to $N-1$. If the number of intervals is not divisible by $3$ one or two copies of the $4$ point formula could be used so as to match the number of intervals much like the usage of Simpson's $3/8$ rule along with his $1/3$ rule when the number of intervals is odd.

I didn't show the $7$ point formula because it has some negative weights, indicating an error-magnifying formula. If you want higher-order formulas you might be better off using formulas that use least-squares fits to the data with less than the highest-order possible polynomial. Due to the lateness of the hour I haven't derived any of these.