Questions tagged [interpolation]

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

Filter by
Sorted by
Tagged with
12
votes
3answers
2k views

Approximately Fit Data Without FindFit

I have some noisy data, and I'd like to analyze the derivative of the function the data approximately matches. Interpolation is normally great, but doesn't work ...
12
votes
2answers
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 ...
12
votes
2answers
6k views

Finding x given y from an interpolating function

I would like to put a dot on the point of a curve that has a specific y value but I don't know the x value. A simple example of my code is ...
12
votes
3answers
2k views

Derivatives (divergence, gradient, curl) of interpolated 3D data

How can I calculate a vector derivative (i.e. divergence, gradient, curl) of interpolated data? For sample data, you can use: ...
12
votes
2answers
2k views

How to calculate the control points of a Bézier curve?

To plot a BezierCurve in Mathematica, I need control points. But, I do not know the control points; I only know the points through which the Bézier curve passes. ...
12
votes
1answer
599 views

Custom interpolation on unstructured grid (2D, 3D)

as I'm not satisfied with the way Mathematica interpolates data on unstructured grids, I would like to implement my own interpolation. I will aim for Crouzeix - Raviart type of (quadratic) triangular ...
12
votes
1answer
2k views

Test if argument is inside domain of InterpolatingFunction

The documentation says In standard output format, only the domain element of an InterpolatingFunction object is printed explicitly. The remaining elements are indicated by <> But this is not the ...
11
votes
2answers
1k views

How to add an interpolating point to InterpolatingFunction?

Suppose I have an InterpolatingFunction object defined on $[\epsilon,1]$; let's call it f. What is the best way to construct a ...
11
votes
3answers
9k 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 ...
11
votes
1answer
1k views

Interpolation function way off

I have a simple list of data points to which I would like to fit an interpolation function. However, the results given by Interpolation[] gives an oscillating function which is not warranted by the ...
11
votes
1answer
189 views

Meaning of InterpolationOrder -> All for multidimensional interpolation

What specific method does Interpolation use for unstructured multi-dimensional data when we set InterpolationOrder -> All? ...
11
votes
1answer
1k views

How to get zeroth-order (piecewise constant) interpolation of scattered data?

Given a collection of scattered data points in 2D and associated function values, data = RandomReal[1, {100, 3}]; we can get a piecewise linear interpolating ...
11
votes
2answers
766 views

smooth spline through airfoil coordinates

I am trying to produce a smooth spline curve through a set of airfoil coordinates. An example for the data I am trying to use is here, and I am reading the file like so to get rid of some extraneous ...
11
votes
1answer
270 views

Incompatible InterpolatingFunction between V9 (and earlier) and V10

Bug introduced in 10.0.0 and fixed in 10.0.1 I am encountering compatibility issues when loading DumpSave(d) definitions in V10 that have been created with earlier ...
11
votes
2answers
2k views

How to make use of an interpolating function outside of Mathematica? [duplicate]

I'm currently working on a project where I have to solve some partial differential equations. Initially, I made some approximations so that an analytic solution could be obtained, and my ...
10
votes
5answers
413 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: ...
10
votes
5answers
2k views

Multidimensional interpolation with duplicate abscissa values [duplicate]

I am trying to do a first order interpolation on a multidimensional data set containing duplicate abscissa values (which Mathematica does not like), like this one: ...
10
votes
2answers
499 views

Morphing between two functions

Assume we have 2 peaked positive functions f[x_] := Exp[-(x + 3)^2] g[x_] := 1/2 Exp[-(x - 3)^2/4] that look like Would it be possible to numerically find a ...
10
votes
4answers
410 views

how to style multi-value interpolation function plot?

Is there a cleaner way to apply different styles to the different channels of a multi value interpolation function? here is a 2-output interpolation function: ...
10
votes
3answers
735 views

How can I speed up my compiled RBF interpolating function?

Overview I have a function that acts like the Interpolation on sparse $n$-dimensional data using a simple implementation of RBF interpolation method. I want my ...
10
votes
4answers
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-...
10
votes
2answers
979 views

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

Old package, works good ...
10
votes
2answers
795 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 ...
10
votes
2answers
924 views

interpolating function over dates

I've got a bunch of readings at various dates and times. I'd like to be able to interpolate and then integrate over, say days. I can do this by converting my date/time to ...
10
votes
2answers
382 views

Finding self-intersections of a closed curve represented by an interpolation function

I've been trying to find particular simple closed curves on a plane. ...
10
votes
2answers
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 <...
10
votes
1answer
250 views

Kernel Crash while using “ValuesOnGrid” method of InterpolatingFunction

Bug introduced in 10.0.0 and fixed in 10.2.0 I was experiencing some kernel crash while using "ValuesOnGrid" method of an ...
10
votes
2answers
1k views

Unexpected view of the Comsol result when I postprocess it in Mma

I simulated some nonlinear PDE using Comsol. Here one can find the results u=u(x,y) in the form of an Excel table with the terms ...
10
votes
1answer
228 views

Non-rectilinear integration of InterpolatingFunction

Bug introduced in 7 or earlier and persisting through 11.0.1 or later [CASE:3487737] I have a 2-d array that I would like to resample into a different coordinate system and integrate along one of ...
10
votes
1answer
260 views

Is there a way to change the interpolation scheme used in ListDensityPlot?

Recently I was trying to answer this question on how to make a smooth ListDensityPlot when I found that the output depends on the order of the data if you are using ...
9
votes
3answers
2k 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 ...
9
votes
4answers
1k views

How to speed up integration of interpolation function?

I have a list of data, and I interpolate it to a function. Then I need to do an integration with the interpolating function. But I found that the speed is unacceptably slow. My data is here (a little ...
9
votes
4answers
343 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 ...
9
votes
2answers
334 views

Partitioning a superset of coordinates into subsets that generate continuous curves

Consider the data set corresponding to recorded trajectories for a particle: ...
9
votes
2answers
686 views

Convert BSplineFunction into two Interpolating Functions

Is there a way to decompose a BSplineFunction output into two functions x[t], y[t] ...
9
votes
2answers
920 views

Build an InterpolatingFunction with ElementMeshInterpolation

Suppose you have a function f[t_, x_, y_] := t (1 - x^2 - y^2) defined for {x,y} in ...
9
votes
1answer
520 views

Smoothen the curve found by EdgeDetect

It seems that curves found by EdgeDetect always persist $C^{0}$ continuity only. Consider the following example: ...
9
votes
1answer
1k views

Smoothing out data points in a ListDensityPlot

I stumbled upon this problem when I was trying to make some nice smooth ListDensityPlots of my numerical data. In short, my problem is that I let Mathematica plot two copies of basically the exact ...
9
votes
2answers
875 views

Function Interpolation with Automatic / Algorithmic Values Mesh

I have an underlying function f(x,y,z) that is computationally intensive, but is smooth and continuous. I'm needing to find the function values along a line in xyz. Currently, I'm calculating f at ...
9
votes
1answer
160 views

Prevent Plus from threading InterpolatingFunction

For an InterpolatingFunction $y:\ \mathbb{R}\to\mathbb{R}^2$, Plus is unaware of this, so when I do any modifications to it in ...
9
votes
1answer
272 views

Smoothing the gradient of the potential function from a finite element calculation

The results from a finite element calculation using NDSolve are, in this case, a potential function expressed as an interpolation function. To get values from the potential function it is necessary to ...
8
votes
3answers
555 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. ...
8
votes
3answers
632 views

Linear interpolation of elements in a list to generate new list

For a list of any given length, I want to generate another list from it adding elements which are mean of the consecutive elements, in between the elements, of the original list. For example: ...
8
votes
1answer
4k views

Join a piecewise plot

I wrote some code to get a piecewise plot which is displayed correctly. Now I'd like to join the various parts of the plot, using some kind of interpolation, to get a continuous chart even though it's ...
8
votes
2answers
354 views

Complex continuation of an interpolated function

Context I have a complicated real function defined implicitly by a series of imbricated numerical integration. I need to make a continuation of this function for a complex variable which is easily ...
8
votes
2answers
652 views

Problem when defining function through NIntegrate and NDSolve and Interpolation - Bug?

More than a single question, I have some doubts about the output of certain functions when defined through the result of other calculations. I am an active user of Mathematica, but maybe I haven't ...
8
votes
2answers
296 views

Interpolating four-dimensional data

In this case it is not easy to work with a MWE, so I shall use the actual data which contain initial conditions $(x,y,p_x,p_y)$. Let's see how the data look on the $(x,y)$ plane ...
8
votes
3answers
154 views

Indexed and array-valued interpolations

Bug introduced in 10.1 or earlier and fixed in 10.4.0 Using Indexed on an InterpolatingFunction leads to an ...
8
votes
1answer
214 views

FEM-ception: Using output of NDSolve FEM as input in another FEM problem

After having solved a Stokes flow problem in Mathematica on a subdomain RegionCapillary, I would like to solve an advection-diffusion problem on a larger domain <...
8
votes
1answer
176 views

How to get `FindCurvePath` to return only one list

As you can see below, FindCurvePath returns only a part of the list, resulting in a partial interpolation. I would like to interpolate all the points. Complete ...