Questions tagged [interpolation]
Interpolation is the process of estimating the values of a function, when the function's values are known only at a particular set of points. Questions on interpolation in one or more dimensions, as well as algorithms for doing so, should have this tag.
164
questions
3
votes
1answer
111 views
At which stage to interpolate?
Assume I have a multidimensional grid $G$. I consider two functions $f(x)$ and $g(x)$. I have solved the values for the functions over all grid points $x \in G$. Let me now be interested in some third ...
0
votes
1answer
76 views
Finite element interpolation
I have a finite element solver that I implemented in MATLAB. I am calculating a specific potential function that is constant in each tetrahedral element. The question is, I want to be able to ...
1
vote
0answers
29 views
Interpolate location based on triangular sensor array
There are 3 sensors (A, B, C) on a plane, located in the corners of a (known) equilateral triangle.
I want to calculate the (2D) location of an object (X) inside that triangle.
One sensor returns one ...
0
votes
0answers
53 views
Interpolation of a Concave Mesh
I would like to have an algorithm that interpolates the values attached to nodes in a concave mesh mesh.
To be me precise, assume we have a point cloud P (e.g. in 3 dimensions) and a list of edges E ...
4
votes
4answers
133 views
Getting torsion and curvature out of ODE solution skeleton
Suppose I have solved an ODE $v'(t) = f(t,x)$ via some adaptive stepper, such as RK4 or Dormand-Prince, generating a list of points $\{(t_i, v_i, v_i' = f(t_i, v_i))\}_{i=0}^{n-1}$.
I wish to use this ...
1
vote
1answer
100 views
Factorization of cubic spline interpolation matrix
In cubic spline interpolation, we use the set of knots and function values $(x_i,y_i),i=1,...,n$ to construct a (tridiagonal) system of equations for the unknowns $\sigma_i$:
$$
h_{i-1}\sigma_{i-1} + ...
2
votes
2answers
151 views
What are the best ways to interpolate a vector field inside (convex) polygons?
I want to interpolate a vector field inside convex polygons in a polygonal mesh.
For triangular meshes the scheme uses a piecewise constant interpolation in the triangle, discretized at the center of ...
1
vote
1answer
363 views
What is the relationship between shape functions, interpolation functions, and degrees of freedom?
I am a newbie in FEM. I would like to get clarity regarding a few questions on shape functions in this post (please use as simple language as possible).
What is the relation between Shape function ...
1
vote
0answers
70 views
How to approach geographic data interpolation by distance?
let's say I have a set of geographic locations (lat, lng) resulting from a query. Those locations have some kind of internal ranking, my set is sorted by this number in a descending order.
Now I'm ...
11
votes
1answer
193 views
Implications of thermodynamic inconsistency in CFD calculations
During my PhD work, I had to use tabulated values of thermodynamic properties of gases in some Computational Fluid Dynamics (CFD in short) simulations.
My tables are discretized in temperature and ...
1
vote
1answer
53 views
Monotonicity preserving interpolant in 1D
I have a dataset $\{x_i, y_i\}_{i=0}^{n-1}$ where $x_0 < x_1 < \cdots x_{n-1}$ (not uniformly spaced), and, in addition $y_0 < y_1 < \cdots y_{n-1}$. So it feels natural to assume that $...
3
votes
1answer
303 views
Get the roots of a Hermite interpolating polynomial
I am using Python 3.7 to write a program that requires me to calculate the root of the Hermite interpolating polynomial, given two points $\epsilon_0$, $\epsilon_1$, the function ($d(\epsilon_0)$,$d(\...
1
vote
3answers
307 views
Bilinear interpolation for large grids
I need to make a bilinear interpolation of a function $Y(i,j)$ tabulated on a $100\times 100$ grid. I tried to do it with the Fortran polin2.f and ...
3
votes
2answers
104 views
How to reconstruct a 2D field from its integral?
General question
I work on the plane where I have a two-dimensional shape $V$ that is cut in a collection of parts $\{V_i\}$ that do not overlap
$
V_i ~~\text{s.t.}~~ \bigcup_i \overline{V}_i = \...
2
votes
2answers
650 views
Interpolation vs. Neural network
I am seeking knowledge from the community. I am solving a transport PDE (conservation of solute mass) using COMSOL. At each Newton-Raphson iteration, I need to update a constant called $Kd$ for some ...
3
votes
0answers
140 views
Derivative of Whittaker-Shannon interpolant
Last time we looked at how to improve the accuracy of Whittaker-Shannon interpolation, where user njuffa demonstrated that judicious use of sin_pi could greatly ...
1
vote
1answer
98 views
Interpolating the gradient of a cylindrically symmetric potential field that's 'supposed to' obey the Laplace equation?
The script below tries to implement a Jacobi iterative relaxation of a potential field for an electrostatic lens.
It's hot-off-the-press and I've just started to debug and look for things to test it ...
1
vote
1answer
2k views
Gnuplot: How can I fit a range of points (out of the entire data) to a function?
I have a set of data obtained for the I-V characteristics of an LED.
...
0
votes
0answers
39 views
extrapolation/interpolation in fmincg.m
Can you tell me these equations come from where in MATLAB fmincg.m?
...
0
votes
1answer
82 views
Interpolation of function onto mesh gives different results, depending on mesh density
I wanted to test the numerical accuracy of my program. For that I wanted to interpolate the function $$f=I_0\exp\left(-100x^2\right)\exp(-100y^2)$$ onto a grid, defined on $$\Omega=[0,1]^2$$ by using ...
0
votes
1answer
106 views
Creating an Interpolation of a w = f(x,y,z) function
I am trying to finish a series of interpolation functions.
The problem is more related with organizing the data than how to do the interpolations.
Using the RegularGridInterpolator, I created this ...
0
votes
1answer
1k views
Problems with python's interp 2D
I am writing some functions to interpolate data. While using interp2D, somehow, a sample matrix works but when I change the size of the matrix, it returns an error.
...
2
votes
0answers
87 views
Grid Data Interpolation
What are the most sophisticated methods for interpolating a scalar field say Electric or Magnetic Field on a 3-D grid?
I have scalar data on a meshgrid with equal spacing. I would like to use an ...
1
vote
0answers
33 views
Cardinal B-Splines with derivative information
Have Schoenberg's cardinal B-splines been extended to accept derivative information at each knot, similar to how Lagrange interpolation can be improved by Hermite interpolation?
3
votes
0answers
112 views
WENO5 scheme in a staggered grid
I'm trying to use the finite-difference WENO scheme to solve the 2D density conservation law with axial symmetry (coordinates $r,z$):
$\frac{\partial \rho}{\partial t}+\nabla \cdot (\rho \vec{v}) = \...
16
votes
6answers
2k views
Example of a continuous function that is difficult to approximate with polynomials
For teaching purposes I'd need a continuous function of a single variable that is "difficult" to approximate with polynomials, i.e. one would need very high powers in a power series to "fit" this ...
5
votes
0answers
576 views
Cressman interpolation and objective analysis
I have read this question and answer ā Interpolation of scattered data to a regular grid in python and I am doing something similar as I have temperature values of the atmosphere at different heights ...
0
votes
1answer
526 views
Python - Fitting a function to data without using Scipy
I'm trying to write a program in python which doesn't need to use extra packages like numpy and scipy. In one part of the project, if I can interpolate a function to a set of data, I can save ...
5
votes
2answers
171 views
Polynomial approximation spaces
I often see people using products of 1-D polynomials to do interpolation or projection of smooth multivariate functions over grids or cells because it is intuitive and simple to implement. What are ...
8
votes
1answer
184 views
What are these oscillations?
I have a function $g(x)$ defined numerically that is sort of in between a Gaussian and a Lorentzian. It decays much slower than a Gaussian, but still faster than a simple inverse power.
I need to ...
1
vote
1answer
61 views
Wanted: smoothing time domain transform
Let $A$ be a finite (and small-ish) set of positive real numbers and 0. Let $B$ be a subset of $\mathbb N^0$, up to some (small-ish) bound.
I have a function $f(t)$, $A \rightarrow B$ that is ...
5
votes
0answers
74 views
Automatic differentiation of barycentric rational functions
By a barycentric rational interpolant we understand a function of the form
\begin{align*}
r(t) := \frac{\sum_{i=0}^{n-1} \frac{w_i y_i}{t-t_i} }{ \sum_{i=0}^{n-1} \frac{w_i}{t-t_i}}
\end{align*}
In ...
7
votes
3answers
157 views
Evaluating an integral numerically at many points
Given a real function $f$, how can one efficiently evaluate $\int_0^{a_i}f(x)dx$ for millions of different $a_i$?
Applying a standard quadrature method (such as Simpson's rule or Gaussian quadrature) ...
2
votes
0answers
32 views
Are planar 2nd order NURBS curve segments exactly the segments of conic sections?
I think it is well known that 2nd order NURBS curve can describe any segment of a conic section. Such a segment has 7 degrees of freedom, take an ellipse arc for example: the ellipse itself has 5 ...
2
votes
1answer
2k views
Three dimensional irregular grid data interpolation to regular grid
I have three-dimensional radar reflectivity data obtained as voxels (scans, rays, altitudes). The data has been sampled at irregular spacings and I want to convert this into a regular grid. In ...
5
votes
0answers
67 views
Padua-type pointset for functions singular on line $x=y$
The Padua points $\mathrm{Pad}_{n} \subset [-1,1]^{2}$ are a unisolvent pointset with optimal growth of Lebesgue constant, described in detail here. With some work they can be used to generate a ...
4
votes
2answers
139 views
Interpolate the orbital coordinates of an object using coordinates and velocities vector
I have a table of the orbital coordinates and velocities of an object with time steps of 1 minute.
Now I would like to interpolate this to a finer time increments with time steps of the order of 1 ...
3
votes
0answers
47 views
1D irregular interpolation with $O(1)$ or $O(\log(N))$ evaluation
In Floater's paper on barycentric rational interpolation, he shows that a stable interpolant using irregularly space points can be evaluated in $O(N)$ operations.
For equally spaces samples, cubic b-...
4
votes
1answer
101 views
Interpolation estimates for $H^1$ into $P_1$
As far as I can tell, nodal interpolation estimates proven with Bramble / Hilbert require higher regularity of the functions being interpolated. E.g. with linear elements in 2 dimensions, one needs $v ...
1
vote
1answer
2k views
Numpy.polyfit with regularization
I am trying to use the numpy polyfit method to add regularization to my solution.
My non-regularized solution is
...
1
vote
2answers
951 views
Polynomial Interpolation with Matlab polyfit
Given $N$ data points, does polyfit of degree $N-1$ produces the unique interpolating polynomial?
For concreteness, here is a code example:
...
0
votes
2answers
233 views
How to represent CFD result when I use grid-centered FVM?
My variables are stored at the center of the cells. How can I transfer these values to grid points? If I calculate the algebraic average value there may be a shock.
1
vote
1answer
87 views
Approximate function with minimum number of evaluations
I'm trying to approximate an unknown, non-linear function $f: A \to \mathbb{R}$ (in my case: $A = B \times B$ where $B$ is an infinite but compact subset of $\mathbb{R}$). That is, evaluating $f$ is ...
2
votes
1answer
272 views
Barycentric interpolation equivalent for irregular hexahedra
I have a mesh with irregular hexaedra and I need a fast way to interpolate values at points inside these cells. I know that trilinear interpolation does not work well for large skews. Barycentric ...
2
votes
0answers
68 views
1-D local interpolation of sampled function that is polynomial in 1/x
I have a number of evenly-spaced samples of functions that are polynomial in $1/x$ where $x$ is a continuous variable on $x\in\left[a,b\right]$, i.e. $$f(x_i)=\sum_{n=0}^{N} f_n x_i^{-n}.$$ I want to ...
1
vote
0answers
81 views
Find B-spline coefficients from values on collocation points
The context of my question is how to compute high order derivates on direct numerical simulation of turbulent channel flow. It is of particular interest for fluid dynamics and turbulence research.
I ...
0
votes
1answer
156 views
Find hidden sequence $a_n = a_{n-1} + T $ , with period $T$, given some “random” numbers
I have this data plotted on a graph in which all points have the same value on the y-axis, e.g a constant integer "c", while the x-axis is the time in seconds.
So, for a c = 25 on the y-axis, there ...
1
vote
0answers
302 views
Numerical integral of oscillating function with known zeros
I have a function that I need to numerically integrate from $0$ to $+\infty$, given by:
$$I = \int_0^{+\infty} \mathrm{d}x\,x\,T^2(x)f(x)$$
where $T^2$ is an interpolated function that goes to $1$ ...
1
vote
0answers
475 views
Polynomial approximation - Vandermonde matrix creation - precision
I am trying to fit a polynomial through 340 points in a 3D space, i.e.
$$f(x,y,z) = k$$
I asked previously about the theory behind polynomial interpolation here ->
Polynomial interpolation
Few ...
0
votes
1answer
224 views
Underdetermined/overdetermined polynomial interpolation
I am trying to apply a polynomial interpolation to 340 points in a 4D space, i.e.,
$$f(x,y,z)=k\, .$$
What I would like to understand is this: if I use a 6th order polynomial I will end up with 343 ...