Questions tagged [interpolation]

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

Filter by
Sorted by
Tagged with
13
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 ...
13
votes
3answers
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 ...
13
votes
1answer
945 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 ...
13
votes
0answers
823 views

Interpolation on an unstructured (mostly-structured) grid in 4D+

I frequently need to perform interpolations on an unstructured grid. Mostly, with the purpose of filling grid holes and then later continue with regular grid interpolations. Mathematica V9 and V10 ...
12
votes
4answers
432 views

Interpolation on an unstructured mesh

(Edit: This question is about making a mesh on a 2D surface to work with a 3D surface look at ElementMeshInterpolation on a BoundaryMesh ) I have experimental data in the form of { {x1, y1, z1}, {x2, ...
12
votes
2answers
2k views

How to use Interpolation to fill in missing data

I have a bit of data that looks like this: ...
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
8k 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
3k 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
2answers
936 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 ...
12
votes
2answers
371 views

Rescaling data to make a “continuous” function

I have acquired many sets of data, which all represent a single function, but which are randomly rescaled by a constant (due to the measurement specifics). I'm looking to effectively stitch them ...
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
5answers
485 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: ...
11
votes
5answers
3k 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: ...
11
votes
2answers
1k views

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

Old package, works good ...
11
votes
2answers
1k 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 ...
11
votes
1answer
2k 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
274 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
1answer
277 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
3answers
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 ...
10
votes
2answers
640 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
2k 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 ...
10
votes
4answers
475 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
858 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
858 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
470 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

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 ...
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
275 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
247 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
166 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 ...
10
votes
1answer
352 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
659 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. ...
9
votes
1answer
5k 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 ...
9
votes
4answers
456 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
353 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
674 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 ...
9
votes
1answer
8k views

How to Take Derivative of Interpolating Function? [closed]

So I have two numerical differentialequations which yield a InterpolatingFunction each, potentialup and potentialdown. I have ...
9
votes
2answers
757 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
283 views

Unexpected 'switch' of partial derivatives when differentiating InterpolatingFunction

Bug introduced in 11.3 or earlier and persisting through 12.1.0 or later - Fixed in Version: 12.1.1 In short, there is a simple initial boundary-value problem for which NDSolveValue produces an ...
9
votes
1answer
285 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 <...
9
votes
1answer
609 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
2k 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
914 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
346 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 ...

1
2
3 4 5
18