# Questions tagged [interpolation]

Questions on the interpolation functions in Mathematica (Interpolation[], ListInterpolation[], FunctionInterpolation[], InterpolatingPolynomial[], etc.)

829 questions
Filter by
Sorted by
Tagged with
598 views

### How can I get the interpolation line from Listplot?

My discrete data is: data={{1., 5827.}, {3., 6242.}, {15., 6066.}, {60., 5972.}} I want to get the interpolation line from ListPlot: ...
313 views

### Extract one dimension from an n-dimensional InterpolatingFunction

How can I extract a single dimension from an InterpolatingFunction? As an example: ...
2k views

### White spots in ListDensityPlot

I have a problem with ListDensityPlot. I have some data on an irregular grid. I try to plot them with ...
131 views

### Efficiently fill sparse matrix involving BSpline

Context In order to implement regularised fitting in 2 or 3 dimensions (as is done say here) using BSplineBasis one needs to evaluate a basis over a set of data. ...
753 views

### How to plot InterpolatingFunction across its domain

I'm using NDSolve to solve a system of coupled ODEs for a range of different parameters. For most points in the parameter space, the integration breaks down ...
826 views

### Multiply interpolating function with variable

I am always running into trouble when trying to use interpolating functions. I am trying to do: ...
535 views

### How to evaluate differential entropy from raw data?

I want to evaluate the differential entropy according to here $$h(X) = - \int f(x) \log{f(x)} dx$$ where $f$ is the probability density function. Lets create some test data (normal distribution): <...
435 views

### Interpolation impossible for ListPlot with Missing?

I have a list of data to plot. I would like to plot them with lines but delete some data before plotting and leave the lines disconnected where data is deleted. For example, ...
148 views

### Recycling solutions of multidimensional NDSolve

Dear wolfram community, I hope my problem is clear and easy to solve. I have already solved the following heat equation over a domain: ...
352 views

### What is wrong with this code? (Usage of FunctionInterpolation and how to make code efficient)

I am trying to create an interpolation out of a function that comes from an improper integral. The end goal is to make a 3d plot over a specific region. Specifically, I have the following code: ...
159 views

### 2D interpolation of function with dependent interpolation border

My problem is to compute $$\int\limits_{x_{min}}^{x_{max}}\int\limits_{y_{min}}^{\sqrt{x^{2}-a^{2}}}W(x,y)g(x)\ dx\ dy$$ Because $W$ have highly oscillatory 2d complex numeric integral inside, dumb ...
293 views

### FunctionInterpolation error when specifying AccuracyGoal

Bug introduced in 8 or earlier and persisting through 11.0.1 or later In the help page ref/message/FunctionInterpolation/ncvb, it is mentioned that one should ...
292 views

### Evaluating InterpolatingFunction returned by NDSolve is very slow starting from some arguments

I use this code to solve a PDE: ...
299 views

### Multidimensional arbitrary precision spline interpolation on the grid

This question is a generalization of the previous one for multiple dimensions. In the answer to that question an implementation for the clamped spline interpolation for 1D case and arbitrary degree of ...
1k views

### InverseFunction on an Interpolating Function is misbehaving

I am getting strange behavior when I try to calculate the inverse of an interpolating function for two similar data sets. My data sets are: ...
345 views

### How to derive/interpolate a polynomial f(x,y) from several discrete polynomials f(x)?

I have 7 discrete degree 3 polynomials $f_i(x)$. Each of them represents a snapshot of data from an experiment and fits this data quite well. This graph depicts the 5 largest of the 7 polynomials: ...
373 views

### How to use BSplineFunction for calculating derivative

I have a set of data like the following data = {{x1,y1},{x2,y2},{x3,y3},......} Now I use ...
188 views

### Multi-variable FunctionInterpolation with the range of one variable as a function of another

How can I modify my FunctionInterpolation code so that the boundary of one of the variables is a function of another variable? ...
223 views

### Finding minimum fly-by radius between Mars and spacecraft from interpolating function

I've written an interplanetary trajectory solver/plotter that plots the path taken by a spacecraft on an Earth-Mars mission, but have run into a little trouble when the spacecraft actually reaches ...
152 views

### Accuracy of Chebyshev Interpolation

I have been looking at how to interpolate a function using Chebyshev polynomials. There are several good posts such as this one by Michael E2 and this one by J. M. There is also an example in the help ...
1k views

### Interpolate throughout a 3d data list without extrapolation

I have a 3D list of data for which I'd like to plot an interpolated surface. There are several ways to achieve this, but none I cannot find a method which ONLY plots the ENTIRE interpolated surface ...
1k views

### Finding intersections of two parametric curves

I am dealing with the root finding of two parametric data curves (data below). I have already checked Parametric Interpolation of 2D data, which I found useful for plotting, though it is not adequate ...
459 views

### How to easily find the coefficients of a cubic polynomial and its plot for the given 4 points

Given 4 points as points = {{0, 4}, {1, 0}, {2, -1}, {3, 0}};. I want to find the coefficients of ...
170 views

### Constructing a list

I need to use the interpolation function on some data so I can integrate it. I have an array with 1400 subsets and there are 1400 elements in each subset: ...
303 views

### Obtaining points with equal spacing from interpolated data

Beginning with five ordered pairs I made an interpolation, obtaining an a polynomial expression. I got several other points with equal spacing from the polynomial expression. Are there any commands ...
2k views

### How to (correctly) interpolate an array of points?

I'm trying to obtain an interpolation function for points of an x^(-5) function (which goes to infinity at x = 0). ...
1k views

### Interpolation of unevenly spaced data, is it possible?

I need to interpolate data, that consists of many points in the beginning and a few in the end of the interval, like in the following example: ...
6k views

### Smooth 4D (3D + color) plot from discrete points

I have a file containing isosurface $\{x,y,z,F\}$ data (around 9000 points). My goal is to generate a smooth (NOT a discrete set of points!) colored surface using ...
1k views

### How could I get the value of y[t] at each specific interpolation point?

sol = NDSolve[{Derivative[y][t] + Sin[y[t]] == 0, Derivative[y] == 0, y == 1}, y, {t, 0, 2}] the above-mentioned differential equations can be solved ...
280 views

### Trying to build a function to compute divided difference for arbitrary list of points

As the title says Im trying to build a function to compute divided difference for arbitrary list of points. The divided difference of a set of points $\{(x_1,y_1),\ldots, (x_n,y_n)\}$ where \$x_j<...
451 views

### Derivative of an interpolated function

I am trying to take the derivative of an interpolated function. I am given the function values and the derivatives at some irregular points. Here is my minimal working example to reproduce the error: ...
255 views

### How to get the boolean value of an inequality involving an InterpolatingFunction?

Here's the code: yan = FunctionInterpolation[x^2, {x, -1, 1}]; FullSimplify[yan[x] > -1, -1 < x < 1] Needless to say, what I expect to see in the output ...
167 views

### Basic 3D Interpolation Failing

I've seen a few other posts asking about the "unstructured grid" error in Interpolation. Here's a minimal (non)working example of the issue: ...
6k views

### Retrieve values of InterpolatingFunction

While analyzing a large system of ODE's, I defined a particular ratio p, which contains some variables that are represented by ...
144 views

### Reshape interpolated data

I want to reshape/smooth the following data: ...
295 views

### Smooth initial data

I need something that produce pseudorandom smooth initial data for modelling phase separation equations (Cahn-Hilliard and simular). Generator code for now: ...
349 views

### How to complete function which is not defined for all interval

I have a function testF22 like this ...
385 views

### interpolating a smooth closed surface to a non-uniform data set (ListSurfacePlot3D)

I want to generate a smooth coloured surface from a discrete set of points of the form {x,y,z,F} using the ListSurfacePlot3D. My data set is quite non uniform; the ...
396 views

### Plot 1D slice of 2D InterpolatingFunction

I'm numerically solving a PDE (time+1D space) with NDSolve and want to plot some spatial profiles. Plot works, but is very slow ...
749 views

### Integrating an interpolating function

I have been using the following NDEigensystem command to generate the eigenfunctions of the laplacian with a square domain: ...
2k views

### Interpolating 2D data with missing values

I have a list (21 x 21) containing values. I want to eliminate slots containing zeros by interpolating the nearest values and overwriting the zeros. How do I use the Mathematica's ...
68 views

### Weirdness with Interpolation of data and InverseFunction

Bug introduced in 8 or earlier and persisting through 12.0 Something strange is happening with this list of data: ...
564 views

### How can I fit a function onto a histogram?

SampleData = RandomVariate[RayleighDistribution, 5000]; Histogram[SampleData] This creates a histogram that (in my case) looks something like this: I want to ...
421 views

### Strange extrapolation in ListContourPlot?

I have some Table of {x,y,z} values (energy as a function of radial and azimuthal frequencies in a galaxy if you care to know): ...
872 views

### Smooth 3D plot with colour of scattered data

I have a set of scattered 3D points with coordinate (x,y,z) and an intensity associated with it. I would like to do a smooth surface with the intensity being represented by the colour. My points ...
439 views

### NMinimize Constraints on Interpolating Functions

I have the following piece of code and am trying to use NMinimize (the last line in the following chunk of code) to minimize ...
808 views

### Intersection of a ListPlot3D surface with a plane

I'm trying to use Mathematica to analyze some physics data from an experiment, more precisely, I have to fit a 2D data series with a one dimension function. At the moment I'm able to load and plot ...
2k views

### Integrating a functional of an InterpolatingFunction

It is straightforward to Integrate an InterpolatingFunction. However, even for a simple functional of an ...