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.

learn more… | top users | synonyms

3
votes
1answer
89 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
79 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
71 views

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

I have a working C++ function: ...
2
votes
3answers
88 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
77 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 ...
3
votes
2answers
120 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
113 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: ...
5
votes
1answer
88 views

Question on speed and accuracy comparisons of different 2D curve fitting methods

This may be a trivial question, and I apologize if so. Consider the following simple problem: We have a 2D, regular grid of points (say $X = [0,5000] \times [0,5000]$) spaced uniformly by units of 1 ...
3
votes
0answers
14 views

Choosing suitable polynomial degree based on information in advection stencil

I'm working on a finite volume advection scheme for unstructured meshes which uses a multidimensional polynomial weighted least squares fit for interpolating from cell centres onto faces. In 2D, the ...
5
votes
1answer
251 views

Approximating a step function with polynomials

The Weierstrass approximation theorem says any continuous function $f(x): [0,1] \to \mathbb{R}$ can be approximated uniformly by polynomials. Given any $\epsilon$, we can find $p(x) = x^n + \dots $ ...
1
vote
0answers
54 views

End conditions on cubic splines interpolation

I'm currently working on cubic splines interpolation. My question has to do with the end conditions. Instead of using natural or clamped cubic splines, I am asked to use the following condition : ...
4
votes
0answers
72 views

Can I make this numerical integration continuously differentiable?

Suppose I have the discrete values $f(x_i)$ for every discrete value $x_i$ greater than some $\varepsilon$, and I want to numerically calculate the following integral: \begin{equation} n = ...
1
vote
1answer
63 views

Approximate function following interpolation (Matlab)

How do you approximate a function for interpolated points? I use the natural cubic spline to interpolate points as follows for n = 500 points: ...
2
votes
2answers
87 views

Find triangle which contains point on the sphere

Suppose I have a mesh of the sphere (points on the sphere and a triangulation). What is a good and efficient way to find the triangle which contains a point on the sphere (the point does not need ...
2
votes
2answers
282 views

Linear interpolation in Fortran

Is there a Fortran subroutine which performs linear interpolation in one-dimenional data? I need something similar to MATLAB function interp1.
0
votes
2answers
82 views

How to interpolate a set of points with a continuous closed B-spline curve?

I have been learining the NURBS theory by the classical textbook "The NURBS Book" this year. In the chapter 9, the author introduced the method of non-rational B-spline curve interpolation with a open ...
1
vote
0answers
38 views

Comparison between of higher order interpolations

A while ago I came up with an algorithm which can be used to numerically solve optimal control problems, which basically came down to discretizing the control input $u(t)$ and interpolating this to ...
2
votes
1answer
106 views

Generating harmonic polynomials in cartesian coordinates

TLDR: Are these polynomials really harmonic polynomials, and how can I generate them? Long version: I want to describe an electrostatic potential $\Phi(x,y,z)$ over a source-free volume, by using ...
1
vote
1answer
63 views

Interpolation using compactly supported radial basis function

I have been struggling for two days with the following problem. I would like to do a $d$-dimensional interpolation over some data. I tried first to use polyharmonic splines, but when the size of data ...
1
vote
1answer
81 views

How to update velocity to include pressure when using P2/P1 elements

I am in the process of writing a finite element code to solve the Navier-Stokes equations using the theta method for time stepping (basically Crank-Nicholson for diffusion and forward Euler for ...
2
votes
2answers
281 views

Is my Restricted (Natural) Cubic Spline equation wrong?

I am trying to fit a restricted cubic spline (natural cubic spline) with 4 knots to toy data, attempting to follow Hastie, Tibshirani, Friedman 2nd ed. 5.2.1 p.144-146, Eqs 5.4 and 5.5. Data: Is ...
0
votes
0answers
50 views

Gauss Integration over Zero Order Element

I'm working with the Boundary Element Method and want to integrate an expression over a triangular region. I would like to use Gauss Integration to do this, but I'm having trouble since the triangular ...
1
vote
0answers
31 views

Anybody using kriging for surface interpolation from huge point datasets? [closed]

Is anybody here using kriging for surface interpolation from huge datasets (> 1 million points)? How large datasets are your datasets and what do you model? Also what software are you using?
2
votes
1answer
337 views

L2-Projection using quadratic basis functions

I am trying to understand 1D $L^2$-projections using quadratic basis functions. Using 3 data points, and the Lagrange polynomial it is easy enough to see how to write out 3 basis functions. With the ...
7
votes
1answer
1k views

What is the preferred and efficient approach for interpolating multidimensional data?

What is the preferred and efficient approach for interpolating multidimensional data? Things I'm worried about: performance and memory for construction, single/batch evaluation handling dimensions ...
1
vote
1answer
70 views

What are good parametrizations of rational functions for response surface models?

For fitting a response surface model to a physical process, I have 3-4 relevant "signals", like a feature density, a signal based on a feature width, or a signal based on a distance to the next ...
0
votes
1answer
254 views

Interpolating 3D Array non-monotonic data in MatLab

I am working on creating a program for simulations where three variables are parametrized, and we modify one parameter while keeping the other two constant. An example array looks like this when ...
0
votes
1answer
67 views

How to present a polynomial interpolation if the first order information of function f(x) is given?

Suppose $f'(x_1),\ f'(x_2),\ f'(x_3)$ are given, how to give a polynomial interpolation $p(x)$ such that $p'(x_1)= f'(x_1),\ p'(x_2)=f'(x_2),\ p'(x_3)=f'(x_3)$? And how to give an error analysis?
2
votes
1answer
110 views

Error of interpolating polynomial

$f(x)= \frac{1}{1+x^2}$ and when I computed the interpolating polynomial of 5 equally spaced points in [-5,5] I got $ p(x)= 0.0053x^4 -0.1711x^2 +1$ Now I need to estimate the error in the ...
1
vote
1answer
2k views

Plot a surface from data sets in MATLAB

I tried to plot a surface in MATLAB but, since it is the first time I had to do something like this, I need a confirmation on the process I followed because it is important for my project to plot the ...
3
votes
1answer
1k views

Is there a Gauss-Laguerre integration routine in Python?

I am reading the book "Numerical Recipes in Fortran 77: The Art of Scientific Computing" (Second Edition) and I came across some methods for numerical integration of 1D functions. More specifically ...
5
votes
1answer
115 views

What spline functions are used in Section 13.9 of “Numerical Recipes in C”?

I asked a similar question on MathSE but with more added fluff, but didn't really get any straight answers, so I figured I'd ask here. Computing Fourier coefficients of a function using the FFT is ...
0
votes
0answers
48 views

Interpolation using two chebyshev grid points

I want to do the interpolation on a interval. I can do it using with one chebyshev grid points, but i want to do it using two chebyshev grids on each half of this interval. I can do it separately for ...
1
vote
1answer
231 views

How to minimize the artefact of a cartesian to polar transform followed by a polar to cartesian transform?

I'm transforming cartesian images into polar images. (x,y) => (angle, radius) I fill the polar image by iterating on each of its pixels and filling them by doing the reverse polar transform. For a ...
0
votes
0answers
333 views

Fast way to compute barycentric lagrange interpolation

Is there any fast way to compute the barycentric Lagrange interpolation using matlab? something more faster than using repmat instead of for loops
2
votes
2answers
314 views

Interpolating irregular data on a sphere

I am trying to interpolate irregular data $f(\theta, \phi)$ on a sphere and I have so far tried a scipy approach using Kd-Trees and inverse distance weighting, which works ok - however I was wondering ...
1
vote
0answers
85 views

NURBS surface fitting for a closed region on mesh

I'm developing a tool that allows users to select a closed boundary (a polygon) on the triangle mesh and then from this boundary, generate a NURBS surface fitting the original mesh surface. My idea ...
0
votes
1answer
44 views

interpolating a periodic time series

I have a bunch of readings that run every 4 hours, however each sensor has a different offset. One sensor might read at $t = 0,4,8,12,16,20$ and another senor reads at $t = 1,5,9,13,17,21$. This ...
1
vote
1answer
370 views

How do I integrate this function in python?

Essentially this is the problem: $\hat{F}(\omega) = \int_0^{\infty} f(s)e^{-i\omega s}ds$ The function $f$ is in general complex valued. I know this looks like the fourier transform but I don't want ...
4
votes
2answers
63 views

Fitting a surface to scalar functions given on the edges of a triangulation

Given a triangle mesh $\mathcal{T}$ with vertices $V=\{\mathbf{v}_i\}_{i=1}^n$ in $\mathbb{R}^3$ and triangles $T_{ijk}=[\mathbf{v}_i, \mathbf{v}_j, \mathbf{v}_k]$. For each vertex $\mathbf{v}_i$, I ...
9
votes
2answers
827 views

Help deciding between cubic and quadratic interpolation in line search

I'm performing a line search as part of a quasi-Newton BFGS algorithm. In one step of the line search I use a cubic interpolation to move closer to the local minimizer. Let $f : R \rightarrow R, f ...
0
votes
0answers
34 views

Mass-conservative reprojection (on a sphere)

I have a 2D distribution of mass on a sphere given as a matrix of masses in latitude-longitude grid cells. I need these masses projected to another grid on the same sphere with different location of ...
4
votes
2answers
567 views

Interpolation by Solving a Minimization Problem (Optimization)

I will try to give the motivation behind this problem and later the math formality. Given a grayscale image (1 Channel - M by N Matrix). Someone marks some pixels as anchors. Now, you need to ...
5
votes
0answers
125 views

Integrating highly oscillatory functions

I have a logarithmic grid, upon which i have two functions that are similar to this one (this is only the last 100 points): These are essentially very similar to a Sin function at this point. I ...
2
votes
1answer
112 views

How do I do Chebyshev interpolation in multi-dimentional space?

This topic is used in spectral methods, for collocation grid. Literature mentions Chebyshev interpolation on a grid (defined by $\xi_j = cos(\pi \cdot j/N)$, $x_j = (\xi_j+1) L/2$, $j=0,...,N$) ...
4
votes
0answers
78 views

How do I perform chebyshev interpolation from a to b with custom angle range?

Typically Chebyshev interpolation from $-1$ to $1$ with angle from $0$ to $\pi$: $\xi_j=\cos \left ({\pi j \over N}\right )$ $x_j=(1+\xi_j) * {L \over 2}$ $w$: $w_0=\pi/(2N)$ ...
4
votes
1answer
2k views

Fortran, making a more efficient bilinear interpolation

I'm trying to write an efficient bilinear (2D)-interpolation, after reading some recipes, as a fortran-mex for Matlab that is used extensively throughout a long algorithm of solar image processing, ...
5
votes
1answer
173 views

Adaptive Table Lookup for Expensive Function Evaluation

I have a function that is expensive to evaluate whose inputs are n-dimensional (n is the order of a dozen or two). I need the output of this function at each node and each time step for a PDE ...
1
vote
1answer
681 views

Newton's method in interpolation

I've seen that in Newton's method for interpolating polynomials, the coefficients can be found algorithmically using (in Python-ish): ...
3
votes
1answer
4k views

How does Matlab's “interp2” compute bicubic interpolation?

Computational Science people: The title is the question: exactly how does Matlab's "interp2" command (with the "cubic" option) perform bicubic interpolation? I tried the Mathworks documentation ...