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
0
votes
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
1k 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
239 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
312 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
71 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
84 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
357 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
488 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
259 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
543 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
467 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
486 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
152 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 ...
3
votes
2answers
587 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
77 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
179 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
304 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
233 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
183 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
198 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 ...
2
votes
2answers
149 views

citations for numerical lookup table interpolation of P/ODE(s) RHS

I'm not sure that this *overflow is right place to ask.... Sorry if it is off topic. Does anyone know a citation (scientific article or book) for a numerical trick (method), when we tabulate a right-...
4
votes
1answer
724 views

Chebyshev approximation by projection vs interpolation

Suppose we want to approximate a function $f: [a, b] \rightarrow \Re$ with a Chebyshev series: $$ f(x) \approx \sum_{k=0}^n c_k \, T_k\left( \frac{2x-b-a}{b-a} \right) $$ where $T_k(x) = \cos(k\, \...
1
vote
1answer
225 views

Line integral along the edge of an isoparametrically mapped quadrilateral

I need to integrate a function along the edge of a quadrilateral (boundary integral). For example, the function is $f(x,y)=x^3+y^3$, the quadrilateral coordinates are $(0,0),(2,-1),(3,2),(1,3)$ and ...
5
votes
0answers
173 views

How to optimally choose points for multivariable Hermite interpolation?

I have a multi-variate, continuous function $f$ from $R^n$ to $R$, which I can query for its output for any input. I would like to create interpolation polynomial for it. In one-dimensional case ...
1
vote
0answers
125 views

computational tool for higher order Lagrangian interpolation for finite element

In finite element, I can calculate the Lagrangian interpolation shape functions for each degree of freedom in an element, from the the number of nodal degrees of freedom and the number of nodes ...
3
votes
1answer
280 views

Methods for interpolating from points that are not on a regular grid?

I'm working on a project where I'll need to be able to interpolate scalar potential values at arbitrary points in a 3-D box from a large (potentially millions to billions of points) collection of ...
0
votes
3answers
135 views

Polynomial reconstruction on unstructured grids

For a 1D grid I can calculate a Lagrange polynomial through an arbitrary set of points for the reconstruction of a polynomial function. In 2D I have an unstructured grid and want to interpolate the ...
1
vote
1answer
85 views

Using two reference values for a scalar variable: What's the name of this type of problem?

I don't really know where to ask this one... In fact, I am not sure I can define it properly. Here goes... Let's say I take measurements. In order to "normalize" these measurements, I divide their ...
0
votes
2answers
221 views

Integrate result of finite element calculation in MATLAB

I have a PDE that I solve in MATLAB over a 2D domain using the "recommended workflow", i.e. the functions descg, ...
1
vote
0answers
64 views

Sensitivity Analysis -- Total Variation for a function with categorical arguments?

I have an application in sensitivity analysis of complex system models with moderately nonlinear interactions between arguments Arguments potentially dozens or hundreds in number Arguments mostly ...
0
votes
1answer
846 views

Interpolation of velocities on staggered grid (in PIC)

Edit: (copying from my comment) Let's consider the inverse problem when I need to transfer velocities from particles to the grid (inverse bilinear interpolation). How'd I transfer a particle's x-...
1
vote
0answers
153 views

C1 continuous spline on regular 2D-grid with quadratic 1D cuts

I want some scalar spline function defined on regular 2D grid $F(x,y)$ with continuous first derivative which is easy to intersect with arbitrary ray/line ${\vec l}(t) = (c_x t,c_y t,c_z t)$. ...
0
votes
1answer
72 views

Interpolation over an unequally spaced grid

my aim is to interpolate a function like this: I have ...
3
votes
2answers
2k views

Fourier transform by FFT : by using cubic splines to interpolate between data points, do we change the frequency content of the Fourier transform?

I have a data file with some points equally spaced. These represent some function. I have to calculate the Fourier transform of this set of points. The thing is, I'm tempted to take a cubic spline of ...
2
votes
0answers
299 views

trigonometric interpolation with non-equidistant sampling

I want to interpolate a periodic function on a non-equidistant grid and have implemented it the using the Lagrangian formula described in wikipedia. For an odd number of data points, this takes the ...
1
vote
3answers
148 views

Is there any function gives no interpolation error in numerical analysis

I was reading about Interpolation error formula and Runge's phenomenon. My question is : Is there any function that gives no error at all? In other words the interpolation function $p$ would equal ...
1
vote
0answers
82 views

A linear polynomial that is the minimax (best) approximation to $f(x)$ on the interval $[-1,1]$

Suppose you have the following analytical information about a function $f(x)$ on $[-1,1]$: \begin{align*} f(x) &= \frac{1}{x+3}\\ f'(x) & = -\frac{1}{(x+3)^2}\\ f^{''}(x) &= \frac{2}{(x+3)...
2
votes
1answer
2k views

Contour plot interpolation recommendation

I am not sure if my question is on topic or not and if not please let me know. I have regularly spaced gridded data(output of a weather forecast simulation software) and I have latitude and ...
3
votes
0answers
481 views

Gradients of non-uniformly sampled data in 3D space

I have measurements of magnetic field on a 3d grid. My measurements are distributed on four x-y planes similar to what is shown in the image below. The measurements roughly follow a Cartesian grid but ...
1
vote
1answer
504 views

How does Matlab `surf` perform interpolation?

When I use Matlab's surf function, I notice that I can't re-perform its interpolation, which produces unreliable results. Do you know what does ...
1
vote
0answers
941 views

linearly interpolate and determine gradients for data on non-uniform grid

I have measurements of a quantity on a 3d grid. My measurements are distributed on four x-y planes similar to what is shown in the image below. The measurements roughly follow a Cartesian grid but ...
2
votes
1answer
751 views

Second order interpolation scheme

On a grid I am having the values of a physical quantity say for example Temperature, at the E,W,N,S and P node all of them being calculated using a second order discretization scheme. I want a second ...
0
votes
1answer
117 views

Derivation in the FEM method

Can any on help me understand how from the simple delta function on the right hand and performing the integration we can get values as in the left? Note that $h = x_i + 1 - x_i$ The diffusion and ...
-2
votes
1answer
2k views

How to implement Lagrangian/Polynomial Interpolation for my C++ Code?

I have a working C++ function: ...
2
votes
3answers
270 views

Does it have an effect to interpolate data before using Runge-Kutta?

I am going to calculate a trajectory, by using a pre-calculated vector field. The values of the field are known on a grid which is quadratic in the horizontal direction, un-evenly spaced in the ...
1
vote
1answer
170 views

Fit curve with rectangles

I have a one-dimensional set of points, i.e. $(n,y_n), 1\leq n \leq N$. I want to fit them with a linear combination of $k$ rectangular functions in a least-squared-error sense. Each rectangle is ...
4
votes
2answers
422 views

Interpolation with the roots of orthogonal polynomials & Spectral expansion

I'm a bit confused about the relationships between these two approximation methods mentioned in the title. Does this kind of interpolation also belongs to the field of spectral methods? Are the ...
1
vote
0answers
309 views

Calculating lagrange polynomial for 100 points?

I need to calculate the lagrange polynomial which approximates $e^x$ at $101$ points, the points $\frac{k}{101^2}$ for $k\in\{0,1,2\dots 100\}$. I tried the following code: ...