I have a solution of a 1D wave on a grid (tangent hyperbolic variation) and now I want to interpolate the obtained solution to a new grid with the same number of points as the previous grid but the domain length may or may not change. What are good techniques to do so? I read about Lagrange interpolation, Hermite interpolation etc. Are there any new better techniques to do so for interpolation of 1D solution?
-
1$\begingroup$ The choice of method depends on the features of the interpolated function, and to some extent on the features of the grids. For example, if you want to remap a Heaviside step function to a new grid then using trigonometric high-order interpolation would not work well. But if your function is something like a smooth, well-resolved Gaussian then a high-order method should be good. $\endgroup$– Maxim UmanskyCommented Aug 27, 2022 at 17:21
-
2$\begingroup$ Spline interpolation is hard to beat if you don't have any information about how the original function is supposed to look like between two nodes. $\endgroup$– Wolfgang BangerthCommented Aug 27, 2022 at 20:11
1 Answer
A "better technique" is rather subjective. You mean faster, more accurate, easier to program, something else??
Since it's only 1-D, the numerical cost is small (compared to 2D/3D) and there are many algorithms available. I would suggest you to try the available algorithms and judge for yourself.
For similar cases, I have had great results using Gaussian Process Regression (in your case, since it's a wave I would try a cos() kernel), but if you want a more conventional approach look into PCHIP interpolation, this one has the nice property of keeping the monotonicity of the original data, so it should give a good representation of your wave.