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.

Filter by
Sorted by
Tagged with
3
votes
1answer
41 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
2answers
54 views

bilinear interpolation for large grids

I need to make a bilinear interpolation of a function Y(i,j) tabulated in a 100x100 grid. I tried with the fortran polin2.f and polint.f subroutines of Numerical Recipes. This routines seems to be ...
2
votes
2answers
60 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
97 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
35 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
37 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
34 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
35 views

extrapolation/interpolation in fmincg.m

Can you tell me these equations come from where in MATLAB fmincg.m? ...
0
votes
1answer
62 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
60 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
46 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. ...
1
vote
0answers
80 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 ...
0
votes
0answers
26 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
91 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
233 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
322 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
159 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
160 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
51 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 ...
4
votes
0answers
65 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
134 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
753 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
65 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
111 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
45 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
91 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 ...
0
votes
1answer
786 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 ...
2
votes
2answers
593 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
220 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
81 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 ...
1
vote
1answer
134 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
61 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
69 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
151 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
366 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
130 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 ...
1
vote
2answers
338 views

Vandermonde matrix DG Hestaven

I am trying to understand the nodal and modal basis formulation from the book of Hesthaven (Nodal Discontinuous Galerkin Methods, Hesthaven, Jan S., Warburton, Tim). For $N=2$, I get the Vandermonde ...
4
votes
1answer
233 views

Interpolating a mathematical function using a Hermite Cubic Finite Element Space

I have a Hermite Cubic Finite Element Space on a computer in the form of Matlab m-files. More specifically, I can evaluate four "shape functions" $N_1, N_2, N_3,$ and $N_4$, for which the following ...
0
votes
2answers
255 views

What would be a good, fast, way to interpolate a point in 3D space

So I have a 3D mesh made of elements with eight nodes, 12 sides per cell, and in the course of my simulations, I would have to interpolate data from those nodes onto a point inside the cell with a ...
1
vote
1answer
87 views

Fast table interpolation on regular time data for ODE

I am using scipy.integrate.odeint to simulate the reaction of a system with known input signals via integration. The simplified code below illustrates what I'm ...
2
votes
2answers
341 views

Parametrized spline - oscilating second derivative

I am using a parametrized natural spline to interpolate 2D curves. For example something like this: Where I parametrize both the x and the y coordinate with a parameter that increases by one between ...
3
votes
2answers
68 views

Bounded approximation to a bounded function

I have a non-negative function $f(x) \ge 0$ defined on the interval $[a,b]$. I would like to have a finite-dimensional approximation to this function that is guaranteed to be non-negative on $[a,b]$. ...
2
votes
1answer
99 views

Higher order interpolation in DWR method

Based on page $35$ of the book: (W. Bangerth and R. Rannacher, "Adaptive Finite Element Methods for Solving Differential Equations", Birkhäuser, 2003,) for computing the error in dual weighted ...
1
vote
0answers
244 views

How to perform Taylor series expansion consisting of cell averaged derivatives in a computational element?

I have encountered the term cell "Cell averaged derivatives" and "Taylor series expansion using cell averaged derivatives about centroid" in the context of polynomial representation in any cell (...
3
votes
2answers
227 views

Given x,y,z data of a periodic object, calculate the period of the object (if possible)

So the problem I am working on is as such. Given the x,y,z data of a periodic object over time (from the origin in 3d space) (need not be uniform), calculate the period of the object (if the data ...
1
vote
0answers
147 views

Integral image resizing

I'm trying to find an approach for integral image resizing. I found out that I can do it with a bilinear interpolation method, but with this approach I can only resizing by the factor which is a power ...
5
votes
2answers
126 views

Computing inverse functions of functions of two variables

There are several functions of two or three variables that I am working with. For this question I have made a small set showing the resistivity, $\rho$, in n$\Omega$m, of copper as a function of its ...