# Questions tagged [interpolation]

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

832 questions
Filter by
Sorted by
Tagged with
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 ...
468 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. ...
318 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 ...
261 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 <...
165 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 ...
1k 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 ...
186 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 ...
649 views

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

I wanted to construct a ColorFunction from an image, so I tried ...
392 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 ...
722 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 ...
957 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 ...
712 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 ...
2k 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: ...
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 ...
142 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 ...
7k 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 ...
2k 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 ...
707 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, ...
73 views

### Make an InterpolatingFunction periodic

Interpolation can make an InterpolatingFunction periodic with the option ...
145 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 ...
484 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 ...
819 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 ...
658 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 ...
487 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 ...
183 views

### How to combine NDSolve interpolating functions?

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

### Interpolation won't give smooth output

I have a data, for example ...
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 ...
106 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 ...
167 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, ...
826 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: ...
429 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 ...
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 ...
443 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)$...
442 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 ...
656 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 ...
370 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 ...
279 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'...
671 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 ...
166 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 ...
318 views

### How to restrict InterpolatingFunction to a smaller domain?

How can I reduce the domain of an InterpolatingFunction? For example, consider if = FunctionInterpolation[x^2, {x, 0, 3}]. Is ...
249 views

### What is the Chebyshev method for InterpolationFunction?

With InterpolationOrder -> All, some methods of NDSolve returns interpolations with ...
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: ...
178 views

### Different results using spline interpolation in Wolfram and MATLAB

I use the same data for interpolation in Mathematica and MATLAB, but the result is different. ...
206 views

### Reduce the dimension of InterpolatingFunction

So I have been trying to extract 2D interpolating function(x,t) or (y,t) from 3D interpolating function(x,y,t) by replacing y=0 or x=0. My domain is triangular(see below). Ultimately, I want to ...
559 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, ...
686 views

### ListPlot3D of a set of points in a non-convex region

I would like to plot a set of points in the same style as ListPlot3D does, but only in a non-convex region that I can specify (e.g. using a ...