Questions tagged [interpolation]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
70 views

How to make that interpolation?

I have the following dataset: SetDirectory[NotebookDirectory[]]; TableSpectrum = Import["spectrum.dat", "Table"]; I want to make the interpolation. However, when ...
4
votes
2answers
137 views

Trying to build a function to compute divided difference for arbitrary list of points

As the title says Im trying to build a function to compute divided difference for arbitrary list of points. The divided difference of a set of points $\{(x_1,y_1),\ldots, (x_n,y_n)\}$ where $x_j<...
0
votes
1answer
34 views

TargetUnits aren't working as expected on an InterpolatingFunction

Short version: My understanding of the use of TargetUnits in a Plot statement is that if the function being plotted has units, MMA will attempt to convert the output of that function to the unit form ...
3
votes
0answers
82 views

How to use an interpolating function as an intial condition for a PDE? [closed]

I want to be able to approximate a PDE, but my eigenfunction is an Interpolating function. Is there a way I can use an interpolating function as an initial condition in the PDE. For Example: ...
21
votes
1answer
633 views

Mismatch between Mathematica and COMSOL in 3D FEM problem

I would like to solve an advection-diffusion problem on a torus domain. There are three Dirichlet conditions: One at the inlet (concentration $c=0$), one at the outlet ($c=0.5$) and one at the wall ($...
2
votes
2answers
135 views

Fitting two-dimensional data

For this question, I cannot use random sample data. So the actual data can be found here. The data file contains three columns, where the first two are the coordinates $(x,y)$, while the third is the ...
3
votes
1answer
57 views

Problem with interpolating function returned by NDEigensystem

I'm trying to evaluate interpolating function returned by NDEigensystem at a point but Mathematica won't evaluate it. ...
1
vote
1answer
67 views

Transpose Error

I have this code: ...
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 ...
1
vote
2answers
75 views

Interpolating missing data

I have a data set that contains data of the form (x0, y0, f1, f2, i1, i2, i3). The (x0, y0) are the coordinates, while the values f1 and f2 are real numbers (i1, i2, i3 correspond to some integers ...
1
vote
1answer
70 views

Mesh quality error with interpolation of table

I am trying to interpolate a table of the following form. {{x1,y1,z1},{x2,y2,z2}...} Where z depends on x and y, and x ranges from 0.01 to 1 in steps of 0.01, ...
0
votes
0answers
64 views

InterpolatingFunction in NSolve

I'm trying to get NSolve to solve a simple system of equations. It makes use of various interpolating functions (for thermodynamic properties). I can solve the system outside of NSolve by ordering the ...
0
votes
1answer
122 views

Table and FindRoot of a two-variable interpolated function

I am having difficulty solving for the roots of the following interpolating function: ...
1
vote
1answer
41 views

The labels in the plot don't appear

the labels in the plot doesn't appear, axeslabel, plotlabel and plotlabels. ...
0
votes
0answers
40 views

Obtaining the equation type of an interpolated function

I used InterpolatingFunction on a set of points. How can I know the type of that equation ? (polynomial, sinusoidal, logarithmic,etc...). I am looking for a general case answer. Here is an example ...
5
votes
2answers
234 views

How can I fit a function onto a histogram?

SampleData = RandomVariate[RayleighDistribution[3], 5000]; Histogram[SampleData] This creates a histogram that (in my case) looks something like this: I want to ...
0
votes
1answer
40 views

How to obtain the correct interpolation for the following data?

I have a dataset DistrTemp.dat. It represents a set of data in the form {{x,y,z,f[x,y,z]}}. Here, x defines a system, while ...
0
votes
1answer
87 views

Interpolation function error: The quality of the underlying mesh is too low

Consider a dataset BplustoPiXlight.dat (alternative link). I import it and try to interpolate: ...
1
vote
0answers
31 views

Extra interpolation in ListPointPlot3D

I'm trying to plot a 3D surface using ListPointPlot3D and it looks almost right, but for some reason it's trying to connect points that should not connect. I think it's confused because the surface is ...
3
votes
0answers
54 views

BSpline vs natural spline [closed]

The BSpline in mathematica is defined mathematically here. These BSplines constitute basis for any Spline. But how do I define natural splines in mathematica, i.e. splines that are linear left of the ...
14
votes
3answers
1k views

2D smoothing spline interpolation

Does Mathematica have 2D smoothing spline interpolation built in? I requires an interpolation method with smooth first derivatives and cubic bivariate splines fulfill this nicely. In python I would ...
3
votes
2answers
71 views

Interpolation works slowly

Consider the following code: ...
1
vote
1answer
62 views

ElementMeshInterpolation and C1 splines

I am trying to use NDSolve`FEM`ElementMeshInterpolation on a triangular structured grid constructed from a Delaunay triangulation with zero area triangles dropped. ...
5
votes
1answer
134 views

Analyzing MethodOfLines

In this example the wave equation ...
3
votes
0answers
88 views

Parallel evaluation of RandomVariate for an InterpolatingFunction

I need to generate a lot of point according to a given distribution. I don't have an analytic form of this distribution so I am using an InterpolatingFunction of ~100 points computed numerically. I ...
0
votes
2answers
106 views

Finding the best representation of a numerically-inverted function via InterpolatingPolynomial and/or variations

Below is the routine I am using to sort of represent the numerically-inverted function TP. Basically I am finding a necessary interpolating polynomial ...
0
votes
0answers
23 views

Computing the volume enclosed by revolving a B-spline

I would like to ask if it's possible to get a function from a B-spline curve besides InterpolatingPolynomial[...]. I'm trying to use the function to compute the ...
5
votes
0answers
89 views

Why do some uses of PropertyList crash the kernel?

Bug introduced in 10.1.0 or earlier and persisting through 12.0.0 or later A support case with the identification [CASE:4222617] was created. While looking at the question How to evaluate the "...
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 ...
1
vote
2answers
44 views

Calculation using interpolating function

Say I have two replacement rules in terms of interpolating functions. ...
-1
votes
1answer
609 views
1
vote
1answer
54 views

2D interpolating function doesn't reproduce data

I have the following 2D data set: ...
0
votes
1answer
66 views

Problem with fit

I am trying to find a proper matching function for the following data set: ...
0
votes
0answers
31 views

Optimisation in the solution of Newton Interpolation

I have an exercise in which I have to solve the following Problem: Given Newton formula for the representation of a polynomial $q(x)$ given the values $y_j$ of $q(x)$ for $j$ between 0 and 5 $q(x)= \...
2
votes
1answer
67 views

FindFormula and Piecewise

The command FindFormula does not give me a right formula for simple data like this: ...
5
votes
0answers
88 views

Accuracy of Chebyshev Interpolation

I have been looking at how to interpolate a function using Chebyshev polynomials. There are several good posts such as this one by Michael E2 and this one by J. M. There is also an example in the help ...
2
votes
3answers
5k views

Using FindRoot with an interpolating function

This question bears resemblance to a few other questions on mathematica.SE about finding points of intersection of crossing curves. I know that the guidebook of numerics has an entry about the whole ...
3
votes
0answers
34 views

DumpSave and precision of interpolation data

Consider the following prec = 32; x = N[Range[0, 1, 1/10], prec]; f = Interpolation[Transpose@{x, y}]; Then ...
0
votes
0answers
73 views

Interpolation of data from table

How to do the interpolation of this data, so that I can plot the interpolated functionafter interpolation dat1 = Import["newdel(0.5).txt", "Table"] The entries ...
0
votes
0answers
72 views

How to remove unnecessary filling in ListPlot3D [duplicate]

I have the XYZ data points of this link (also here). If I plot this data ...
22
votes
5answers
6k views

Extracting the function from InterpolatingFunction object

I've used Interpolation[] to generate an InterpolatingFunction object from a list of integers. ...
2
votes
1answer
98 views

How to address the domain of an outputed interpolating function

I am solving a system of ODEs with DSolve, which returns the results as interpolating functions. The solver always stops after some finite time because of resolution issues, so the domain of the ...
1
vote
1answer
63 views

Smooth plot of coarsely spaced table values [closed]

In a simpler first case I plotted reasonably spaced (stability) contours by selecting a sequence of k values, ...
2
votes
3answers
179 views

Draw from continuous-discrete distribution

I have a random variable with a CDF that is almost everywhere differentiable, but has a point mass somewhere: ...
5
votes
2answers
391 views

Derivative of an interpolated function

I am trying to take the derivative of an interpolated function. I am given the function values and the derivatives at some irregular points. Here is my minimal working example to reproduce the error: ...
0
votes
0answers
48 views

What is causing this error in the Interpolation function?

I am using trying to understand someone else's code in Mathematica for the Finite Difference Method, except I changed a few values, but none of the code itself. Everything except for the Interpolation ...
2
votes
1answer
519 views

NDSolve going outside of the range of the interpolating function

I am trying to solve a differential equation that contains some interpolating functions as input, and for reasons unknown to me I am encountering an error which makes Mathematica use extrapolation. I ...
5
votes
0answers
66 views

Evaluation of Mod of InterpolatingFunction prevents discontinuity processing by Plot

While trying out @MichaelSeifert's answer to Eliminating Discontinuities When Using Mod with NDSolve and Plot for Oscillators, I came across this odd behavior. Depending on how an ...
3
votes
1answer
114 views

Approximating decay rate of an amplitude and frequency of an oscillating function

I have an InterpolatingFunction constructed from a discrete set of values obtained by numerical methods. Let's denote it $f(x)$. The function demonstrates an ...