Questions tagged [interpolation]

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

Filter by
Sorted by
Tagged with
59 votes
1 answer
3k views

What's inside InterpolatingFunction[{{1., 4.}}, <>]?

I'm curious what's inside the InterpolationFunction object? For example: ...
user avatar
35 votes
7 answers
9k views

Extracting the function from InterpolatingFunction object

I've used Interpolation[] to generate an InterpolatingFunction object from a list of integers. ...
user avatar
  • 453
40 votes
6 answers
6k views

How to splice together several instances of InterpolatingFunction?

I have a set of InterpolatingFunction returned by NDSolve which are valid over different (but overall continuous) domains. How ...
user avatar
  • 735
24 votes
2 answers
2k views

Easy way to plot ODE solutions from NDSolve?

Inspired by the closed question Beautify a NDSolve Graph ! and a comment someone made to me not too long ago: Is there some quick way to plot NDSolve results ...
user avatar
  • 216k
45 votes
5 answers
2k views

How can the behavior of InterpolationOrder->0 be controlled?

In ListPlot and Interpolation, the option InterpolationOrder->0 uses two different ...
user avatar
31 votes
6 answers
13k views

Finding the intersection of a curve with an interpolation function

There are no issues trying to find the intersection points of two defined curves. ...
user avatar
  • 9,148
31 votes
3 answers
3k views

Arbitrary precision spline interpolation

The current implementation of Interpolation does not allow arbitrary precision spline interpolation. Yu-Sung Chang says here that "it is not hard to implement it ...
user avatar
27 votes
4 answers
7k views

Data interpolation and ListContourPlot

I am fairly new to Mathematica and I have two quick questions on using it for a Hydrology and Hydrogeology class. One is about data interpolation and interpolating without any data defined in an area. ...
user avatar
24 votes
4 answers
5k views

How to integrate functions of linearly interpolated data?

At first, consider integration of pure InterpolatingFunction. Importing some data (works in v.9, for earlier versions one can use this link to download zipped <...
user avatar
12 votes
2 answers
1k views

How to make BSplineFunction pass each data point and naturally smooth?

Old package, works good ...
user avatar
  • 121
34 votes
2 answers
6k views

Joining and interpolating data points

I wonder what is the best practice for interpolating curves? Usually, I'm using BSplineCurve and adjusting SplineWeights so it ...
user avatar
  • 7,085
23 votes
2 answers
2k views

ListContourPlot interpolation fails if x and y axes have different scales

To summarize what is below: ListContourPlot doesn't work when the domain has different x and y scales (fails when x/y~10^4, which seems surprisingly small). Is it possible to call ListContourPlot on ...
user avatar
17 votes
2 answers
3k views

Getting an InterpolatingFunction from a ContourPlot

I have a function, say minimizeme[Ω_][β_][ϵ_] = ϵ^2 Ω - Log[2 (Cosh[2 β] + Cosh[2 β ϵ])]/(2 β); I want to find its critical points in $\epsilon$ for a given ...
user avatar
13 votes
2 answers
2k views

Finding a 3d curve from torsion and curvature with NDSolve

I'm trying to use the Frenet–Serret formulas to find the curve that matches the torsion and curvature I specify numerically with an InterpolatingFunction. The ...
user avatar
  • 1,008
22 votes
4 answers
11k views

Getting the interpolation function from a list plot

I have conducted a chemistry experiment and obtained a list of concentrations of a reactant against time. I plot a graph of this using Mathematica's ListPlot ...
user avatar
18 votes
4 answers
3k views

Interpolating data with a step

Suppose I have some data with a step in it: data = {{1, 1}, {2, 2}, {3, 3}, {3, 4}, {4, 5}, {5, 6}}; Interpolation will complain about this and not give you an ...
user avatar
  • 14k
17 votes
1 answer
13k views

How do I prevent NIntegrate::inumr errors within other functions?

I believe this question is best illustrated with a simple example. If I run FunctionInterpolation[NIntegrate[a + b, {a, 0, 1}], {b, 0, 1}] I get errors of the ...
user avatar
  • 4,731
20 votes
3 answers
3k views

Parametric Interpolation of 2D data

I want to create an interpolation through the following 2dim data points: ...
user avatar
  • 303
13 votes
3 answers
10k views

Get polynomial interpolation formula

I'm attempting to get a polynomial interpolation formula out of Mathematica but I am absolutely lost. I stared out using ...
user avatar
  • 233
5 votes
3 answers
7k 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 ...
user avatar
  • 869
21 votes
2 answers
3k views

Higher order periodic interpolation (curve fitting)

I have a list of points in 3D, and I want to get a smooth interpolation or curve fit (it is more for illustration) of these points such that the first and second derivatives at the start and end ...
user avatar
  • 541
9 votes
3 answers
5k views

Is it possible to compute with the trapezoidal rule by numerical integration?

Is it possible to compute trapezoidal rule numerical integration? I know that Mathematica has Interpolation, and that a list of points can be interpolated and then ...
user avatar
  • 9,425
16 votes
2 answers
1k views

The only usage for the option InterpolationOrder in NDSolve is to be set to All?

We know that changing the option InterpolationOrder in ListLinePlotListPlot3D、...
user avatar
  • 52.5k
23 votes
4 answers
2k views

How to reduce the InterpolatingFunction building overhead?

I want a linear interpolation from the following example list: ...
user avatar
  • 6,485
10 votes
3 answers
3k views

Ηow to create an interpolated CDF from its samples?

I want to use a distribution I have only aggregate statistics on, namely its CDF sampled at certain points. I would like to keep it "nonparametric" (remain noncommittal on the parametric form), but I ...
user avatar
  • 345
19 votes
2 answers
18k views

interpolation of 3D data

I have a 3D surface given in data-points of the form ${x,y,z}$. What is the easiest way to get the interpolated value $z=f(X,Y)$ for given coordinates ${X,Y}$ (which are of course not in the data list)...
user avatar
  • 1,547
20 votes
2 answers
9k views

Find maximum value of interpolation function - obviously wrong result

Minimizing and maximizing interpolation function has already been asked and answered, see here for example. Yet, I observe a strange behaviour. Well, I can understand that the wrong guess of ...
user avatar
  • 13.8k
18 votes
2 answers
2k views

Improved interpolation of mostly-structured 3d data

This question arose in response to a comment by Leonid to my answer for this question. He noted that for unstructured grids, Interpolation can only use ...
user avatar
  • 7,289
1 vote
2 answers
1k views

Interpolating noisy data

My data looks like this: https://pastebin.com/n59CTB3L Or if displayed in log chart: I want to create an interpolation of the data that would remove most of the noise. What are some good ways to ...
user avatar
10 votes
2 answers
932 views

Interpolating an Antiderivative

I'd like to be able to make InterpolatingFunctions for antiderivatives of functions that can't be integrated symbolically. However, the following code returns ...
user avatar
  • 537
18 votes
3 answers
9k views

Creating a 3D List Line Plot From Discrete Points

Given the following Runge-Kutta ODE solver and the graphical output below, how do I get a 3D line plot instead of a 3D point plot? I see that there is no ListLinePlot3D function, so I thought it might ...
user avatar
19 votes
2 answers
579 views

Adding Regularisation to Built-in Interpolation function

tl;tr; How to improve performance of regularised Interpolation? Context Since Version 12, Mathematica now incorporates a range of (underrated IMHO) regularisation ...
user avatar
  • 21.7k
17 votes
3 answers
2k views

2D smoothing spline interpolation

Does Mathematica have 2D smoothing spline interpolation built in? I requires an interpolation method with smooth first derivatives and cubic bivariate splines fulfill this nicely. In python I would ...
user avatar
  • 13.4k
15 votes
3 answers
6k views

Suppress extrapolation of interpolating function in a ContourPlot

I have defined an interpolating function, myfcn[x], valid on the domain x = 0 to 1.5. I am then using ...
user avatar
9 votes
2 answers
838 views

Convert BSplineFunction into two Interpolating Functions

Is there a way to decompose a BSplineFunction output into two functions x[t], y[t] ...
user avatar
  • 1,650
9 votes
3 answers
741 views

Derivative of contour in ContourPlot

Sorry to bring this question up again, since there are many similar questions on the site. I use to think this is a easy job to do, because for the worst case I can follow the answers on this site. ...
user avatar
  • 2,491
3 votes
2 answers
3k views

Extracting polynomials from a cubic spline function

I have this set of three data points and I want the natural cubic spline functions for them: dat = {{-.0247500, .5}, {.3349375, -.25}, {1.101000, 0}}; I tried: ...
user avatar
  • 985
10 votes
2 answers
1k views

Interpolation of mostly-structured 3D data

this question relates to interpolation of 3D data and Improved interpolation of mostly-structured 3d data I have an irregular 3d data set that is quite large (around 70,000 triplets---let's call it <...
user avatar
  • 9,326
22 votes
3 answers
3k views

Monotone, periodic 1d-interpolation with continuous 1st order derivative

Lately, we had this thread about interpolation where J. M. linked two interpolation methods. The background for my question is that I estimated a parameter in polar coordinates with dependence on the ...
user avatar
  • 111k
18 votes
4 answers
1k views

Quirk in VertexColors interpolation when displaying Polygon

When using VertexColors, the docs state: The interior of the polygon is colored by interpolating between the colors specified by ...
user avatar
  • 14.6k
21 votes
1 answer
631 views

How to fix broken InterpolatingFunction?

Bug introduced in 8.0 and fixed in 9.0.0 I have an InterpolatingFunction based on irregularly-gridded data, like this: ...
user avatar
  • 4,941
9 votes
1 answer
701 views

Smoothen the curve found by EdgeDetect

It seems that curves found by EdgeDetect always persist $C^{0}$ continuity only. Consider the following example: ...
user avatar
  • 52.5k
17 votes
2 answers
2k views

Interpolation on a regular square grid spanning a triangular domain

Bug introduced in 10.0 and fixed in 10.1 Context I am trying to identify contours of a function which is sampled on a cartesian grid within an irregular (triangular) region. Here is the data ...
user avatar
  • 21.7k
10 votes
4 answers
2k views

Numerical integration of a numeric data available as a nested list

I have some numerical data in the form of a list with the following structure: {...{x,y,z},...} defining a surface z=z(x,y) in a 3D space (x,y,z). The data came from a simulation, and I am post-...
user avatar
5 votes
1 answer
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 ...
user avatar
  • 377
14 votes
3 answers
1k views

Make an offset curve (parallel curve)

I have a polynomial curve that I got through interpolation. ...
user avatar
  • 9,055
11 votes
5 answers
518 views

Function for a series of joined slopes

I need a function for a series of joined slopes and my solution feels a bit kludgy. Is there a better way? A list of pairs of transition points and slopes: ...
user avatar
  • 264k
8 votes
1 answer
585 views

Produce a spline from a set of {{x, y}, z} points and get its parameters/expression

I have produced a set of points in a variable of the type {{x1, y1}, z1},{{x2, y2}, z2}, ,... }, where {x, y} should be the ...
user avatar
5 votes
2 answers
701 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<...
user avatar
  • 1,097
9 votes
4 answers
550 views

Taking Part of an InterpolatingFunction

I want a function to extract part of a one-dimensional InterpolatingFunction, similar to how Take works on lists. Based on the ...
user avatar
  • 17.7k

1
2 3 4 5