- #1
cyberpotato
- 2
- 0
- TL;DR Summary
- Memory challenges in numerically integrating oscillatory functions using FFT in Python. Starting this thread here as a related thread was discussed earlier: https://www.physicsforums.com/threads/numerical-integration-fourier-transform-or-brute-force.283916/#post-2030214
Hello!
I need to numerically integrate a frequently oscillating, decaying complex function over the interval from 0 to infinity, which is continuous. For brevity, I provide the general integral view
$$\int_{0}^{\infty} A(t)e^{e^{iw't}}dt$$.
I'm using Python libraries for this task. Initially, I tried the quadrature method, but encountered convergence issues when integrating over a large interval. To address this, I started subdividing the integration interval into subintervals, integrating them separately, and summing the results until convergence. However, this process was time-consuming.
To speed up the integration, I switched to using the fast Fourier transform (FFT) from scipy.fft. While this approach improved integration speed, a new issue arose. When passing a vector of function values to scipy.fft, I faced memory constraints for very large integration intervals with small step sizes. To solve this, I considered subdividing the large integration interval, performing FFT on each subinterval, and summing the results until convergence.
Is it correct to solve this issue by breaking down the large integration interval into subintervals, performing FFT on each subinterval, and summing until convergence? Additionally, are there alternative methods for integrating such functions that I should consider?
I need to numerically integrate a frequently oscillating, decaying complex function over the interval from 0 to infinity, which is continuous. For brevity, I provide the general integral view
$$\int_{0}^{\infty} A(t)e^{e^{iw't}}dt$$.
I'm using Python libraries for this task. Initially, I tried the quadrature method, but encountered convergence issues when integrating over a large interval. To address this, I started subdividing the integration interval into subintervals, integrating them separately, and summing the results until convergence. However, this process was time-consuming.
To speed up the integration, I switched to using the fast Fourier transform (FFT) from scipy.fft. While this approach improved integration speed, a new issue arose. When passing a vector of function values to scipy.fft, I faced memory constraints for very large integration intervals with small step sizes. To solve this, I considered subdividing the large integration interval, performing FFT on each subinterval, and summing the results until convergence.
Is it correct to solve this issue by breaking down the large integration interval into subintervals, performing FFT on each subinterval, and summing until convergence? Additionally, are there alternative methods for integrating such functions that I should consider?