# Questions tagged [interpolation]

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

868 questions
Filter by
Sorted by
Tagged with
4k 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 ...
779 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: ...
2k views

### Transform an InterpolatingFunction

I'd like to transform an InterpolatingFunction from NDSolve but can't figure out how. Here's an example. The equation I want to solve is ...
661 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 ...
602 views

### How do you interpolate outside the range of data?

I've got a simple interpolation function using data from an external program. For values above 3,000, the function reaches a limit. ...
114 views

### Make an InterpolatingFunction periodic

Interpolation can make an InterpolatingFunction periodic with the option ...
334 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 ...
525 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 ...
174 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 ...
2k 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 ...
3k views

### Interpolation won't give smooth output

I have a data, for example ...
196 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 ...
673 views

### Using ListInterpolation to get a vector-valued function

I wanted to construct a ColorFunction from an image, so I tried ...
3k views

### Smoothing/Averaging 2D Vector Fields

I have a list of 2D vectors defined by {{x,y},{u,v}} and would like to smooth or average the vectors. For example here are 2 vector fields, the second has noise ...
418 views

### Bug? Problem with derivative of interpolating function from FEM

Bug introduced in 10 or earlier and fixed in version 10.4 I am really not sure if this is a bug or I am missing something very trivial. QUESTION: What I am missing in order to obtain the partial ...
809 views

### FindMaximum of Interpolated data set

Probably a fairly easy one; but I'm drawing a blank I would like to find the maximum of an interpolated data set. I've tried using ...
1k views

### How can I get a discrete result from NDSolve?

When I use NDsolve to solve a differential equations, it returns an interpolation function of the discrete result. Because I haven't found another way to do Fourier ...
788 views

### How do you calculate the 2d area between list points?

I have a 2D surface in 3D (it's a cut) given in data points of the form (x,y,z): data = ToExpression@Import["http://pastebin.com/raw/6ufm8bx3", "String"]; What ...
3k views

### Exporting interpolating functions to excel

I have a question about exporting an InterpolatingFunction to Excel. I checked the forum, but I still couldn't completely understand how to solve my problem. Could ...
3k views

### How to get the coordinates of the intersection of two lines from a ListLinePlot?

Suppose I have two curves intersect at some point, how can I read the coordinates from the graph, not read by eye, but find it with more precision by computer. For example, here are two lists created ...
2k views

### Finding intersection points of two graphics [duplicate]

I am drawing a curve from a list using: ...
688 views

### Interpolation steeply drops to 0 beyond data

I use Interpolation on unstructured 3-D-Data to visualize different regions via RegionPlot. A problem I run into is that the interpolating function steeply drops to zero beyond my set of data. This is ...
2k views

### ListContourPlot interpolation screws up on concave set of data

I want to create ListContourPlots for sets of Data (from a physics simulation) given as Triplets {x, y, f(x, y)}. Certain parameter regions in the x-y-plane are ...
144 views

### Plotting a directed contour with self-intersections

I have an ordered sequence of points along a closed directed planar contour with self-intersections. I need to find a continuous curve interpolating those points and plot it, with small arrowheads ...
135 views

### PeriodicInterpolation does not work in ElementMeshInterpolation

I want to use ElementMeshInterpolation to generate interpolation function with periodic boundary condition. I use below data as an example ...
3k views

### Piecewise Polynomial Interpolation

Given some data pairs $(x_i,y_i)$, with $i=0,...,m$, and a degree $r$, I wish to build a piecewise polynomial function to interpolate these data. That interpolation should be continuous, and, on every ...
713 views

### How to find Matano plane

I have discrete collection of data points (10 to 10^4). I want to describe them by a continuous function and find a x value z, ...
155 views

### Bug in VectorFieldPlot[] with InterpolatingFunction[]?

Bug introduced in 11.3 or earlier and persisting through 12.0.0 or later While looking at https://mathematica.stackexchange.com/questions/192081/how-do-i-plot-a-divergence, I thought to suggest the ...
862 views

### StreamPlot with interpolating functions

While working my way through the Wolfram Blog post on simulating fluid flow I started playing with StreamPlot because I preferred quick and ugly visualizations over ...
666 views

### Why Interpolation makes ListPlot3D slow?

I'm trying to use ListPlot3D to plot some data, and I'm using the InterpolationOrder option to make the plot smoother. But the ...
889 views

### BSplineCurve Interpolation

Can I get interpolated values from this B-spline, (shown in red)? ...
583 views

### Getting an explicit representation of the function returned from Interpolation [duplicate]

I am using Interpolation to get an InterpolatingFunction that fits a set of points. For example, ...
510 views

### How do I reverse the X-axis on a ListDensityPlot?

I want to use ListDensityPlot on a dataset containing a few (~600) triplets and I would like to reverse one of the axes. Sadly, the workaround involving the ...
233 views

### How to combine NDSolve interpolating functions?

In the following working example ...
662 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: ...
2k views

### How to avoid creating negative values when using Interpolation?

I'm having some problems with Interpolation. I'm trying to interpolating some measurements data into mathematica. But using Interpolation will create some negative data, which is actually not possible ...
109 views

### Weird behaviour for a vector InterpolatingFunction inside an NDSolve

I have run into some weird behaviour on the part of NDSolve which I find pretty bizarre and which I would like to understand better. Suppose, for the sake of ...
317 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 ...
186 views

### InterpolationOrder has no effect on ListContourPlot when the data is of the form {x,y,f[x,y]}

This is related to the issue brought up here, if you want to mark it as duplicate feel free to do so, but it is slightly separate. Take two sets of data, identical except for the form, ...
830 views

### Integration of Interpolated function take an unacceptable amount of time

I have a simple integration which, when using an interpolation function, is taking too long to calculate: ...
459 views

### Finding a set of line segments to fit noisy data

Looking for a methodology to choose line segments that are a rough fit to a given set of data. In this example, the data are {x,y} pairs. For example, if the data looked like what is shown on the ...
449 views

### An interpolation problem

Let $f:[0,2]\to\Bbb{R}^+$ be the function give by $$f(x)=\sqrt{x(2-x)}.$$ I need to find (the exact values of) constants $a_1, a_2,a_3,a_4$ in $$g(x)=\sum_{k=1}^4a_kx^k(2-x)^k$$ such that $f(x)=g(x)$...
444 views

### Function that is a good fit to the plot made with SmoothHistogram

How can I find a function that fits the plot from the SmoothHistogram function? For instance if I have data like this and plot a ...
375 views

### Funky behaviour of derivative

I'm solving a set of differential equations for the variables H(t), x(t) and a(t). Then I construct a function z(t) from these, and another function w(t) from z(t). w(t) contains terms such as the ...
295 views

### FunctionInterpolation and Which combine badly

Update 2: Got two solid answers, but had trouble implementing one, and found the other could only save me computation time by sacrificing accuracy. So I chose neither as an official answer, but they'...
682 views

### How can I force points in a list to have distinct x values?

I have a list of points that may be used for linear interpolation using Interpolation and need to ensure that no two points have the same $x$ value, since, if they ...
193 views

### How can I accelerate repeated interpolation of a very large dataset?

I am solving a 4D time-dependent PDE using a discretization method. My query is not about solving this; because I am doing it in the following code. The code is OK and it works fine. My main problem ...
7k 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 ...