C/C++ Interpolation of a rapidly oscillating function

  • Thread starter Thread starter CAF123
  • Start date Start date
  • Tags Tags
    Interpolation
AI Thread Summary
The discussion revolves around the challenges of interpolating an analytic function F(x,y,z) across a grid in the presence of oscillations, particularly as y approaches zero. Linear interpolation is effective in most of the phase space, but fails in regions where F oscillates heavily. The use of splines is considered, but concerns arise regarding their effectiveness given the rapid oscillations. Suggestions include mapping the axes to correct the oscillation period and employing a 3D Fourier transform for interpolation. The Nyquist-Shannon theorem is referenced, indicating limitations in extracting information beyond the grid's resolution. The analytical nature of F is highlighted, suggesting that its representation as a power series could inform the choice of interpolation method. The discussion also prompts an examination of the oscillation characteristics, such as amplitude and frequency, and explores the possibility of combining trigonometric functions with interpolation techniques to better model the behavior of F as y approaches zero.
CAF123
Gold Member
Messages
2,918
Reaction score
87
I have an analytic function F(x,y,z) and grids in x,y and z. I would like to reproduce the values I get for F at a given x,y and z through carefully interpolating the values given in the grids I have in each of these variables. The problem is that in some part of the x,y,z phase space, namely when y->0, the function F(x,y,z) oscillates very heavily and I am not sure how to tackle the interpolation.

My interpolation routine is in Cpp and, for a good part of my phase space, linear interpolation is OK but for y->0 I see it is not and was thinking of using splines. But, I see only a max 2D spline given in the gsl_library and I am anyway not sure if splines would help here when the function oscillates rapidly.

Thanks in advance for any comments.
 
Technology news on Phys.org
What form does the oscillation take?
Map the axes through a function that corrects the period to be a constant.
Consider using a 3D Fourier transform as the interpolator.
 
CAF123 said:
I am anyway not sure if splines would help here when the function oscillates rapidly.
Probably not, you can't extract more information than the grid can encode (oscillations at twice the interval of the grid points by the Nyquist-Shannon theorem).

Below this limit you could extract more accuracy using e.g. https://www.geometrictools.com/GTE/Mathematics/IntpTricubic3.h.
 
Last edited:
Is there some other properties of the function ##F(x,y,z)## that can be used in decision what interpolation would be the best for it
- It is analytical . Does it can be represented in the following form
$$F(x,y,z)=\sum_{n=0}^{\infty} a_n (x-x_0)^n+b_n(y-y_0)^n+c_n(z-z_0)^n$$
- It oscillates. What are features of those oscillations ? ( amplitude, frequency property )
- Why oscillates more when ##y \to 0## ?
Maybe combination of a trigonometric function and an interpolation can describe it better.
 
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...

Similar threads

Replies
1
Views
11K
Replies
1
Views
2K
Replies
19
Views
5K
Replies
8
Views
2K
Replies
2
Views
2K
Replies
23
Views
3K
Replies
4
Views
1K
Back
Top