Memory issues in numerical integration of oscillatory function

Click For Summary

Discussion Overview

The discussion revolves around the numerical integration of a frequently oscillating, decaying complex function over the interval from 0 to infinity. Participants explore various methods for improving convergence and efficiency in the integration process, particularly using Python libraries and techniques such as the fast Fourier transform (FFT).

Discussion Character

  • Exploratory, Technical explanation, Debate/contested, Mathematical reasoning

Main Points Raised

  • One participant describes their initial approach using quadrature methods and the challenges faced with convergence over large intervals, leading to a subdivision strategy.
  • Another participant suggests evaluating the integral using a periodicity property, proposing the definition of \( I_n \) to approximate the integral as a sum of terms, depending on how fast \( |I_n| \) decays with \( n \).
  • A different viewpoint discusses the application of the scaling theorem for FFTs and the potential interpolation issues that may arise, along with the necessity of windowing segments to mitigate Gibbs oscillations.
  • One participant seeks clarification on the periodicity approach and its application to a specific case where \( A(t) = 1 \), questioning if the integral can be expressed as a sum over a finite range.

Areas of Agreement / Disagreement

Participants express various methods and approaches to the problem, but there is no consensus on a single solution or method. Multiple competing views and strategies remain present in the discussion.

Contextual Notes

Participants mention potential issues related to memory constraints when using FFT on large intervals and the need for careful handling of oscillatory behavior in the integration process. The discussion highlights the complexity of numerical integration for oscillatory functions without resolving specific mathematical steps or assumptions.

Who May Find This Useful

This discussion may be useful for researchers or practitioners involved in numerical analysis, particularly those working with oscillatory functions in physics or engineering contexts.

cyberpotato
Messages
2
Reaction score
0
TL;DR
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?
 
Physics news on Phys.org
It may be worth setting <br /> I_n = \int_{0}^{2\pi/\omega&#039;} A\left(\frac{2n\pi}{\omega&#039;} + t\right)e^{e^{i\omega&#039;t}}\,dt, \qquad n \geq 0 and seeing how fast |I_n| decays with n. Your integral can then be approximated as \sum_{n=0}^N I_n for some N.
 
  • Informative
Likes   Reactions: Delta2
I think what you are asking is that you have,
$$
\int_0^{\infty} A(t)[1 + e^{i\omega t}+ \frac{e^{2i\omega t}}{2!} +\frac{e^{3i\omega t}}{3!} + ...]dt
$$
and wish to take the FFT of your time series against each succeeding term in the expansion. Firstly, you must apply the scaling theorem for FFTs to each term (see Scaling Theorem )which will probably result in interpolation issues which you must resolve. Secondly, by breaking up your time series into segments and taking the FFT of each segment Gibbs oscillations raise their ugly heads. Therefore you must window each segment using a Hamming window or whatnot.
 
  • Informative
Likes   Reactions: pbuk and Delta2
pasmith said:
It may be worth setting <br /> I_n = \int_{0}^{2\pi/\omega&#039;} A\left(\frac{2n\pi}{\omega&#039;} + t\right)e^{e^{i\omega&#039;t}}\,dt, \qquad n \geq 0 and seeing how fast |I_n| decays with n. Your integral can then be approximated as \sum_{n=0}^N I_n for some N.
Your approach looks very interesting, thank you. I'm trying to understand it. Are you using the periodicity property of the exp(iωt) function? In the case A(t) = 1, the integral will have the form:
$$\int_{0}^{\infty }e^{e^{i\omega t}}=\sum_{n=0}^N \int_{0}^{2\pi/\omega}e^{e^{i\omega t}}$$
Is that right?
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 11 ·
Replies
11
Views
12K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
8K
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K