Questions tagged [interpolation]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
22 views

Nonnumerical result when using NIntegrate on piecewise interpolation function

Disclaimer: I'm relatively new to Mathematica. I'm numerically solving a differential equation using NDSolve whose solution I know is an even function. Thus, my ...
1 vote
1 answer
106 views

"Spline" interpolation not working

I have the following sample data ...
3 votes
1 answer
48 views

How do I get the complex conjugate of my interpolation?

I import an interpolation from C++ into mathematica which I then modify. Is there a way to obtain the conjugate of the interpolation? Or do I need to use $(f g)^* = f^* g^*$ and export the conjugated ...
0 votes
0 answers
33 views

Is the integration feature of an interpolated plot/function supposed to have a much larger maximum and range values in general?

So, I have imported data from a software called NextNano, plotting electron density. My first step was to define the data within the desired domain data={,},.... ...
2 votes
2 answers
144 views

Getting fluctuations in the derivative of interpolated functions [closed]

The code I use is as follows ip = Interpolation[data, InterpolationOrder -> 3]; Plot[{ip[x], ip'[x], ip''[x]}, {x, 0.05, 0.5}] I get fluctuations for the first ...
4 votes
4 answers
237 views

Best way to smooth, interpolate and differentiate over a list of data

I have a list given by: ...
2 votes
1 answer
355 views

Generate data through RandomVariate from an interpolated distribution [duplicate]

I have a few data point, that I can interpolate into a distribution. I want to be able to generate points that follow this distribution, but Mathematica does not seem to be happy. Here is my code: <...
1 vote
1 answer
662 views

How to interpolate data on unstructured grid?

I have the Hamilton system in 3D case ...
0 votes
0 answers
58 views

Interpolation with duplicate points

I have a set of data here I plotted and defined a list to only count a specific range of values. However my interpolation failed because there are duplicates of numbers in the data set. I had ...
0 votes
1 answer
100 views

Matrix as the discretization of a function $u$ over a rectangle in 3D, how to integrate fast along the axes

I have a function $u$ from 3D to 1D approximated in a list uu and I want to calculate e.g. $$\int_0^1 x\cdot u(x,y,z)dx$$ or $$\int_0^1\int_0^1\int_0^1 u(x,y,z)...
1 vote
0 answers
72 views

How does Mathematica's B-Spline NURBS work?

I'm finding that Mathematica is getting hung up on a numerical integration and I suspect I can do it faster myself in C++. I can scoop the control points of the BSplineFunction out of the ...
3 votes
1 answer
196 views

Geogebra spline command in Mathematica

Spline(pts, order, Weight Function) Creates a spline with given order through all points. The weight function says what should be the difference of t values for point $P_i$ and $P_{(i+1)}$ given ...
6 votes
1 answer
93 views

Are derivatives from interpolating functions created by NDSolve using derivatives of the spline or numerics from solving DE

For example given the code: ...
6 votes
1 answer
98 views

Understanding Interpolation with Cubic Splines

My ultimate question: given data, what function is Interpolation with Method->"Spline" creating? I recall from my ...
1 vote
0 answers
67 views

FunctionInterpolation with some datapoints to start with [closed]

Motivation: I am using FunctionInterpolation[COMSOL[x]] in combination with COMSOL to search for the interpolation of my COMSOL model. COMSOL needs a lot of time to ...
0 votes
1 answer
106 views

How to do Interpolation to this function after given b this values

χ[b_] := (Z/k)*NIntegrate[Subscript[f, pp1][q]*Subscript[F, pp1][q]*BesselJ[0, q*b]*q, {q, 0, b}]; bList = Table[b, {b, 0, 5.1 , 0.05}] where: ...
0 votes
0 answers
61 views

I am unable to plot 3D graph of integral function

I am not able to solve this integral ...
2 votes
0 answers
173 views

Call function defined in Mathematica from Matlab [closed]

Is it possible to call a defined function inside Mathematica like InterpolationFunction[...] from Matlab? Thanks!
1 vote
0 answers
41 views

Can I make a VectorPlot with a domain defined by an InterpolatingFunction?

I'd like to plot a vector field in a custom domain; I can do this using ImplicitRegion and a straightforward function. However, when I replace the function with an InterpolatingFunction I get a ...
1 vote
1 answer
90 views

Difference in interpolated data derivative and analytic function

I am trying to calculate the derivative of interpolated data but it behaves differently from the analytic solution. Detailed code that I have used follows: ...
0 votes
2 answers
60 views

Continuous partial derivative of an interpolated function

I know the values for a function v[x,y] on an irregular grid of (x,y) points. Call the table storing all these points xyvtriples. Because of the irregular grid, the Mathematica function ...
2 votes
2 answers
129 views

Finding the minimal distance of a point from an interpolated function

I have an interpolating parametric function (solution of a set of differential equations) and I have an external point. I would like to find the minimal distance between this point and the ...
7 votes
1 answer
397 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: ...
11 votes
2 answers
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 ...
6 votes
2 answers
270 views

Basic 3D Interpolation Failing

I've seen a few other posts asking about the "unstructured grid" error in Interpolation. Here's a minimal (non)working example of the issue: ...
3 votes
3 answers
429 views

Evaluate InterpolatingFunction of two variables on a 2D grid

I am using NDSolve to solve a system of pde's over a 2D domain: 2 equations and 2 unknowns which I call 'u' and 'v'. NDSolve returns an InterpolatingFunction for both 'u' and for 'v' and these are ...
6 votes
2 answers
252 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
1 answer
239 views

Multi-variable FunctionInterpolation with the range of one variable as a function of another

How can I modify my FunctionInterpolation code so that the boundary of one of the variables is a function of another variable? ...
4 votes
1 answer
212 views

How to interpolate between InterpolatingFunction objects

For some reasons I need to implement the method of lines instead of using the NDSolve function directly. As described in this tutorial, this is how the simplest PDE can be solved: ...
2 votes
1 answer
281 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, ...
1 vote
1 answer
62 views

Interpolation Function is not saved in notebook

I get the following message when an interpolation function is generated as a solution of NDSolve: I don't know why this warning is showing and I don't find anywhere where I can consult what this ...
0 votes
0 answers
19 views

Interpolating function error: stack trace value and notebook give different values for the out of bound inputs

So, I get the input out of bound error, in the notebook out put. ""Input value {3.,1.5708,3.14159} lies outside the range of data in the interpolating function." Values {3,Pi/2,Pi}. ...
3 votes
3 answers
217 views

How to get derivative of 2D data that is randomly stored in x and y?

I have 2d data in the form {x,y,f(x,y)} which is randomly stored. the random {x,y} for specific shape (square for ...
1 vote
2 answers
104 views

Integrate over one variable of a 2D interpolating function returned from NDEigensystem

I'm trying to implement the answer for "Integrate only one variable of a 2D interpolating function" (https://mathematica.stackexchange.com/a/161962/73672) but for interpolating functions ...
7 votes
2 answers
422 views

Interpolation of non-rectangular data failed

I want to interpolate a type of data which is on a triangular lattice in order to make DensityPlot faster(ListDensityPlot is so slow). However, the interoplation failed with error, no matter setting <...
59 votes
1 answer
3k views

What's inside InterpolatingFunction[{{1., 4.}}, <>]?

I'm curious what's inside the InterpolationFunction object? For example: ...
1 vote
0 answers
58 views

Interpolation problems for {X,Y,Z} data

I have some data in the form of {{X,Y},Z} that i want to interpolate for Z. (X takes the values from 0 to 40 and Y from 0 to 50000 and Z is from -10 to +10 and the data I have, have integer values of ...
2 votes
1 answer
48 views

Does Interpolation support multi-dimension input and output?

I have an interpolation problem with both multi-dim input and output. Here is an example of the error: ...
7 votes
1 answer
336 views

How to access the components of a vector-valued interpolating function?

I have a problem in accessing the components of a vector-valued interpolating function. I have the following data: data = {{0, {1, 0}}, {1, {0, 1}}}; with a ...
4 votes
1 answer
105 views

Conjugate of InterpolatingFunction?

From NDSolve, I got this: {{a1 -> InterpolatingFunction[{{0., 40.}}, "<>"]}} What would be a sensible approach to ...
11 votes
1 answer
336 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 ...
1 vote
0 answers
75 views

Smooth Interpolation Between Curves

I'm interested in finding a way to smoothly interpolated between graphics curves (and possibly shapes as well). My current solution is not very elegant ...
6 votes
1 answer
141 views

Fast integration of ElementMeshInterpolation[]-functions

In this simplified example I consider a small FEM-mesh ...
0 votes
0 answers
38 views

rotation and interpolation of x, y coordinates and displacement data

I have x, y coordinates and displacement values at these points as shown in figure. For instance if I select one point (A), I want to get the coordinates of B, which is rotated 120 degrees and find ...
1 vote
0 answers
54 views

Why do the two interpolation behave not the same?

I was trying to give the interpolation of a function $f(x)=1/(1+25x^2)$, then I met the problem below: As I want to see the behavior as the interpolation order became bigger, I set it progressed. And ...
0 votes
1 answer
244 views

Creating a numerical table of values and using an interpolation of them to transform pixels in an image by the ImageTransformation command

I am trying to carry out point "Implementing Map" on this paper Interstellar wormholes however I am using my own equations not those given (only the same method). I have generated a list of ...
1 vote
0 answers
125 views

How to evaluate an Integral which has Interpolating functions

I am trying to evaluate an Integral which has products of Interpolating functions inside, using NIntegrate command. It gives a wrong answer. The code that I used for performing this task is given ...
0 votes
2 answers
66 views

Problem with multidimensional interpolation: "Data point {0,0} contains abscissa 0, which is not a real number"

I'm trying to do a multidimensional interpolation. For simplicity, say I have the following array: {{{a,b},c},{{d,e},f},{{g,h},i}} This means that I have a two-...
5 votes
2 answers
217 views

Exporting data from a simply generated interpolating function

The question referenced in the link here has a title that matches my question, but the discussion is very complex and does not seem to address my issue. I have solved a partial differential equation ...
3 votes
1 answer
78 views

Interpolate a discrete vector field based on vectors which are not on a grid

I have a discrete set of vectors (in 2D), which I would like to use to construct an interpolating vector field. The vectors, however, are not located on an integer lattice and so the answer given at ...

1
2 3 4 5
19