Questions tagged [interpolation]

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

Filter by
Sorted by
Tagged with
8
votes
2answers
590 views

Using ListInterpolation to get a vector-valued function

I wanted to construct a ColorFunction from an image, so I tried ...
8
votes
1answer
338 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 ...
7
votes
4answers
577 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 ...
7
votes
2answers
594 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 ...
7
votes
4answers
1k views

Finding intersection points of two graphics [duplicate]

I am drawing a curve from a list using: ...
7
votes
2answers
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 ...
7
votes
2answers
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 ...
7
votes
1answer
6k 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 ...
7
votes
3answers
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 ...
7
votes
2answers
682 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, ...
7
votes
1answer
231 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. ...
7
votes
2answers
128 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 ...
7
votes
1answer
750 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 ...
7
votes
2answers
639 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 ...
7
votes
1answer
418 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 ...
7
votes
1answer
1k 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 ...
7
votes
1answer
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 ...
7
votes
1answer
103 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 ...
7
votes
0answers
142 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, ...
6
votes
2answers
792 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: ...
6
votes
3answers
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 ...
6
votes
2answers
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 ...
6
votes
5answers
725 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 ...
6
votes
2answers
430 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)$...
6
votes
2answers
435 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 ...
6
votes
3answers
597 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 ...
6
votes
2answers
356 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 ...
6
votes
2answers
255 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'...
6
votes
2answers
653 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 ...
6
votes
1answer
141 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 ...
6
votes
2answers
281 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 ...
6
votes
4answers
1k 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 ...
6
votes
1answer
400 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 ...
6
votes
2answers
194 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 ...
6
votes
2answers
493 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, ...
6
votes
1answer
649 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 ...
6
votes
3answers
722 views

Interpolation with boundary conditions

I'm working on a sales projection, trying to create some flexibility in handle the forecast using locators. The toy code is something like this: ...
6
votes
1answer
806 views

BSplineCurve Interpolation

Can I get interpolated values from this B-spline, (shown in red)? ...
6
votes
1answer
230 views

Interpolation of data

Consider a set of data points ...
6
votes
1answer
458 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: ...
6
votes
1answer
2k views

White spots in ListDensityPlot

I have a problem with ListDensityPlot. I have some data on an irregular grid. I try to plot them with ...
6
votes
1answer
110 views

Efficiently fill sparse matrix involving BSpline

Context In order to implement regularised fitting in 2 or 3 dimensions (as is done say here) using BSplineBasis one needs to evaluate a basis over a set of data. ...
6
votes
1answer
656 views

Multiply interpolating function with variable

I am always running into trouble when trying to use interpolating functions. I am trying to do: ...
6
votes
3answers
403 views

Interpolation impossible for ListPlot with Missing?

I have a list of data to plot. I would like to plot them with lines but delete some data before plotting and leave the lines disconnected where data is deleted. For example, ...
6
votes
1answer
139 views

Recycling solutions of multidimensional NDSolve

Dear wolfram community, I hope my problem is clear and easy to solve. I have already solved the following heat equation over a domain: ...
6
votes
1answer
314 views

What is wrong with this code? (Usage of FunctionInterpolation and how to make code efficient)

I am trying to create an interpolation out of a function that comes from an improper integral. The end goal is to make a 3d plot over a specific region. Specifically, I have the following code: ...
6
votes
1answer
146 views

2D interpolation of function with dependent interpolation border

My problem is to compute $$\int\limits_{x_{min}}^{x_{max}}\int\limits_{y_{min}}^{\sqrt{x^{2}-a^{2}}}W(x,y)g(x)\ dx\ dy$$ Because $W$ have highly oscillatory 2d complex numeric integral inside, dumb ...
6
votes
1answer
269 views

FunctionInterpolation error when specifying AccuracyGoal

Bug introduced in 8 or earlier and persisting through 11.0.1 or later In the help page ref/message/FunctionInterpolation/ncvb, it is mentioned that one should ...
6
votes
1answer
273 views

Evaluating InterpolatingFunction returned by NDSolve is very slow starting from some arguments

I use this code to solve a PDE: ...
6
votes
1answer
267 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 ...