Brad Klee on Tue, 11 Dec 2018 17:34:18 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Integration of periodic functions |
> For periodic functions integrated over a period, the trapezoidal or midpoint methods can > give much more accurate results than other numerical integration methods. This may be true with sufficiently simple functions, but in general if curvature is not equally distributed, then an accurate algorithm would need to account for statistical variation by deciding on an unequal partition of the domain. If it's possible to calculate the Fourier transform and the coefficients decrease regularly, then we can write a 100% accurate summation and control precision with a truncation parameter. In this particular case, try: 1.0*sum(n=1,100,binomial(2*n,n)*(-12/10)*(-3/10)^(2*n-1)) Another technique for arbitrary precision is to quadrisect the function on intervals [ n*Pi/2 , (n+1)*Pi/2 ], n=0,1,2,3; construct polynomial representations on each part, and sum the integrals of all monomials. On an earlier thread, I gave an example for function sinc(x)^2 : > http://pari.math.u-bordeaux.fr/archives/pari-users-1810/msg00037.html > > http://pari.math.u-bordeaux.fr/archives/pari-users-1810/msg00041.html The Polya walk coefficients are a better example for geometric-numeric integration, because the integrand reaches a pole on the real domain. See for example: http://mathworld.wolfram.com/PolyasRandomWalkConstants.html https://oeis.org/A086232 https://oeis.org/A039699 Cheers, Brad