Questions tagged [interpolation]

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

Filter by
Sorted by
Tagged with
6
votes
1answer
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: ...
6
votes
2answers
325 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: ...
6
votes
1answer
162 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? ...
6
votes
1answer
217 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 ...
6
votes
0answers
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 ...
5
votes
4answers
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 ...
5
votes
4answers
163 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: ...
5
votes
3answers
222 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 ...
5
votes
3answers
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). ...
5
votes
4answers
976 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: ...
5
votes
3answers
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 ...
5
votes
3answers
1k views

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

sol = NDSolve[{Derivative[2][y][t] + Sin[y[t]] == 0, Derivative[1][y][0] == 0, y[0] == 1}, y, {t, 0, 2}] the above-mentioned differential equations can be solved ...
5
votes
2answers
391 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: ...
5
votes
2answers
244 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 ...
5
votes
3answers
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 ...
5
votes
2answers
142 views

Reshape interpolated data

I want to reshape/smooth the following data: ...
5
votes
3answers
271 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: ...
5
votes
1answer
3k views

Interpolation: Unstructured grid error

If I try to make a table SimpleTable and to interpolate a function of two variables, I encounter a problem. For example: ...
5
votes
2answers
106 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: ...
5
votes
3answers
309 views

How to complete function which is not defined for all interval

I have a function testF22 like this ...
5
votes
2answers
339 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 ...
5
votes
1answer
331 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 ...
5
votes
1answer
196 views

What is the Chebyshev method for `InterpolationFunction`?

With InterpolationOrder -> All, some methods of NDSolve returns interpolations with ...
5
votes
1answer
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 ...
5
votes
1answer
59 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: ...
5
votes
2answers
239 views

How can I fit a function onto a histogram?

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

Extract one dimension from an n-dimensional InterpolatingFunction

How can I extract a single dimension from an InterpolatingFunction? As an example: ...
5
votes
1answer
373 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): ...
5
votes
1answer
484 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): <...
5
votes
1answer
790 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 ...
5
votes
2answers
401 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 ...
5
votes
1answer
739 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 ...
5
votes
1answer
2k views

Integrating a functional of an InterpolatingFunction

It is straightforward to Integrate an InterpolatingFunction. However, even for a simple functional of an ...
5
votes
1answer
893 views

Hermite interpolation

The well known Hermite interpolation uses piecewise cubic polynomials and fits the knot values and derivatives. In contrast the Mathematica piecewise Interpolation ...
5
votes
2answers
2k views

Interpolation won't give smooth output

I have a data, for example ...
5
votes
1answer
461 views

How does ListInterpolation work?

ListInterpolation takes an array of data and interpolates between the entries. Let us interpolate between the elements of the identity matrix. For reference, this ...
5
votes
1answer
120 views

FunctionInterpolation produces many error messages when given high-precision input [duplicate]

Both FunctionInterpolation[1, {x, 0,1.00000000000000004}] and FunctionInterpolation[1.00000000000000004, {x, 0, 1}]; ...
5
votes
1answer
315 views

Overriding default ExtrapolationHandler

When modeling systems with WhenEvent and NDSolve I found that the default extrapolation settings used in the returned ...
5
votes
1answer
170 views

Second derivative of SmoothKernelDistribution PDF?

Does anyone know why I can't seem to get a second derivative of this interpolating function f? In this example, h[x] is zero ...
5
votes
1answer
78 views

Eigenvalues and numerical eigenfunctions for similar differential operators

I am looking to numerically approximate the eigenvalues and eigenfunctions for a differential operator I am working with, assuming $\pi$ periodic boundary conditions. Namely, I define the function $...
5
votes
1answer
296 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 ...
5
votes
1answer
371 views

Finding the attractors of the vector field constructed as the gradient of an interpolated 3D scalar field

I have a list of data existing as {{{x, y, z}, f},...} from which I construct a 3D interpolation function using Interpolation[ ]. I am able to construct a vector field from the gradient of this scalar ...
5
votes
1answer
136 views

Analyzing MethodOfLines

In this example the wave equation ...
5
votes
2answers
272 views

Derivative of an interpolated function on an unstructured grid

I'm writing my own FEM Poisson equation solver in C++ and I'm using Mathematica as a benchmark - currently it seems that my program outputs a correct solution, however I want to check whether the ...
5
votes
2answers
199 views

Delete duplicates in list of interpolating functions

I have a list of several hundreds of InterpolatingFunction generated by numerical continuations based on different starting points. A list can be downloaded here [...
5
votes
1answer
332 views

Create ParametricFunction object without ParametricNDSolve

Documentation of v9 states that ParametricFunction is generated by ParametricNDSolve and ...
5
votes
0answers
68 views

Evaluation of Mod of InterpolatingFunction prevents discontinuity processing by Plot

While trying out @MichaelSeifert's answer to Eliminating Discontinuities When Using Mod with NDSolve and Plot for Oscillators, I came across this odd behavior. Depending on how an ...
5
votes
0answers
89 views

Why do some uses of PropertyList crash the kernel?

Bug introduced in 10.1.0 or earlier and persisting through 12.0.0 or later A support case with the identification [CASE:4222617] was created. While looking at the question How to evaluate the "...
5
votes
0answers
88 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 ...
5
votes
1answer
83 views

Importing an InterpolatingFunction computed with option “LocationMethod” -> “StepBegin”

Bug introduced in 10.4.1 or earlier and fixed in 11.1.1 Apparent bug observed in MMA 11.0.0.0. 2016/11/10 Wolfram Support Team contacted. 2016//11/29 Passed along the report to developers for ...